Exception: Unravel::Exec::Error::Silent

Inherits:
Unravel::Exec::Error show all
Defined in:
lib/unravel/exec.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(exitcode, stdout) ⇒ Silent

Returns a new instance of Silent.



10
11
12
13
14
# File 'lib/unravel/exec.rb', line 10

def initialize(exitcode, stdout)
  @exitcode = exitcode
  @stdout = stdout
  super()
end

Instance Attribute Details

#exitcodeObject (readonly)

Returns the value of attribute exitcode.



8
9
10
# File 'lib/unravel/exec.rb', line 8

def exitcode
  @exitcode
end

#exitstatusObject (readonly)

Returns the value of attribute exitstatus.



9
10
11
# File 'lib/unravel/exec.rb', line 9

def exitstatus
  @exitstatus
end

Instance Method Details

#messageObject



20
21
22
23
24
25
26
27
28
29
30
# File 'lib/unravel/exec.rb', line 20

def message
  lines = @stdout.lines.to_a
  output =
    if lines.size > 1
      indent = "\n  stdout"
      "#{indent}: #{lines * indent}\n"
    else
      "stdout: #{@stdout.inspect}"
    end
  "No stderr available: #{output} (exited with #{@exitcode})"
end

#to_sObject



16
17
18
# File 'lib/unravel/exec.rb', line 16

def to_s
  message
end