Module: VeryGood

Defined in:
lib/very_good.rb,
lib/very_good/ansi.rb,
lib/very_good/cell.rb,
lib/very_good/state.rb,
lib/very_good/cursor.rb,
lib/very_good/version.rb,
lib/very_good/terminal.rb

Defined Under Namespace

Modules: Ansi Classes: Cell, Cursor, State, Terminal

Constant Summary collapse

VERSION =
"0.1.0"

Class Method Summary collapse

Class Method Details

.startObject



10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/very_good.rb', line 10

def start
  save_tty
  setup_tty
  terminal = VeryGood::Terminal.new(
    width: command("tput cols").strip.to_i,
    height: command("tput lines").strip.to_i
  )
  terminal.clear!
  terminal.move_cursor(0, 0)
  yield terminal
ensure
  restore_tty
end