Module: Scatter::Shell
Instance Attribute Summary collapse
-
#command_log ⇒ Object
Returns the value of attribute command_log.
-
#dry_run ⇒ Object
Returns the value of attribute dry_run.
Instance Method Summary collapse
Instance Attribute Details
#command_log ⇒ Object
Returns the value of attribute command_log.
6 7 8 |
# File 'lib/scatter/shell.rb', line 6 def command_log @command_log end |
#dry_run ⇒ Object
Returns the value of attribute dry_run.
5 6 7 |
# File 'lib/scatter/shell.rb', line 5 def dry_run @dry_run end |
Instance Method Details
#capture(command) ⇒ Object
13 14 15 16 |
# File 'lib/scatter/shell.rb', line 13 def capture(command) log_command command %x{#{command}} unless dry_run end |
#clear_log ⇒ Object
18 19 20 |
# File 'lib/scatter/shell.rb', line 18 def clear_log self.command_log = [] end |
#execute(command) ⇒ Object
8 9 10 11 |
# File 'lib/scatter/shell.rb', line 8 def execute(command) log_command command system command unless dry_run end |