Module: Orats::Commands::UI
Instance Method Summary collapse
- #git_commit(message) ⇒ Object
- #log_error(top_label, top_message, bottom_label, bottom_message, strip_newline = false) ⇒ Object
- #log_remote_info(top_label, top_message, bottom_label, bottom_message) ⇒ Object
- #log_results(results, message) ⇒ Object
- #log_status_bottom(type, message, color, strip_newline = false) ⇒ Object
- #log_status_top(type, message, color) ⇒ Object
- #log_task(message) ⇒ Object
- #run_from(path, command) ⇒ Object
Instance Method Details
#git_commit(message) ⇒ Object
42 43 44 |
# File 'lib/orats/commands/ui.rb', line 42 def git_commit() run_from @active_path, "git add -A && git commit -m '#{message}'" end |
#log_error(top_label, top_message, bottom_label, bottom_message, strip_newline = false) ⇒ Object
27 28 29 30 31 |
# File 'lib/orats/commands/ui.rb', line 27 def log_error(top_label, , bottom_label, , strip_newline = false) log_status_top top_label, "#{top_message}:", :red log_status_bottom bottom_label, , :yellow, strip_newline yield if block_given? end |
#log_remote_info(top_label, top_message, bottom_label, bottom_message) ⇒ Object
33 34 35 36 |
# File 'lib/orats/commands/ui.rb', line 33 def log_remote_info(top_label, , bottom_label, ) log_status_top top_label, "#{top_message}:", :blue log_status_bottom bottom_label, , :cyan end |
#log_results(results, message) ⇒ Object
22 23 24 25 |
# File 'lib/orats/commands/ui.rb', line 22 def log_results(results, ) log_status_top 'results', "#{results}:", :magenta log_status_bottom 'message', , :white end |
#log_status_bottom(type, message, color, strip_newline = false) ⇒ Object
17 18 19 20 |
# File 'lib/orats/commands/ui.rb', line 17 def log_status_bottom(type, , color, strip_newline = false) say_status type, , color puts unless strip_newline end |
#log_status_top(type, message, color) ⇒ Object
12 13 14 15 |
# File 'lib/orats/commands/ui.rb', line 12 def log_status_top(type, , color) puts say_status type, set_color(, :bold), color end |
#log_task(message) ⇒ Object
6 7 8 9 10 |
# File 'lib/orats/commands/ui.rb', line 6 def log_task() puts say_status 'task', "#{message}:", :yellow puts '-'*80, ''; sleep 0.25 end |
#run_from(path, command) ⇒ Object
38 39 40 |
# File 'lib/orats/commands/ui.rb', line 38 def run_from(path, command) run "cd #{path} && #{command} && cd -" end |