Exception: Open4::SpawnError

Inherits:
Error show all
Defined in:
lib/alib-0.5.1/open4.rb,
lib/alib-0.5.1/open4-0.9.1.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cmd, status) ⇒ SpawnError

Returns a new instance of SpawnError.



87
88
89
90
91
92
93
94
95
96
# File 'lib/alib-0.5.1/open4.rb', line 87

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)

–{{{



81
82
83
# File 'lib/alib-0.5.1/open4.rb', line 81

def cmd
  @cmd
end

#signalsObject (readonly)

Returns the value of attribute signals.



83
84
85
# File 'lib/alib-0.5.1/open4.rb', line 83

def signals
  @signals
end

#statusObject (readonly)

Returns the value of attribute status.



82
83
84
# File 'lib/alib-0.5.1/open4.rb', line 82

def status
  @status
end

Instance Method Details

#exitstatusObject



84
85
86
# File 'lib/alib-0.5.1/open4.rb', line 84

def exitstatus
  @status.exitstatus
end