Class: Bosh::Core::Shell

Inherits:
Object
  • Object
show all
Defined in:
lib/bosh/core/shell.rb

Instance Method Summary collapse

Constructor Details

#initialize(stdout = $stdout) ⇒ Shell

Returns a new instance of Shell.



3
4
5
# File 'lib/bosh/core/shell.rb', line 3

def initialize(stdout = $stdout)
  @stdout = stdout
end

Instance Method Details

#run(command, options = {}) ⇒ Object



7
8
9
10
11
12
13
14
# File 'lib/bosh/core/shell.rb', line 7

def run(command, options = {})
  output_lines = run_command(command, options)
  output_lines = tail(output_lines, options)

  command_output = output_lines.join("\n")
  report(command, command_output, options)
  command_output
end