Class: CommandButler::ResultDecorator
- Inherits:
-
Object
- Object
- CommandButler::ResultDecorator
- Defined in:
- lib/command_butler/result_decorator.rb
Class Method Summary collapse
- .decoration_frame(command: command, index: index, &block) ⇒ Object
- .decoration_stderr(stderr: stderr, status: status) ⇒ Object
- .decoration_stdout(stdout: stdout, status: status) ⇒ Object
Class Method Details
.decoration_frame(command: command, index: index, &block) ⇒ Object
3 4 5 6 7 |
# File 'lib/command_butler/result_decorator.rb', line 3 def self.decoration_frame(command:command,index:index, &block) puts head = "-- [#{index+1}] #{command.command || command.chdir} " + "-" * 30 yield puts "-" * head.length end |
.decoration_stderr(stderr: stderr, status: status) ⇒ Object
14 15 16 17 |
# File 'lib/command_butler/result_decorator.rb', line 14 def self.decoration_stderr(stderr: stderr, status:status) puts stderr puts "\e[31m error status:" + status.to_i.to_s+ "\e[0m" end |
.decoration_stdout(stdout: stdout, status: status) ⇒ Object
9 10 11 12 |
# File 'lib/command_butler/result_decorator.rb', line 9 def self.decoration_stdout(stdout: stdout, status:status) puts stdout puts "\e[32m success status:" + status.to_i.to_s + "\e[0m" end |