Module: SpecWatchr::CommandLine
- Included in:
- SpecWatchr
- Defined in:
- lib/rspec-rails-watchr-emacs.rb
Instance Method Summary collapse
Instance Method Details
#clear! ⇒ Object
29 30 31 |
# File 'lib/rspec-rails-watchr-emacs.rb', line 29 def clear! system 'clear' end |
#run(cmd) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/rspec-rails-watchr-emacs.rb', line 17 def run cmd puts "=== running: #{cmd} ".ljust(terminal_columns, '=').cyan results = `#{cmd}` success = $?.success? unless @custom_extract_summary_proc puts " " + results.split("\n")[@error_count_line].strip.send(success ? :green : :red) end puts "===".ljust(terminal_columns, '=').cyan # {:success => success, :results => message} results end |
#terminal_columns ⇒ Object
12 13 14 15 |
# File 'lib/rspec-rails-watchr-emacs.rb', line 12 def terminal_columns cols = `stty -a`.scan(/ (\d+) columns/).flatten.first $?.success? ? cols.to_i : nil end |