Exception: Open4::SpawnError

Inherits:
Error
  • Object
show all
Defined in:
lib/open4.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cmd, status) ⇒ SpawnError

Returns a new instance of SpawnError.



123
124
125
126
127
128
129
130
131
132
# File 'lib/open4.rb', line 123

def initialize cmd, status
  @cmd, @status = cmd, status
  @signals = {} 
  if status.signaled?
    @signals['termsig'] = status.termsig
    @signals['stopsig'] = status.stopsig
  end
  sigs = @signals.map{|k,v| "#{ k }:#{ v.inspect }"}.join(' ')
  super "cmd <#{ cmd }> failed with status <#{ exitstatus.inspect }> signals <#{ sigs }>"
end

Instance Attribute Details

#cmdObject (readonly)

Returns the value of attribute cmd.



117
118
119
# File 'lib/open4.rb', line 117

def cmd
  @cmd
end

#signalsObject (readonly)

Returns the value of attribute signals.



119
120
121
# File 'lib/open4.rb', line 119

def signals
  @signals
end

#statusObject (readonly)

Returns the value of attribute status.



118
119
120
# File 'lib/open4.rb', line 118

def status
  @status
end

Instance Method Details

#exitstatusObject



120
121
122
# File 'lib/open4.rb', line 120

def exitstatus
  @status.exitstatus
end