Class: TerminalWriter

Inherits:
Writer
  • Object
show all
Defined in:
lib/teuton-get/writer/terminal_writer.rb

Instance Method Summary collapse

Instance Method Details

#write(text = "", args = {}) ⇒ Object



6
7
8
# File 'lib/teuton-get/writer/terminal_writer.rb', line 6

def write(text = "", args = {})
  print TeutonGet::Format.colorize(text, args[:color])
end

#write_table(rows) ⇒ Object



14
15
16
17
18
# File 'lib/teuton-get/writer/terminal_writer.rb', line 14

def write_table(rows)
  table = TTY::Table.new(rows)
  # puts table.render(:basic)
  puts table.render(:ascii)
end

#writeln(text = "", args = {}) ⇒ Object



10
11
12
# File 'lib/teuton-get/writer/terminal_writer.rb', line 10

def writeln(text = "", args = {})
  write("#{text}\n", args)
end