Skip to content

kill-2/tty-live

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TTY::Live

This is a wrapper for TTY::Cursor to help you refresh console.

Installation

bundle add tty-live

If bundler is not being used to manage dependencies, install the gem by executing:

gem install tty-live

Usage

require 'tty-live'

live = TTY::Live.new

10.times do
  sky = 10.times.map{100.times.map{rand(100) >= 99 ? '*' : ' '}.join}.join("\n")
  live.update(sky)
  sleep 1
end

puts

And you can access TTY::Cursor's methods through TTY::Live instance:

# same as `print TTY::Cursor.up(5) + TTY::Cursor.forward(2)`
print live.up(5) + live.forward(2)

Development

Follow your heart.

License

The gem is available as open source under the terms of the MIT License.

About

No description, website, or topics provided.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors