Exception: Babushka::Shell::ShellCommandFailed

Inherits:
StandardError
  • Object
show all
Defined in:
lib/babushka/shell.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cmd, stdout, stderr) ⇒ ShellCommandFailed

Returns a new instance of ShellCommandFailed.



9
10
11
12
13
14
15
16
17
# File 'lib/babushka/shell.rb', line 9

def initialize cmd, stdout, stderr
  @cmd, @stdout, @stderr = cmd, stdout, stderr
  message = if stderr.empty?
    "Shell command failed: '#{cmd.join(' ')}'"
  else
    "Shell command failed: '#{cmd.join(' ')}':\n#{stderr}"
  end
  super message
end

Instance Attribute Details

#cmdObject (readonly)

Returns the value of attribute cmd.



8
9
10
# File 'lib/babushka/shell.rb', line 8

def cmd
  @cmd
end

#stderrObject (readonly)

Returns the value of attribute stderr.



8
9
10
# File 'lib/babushka/shell.rb', line 8

def stderr
  @stderr
end

#stdoutObject (readonly)

Returns the value of attribute stdout.



8
9
10
# File 'lib/babushka/shell.rb', line 8

def stdout
  @stdout
end