Class: Honcho::UIRunner

Inherits:
Runner
  • Object
show all
Defined in:
lib/honcho/ui_runner.rb

Constant Summary

Constants included from Colors

Colors::COLORS

Instance Attribute Summary

Attributes inherited from Runner

#adapters, #adapters_by_app, #colors, #config_file_path, #redis, #root_path, #running, #stopping

Instance Method Summary collapse

Methods inherited from Runner

#initialize, #interval, #spawn, #stop_delay

Methods included from Colors

#assign_colors_for_ansi, #assign_colors_for_curses

Constructor Details

This class inherits a constructor from Honcho::Runner

Instance Method Details

#log(name, message) ⇒ Object



18
19
20
21
22
23
24
25
26
# File 'lib/honcho/ui_runner.rb', line 18

def log(name, message)
  (color_index, color_quality) = colors[name]
  @log.attron(Curses.color_pair(color_index) | color_quality) do
    @log.addstr(name.rjust(label_width))
  end
  @log.addstr(': ')
  @log.addstr(message)
  @log.refresh
end

#runObject



8
9
10
11
12
13
14
15
16
# File 'lib/honcho/ui_runner.rb', line 8

def run
  setup_curses
  @colors = assign_colors_for_curses
  init_log_window
  draw
  super
ensure
  unsetup_curses
end