Module: Scatter::Shell

Extended by:
Shell
Included in:
Shell
Defined in:
lib/scatter/shell.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#command_logObject

Returns the value of attribute command_log.



6
7
8
# File 'lib/scatter/shell.rb', line 6

def command_log
  @command_log
end

#dry_runObject

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_logObject



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