Class | Rascut::Plugin::Screen |
In: |
lib/rascut/plugin/screen.rb
|
Parent: | Base |
STATUS | = | %q[%H %`%-w%{=b bw}%n %t%{-}%+w %=] |
SCREEN_CMD | = | 'screen' |
SCREEN_COLOR | = | { :black => 'dd', :blue => 'bk', :green => 'gk', :red => 'rw', } |
# File lib/rascut/plugin/screen.rb, line 35 35: def message(msg, color = :black) 36: if run_screen_session? 37: col = SCREEN_COLOR[color] 38: msg = %Q[ %{=b #{col}} #{msg} %{-}] 39: send_cmd(msg) 40: end 41: end
# File lib/rascut/plugin/screen.rb, line 17 17: def run 18: @command.wrapper.hooks[:compile_start] << method(:start) 19: @command.wrapper.hooks[:compile_error] << method(:error) 20: @command.wrapper.hooks[:compile_success] << method(:success) 21: end
# File lib/rascut/plugin/screen.rb, line 47 47: def run_screen_session? 48: str = `#{SCREEN_CMD} -ls` 49: str.match(/(\d+) Socket/) && ($1.to_i > 0) 50: end