Module: Process::StatusExtensions

Included in:
Status
Defined in:
lib/polyphony/extensions/process.rb

Instance Method Summary collapse

Instance Method Details

#coredump?Boolean

Returns:

  • (Boolean)


6
7
8
# File 'lib/polyphony/extensions/process.rb', line 6

def coredump?
  @status ? nil : super
end

#exited?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/polyphony/extensions/process.rb', line 10

def exited?
  @status ? WIFEXITED(@status[1]) : super
end

#exitstatusObject



14
15
16
# File 'lib/polyphony/extensions/process.rb', line 14

def exitstatus
  @status ? WEXITSTATUS(@status[1]) : super
end

#inspectObject



18
19
20
# File 'lib/polyphony/extensions/process.rb', line 18

def inspect
  @status ? "#<Process::Status: pid #{@status[0]} exit #{@status[1]}>" : super
end

#pidObject



22
23
24
# File 'lib/polyphony/extensions/process.rb', line 22

def pid
  @status ? @status[0] : super
end

#signaled?Boolean

Returns:

  • (Boolean)


26
27
28
# File 'lib/polyphony/extensions/process.rb', line 26

def signaled?
  @status ? WIFSIGNALED(@status[1]) : super
end

#stopped?Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/polyphony/extensions/process.rb', line 30

def stopped?
  @status ? WIFSTOPPED(@status[1]) : super
end

#stopsigObject



34
35
36
# File 'lib/polyphony/extensions/process.rb', line 34

def stopsig
  @status ? WIFSTOPPED(@status[1]) && WEXITSTATUS(@status[1]) : super
end

#success?Boolean

Returns:

  • (Boolean)


38
39
40
# File 'lib/polyphony/extensions/process.rb', line 38

def success?
  @status ? @status[1] == 0 : super
end

#termsigObject



42
43
44
# File 'lib/polyphony/extensions/process.rb', line 42

def termsig
  @status ? WIFSIGNALED(@status[1]) && WTERMSIG(@status[1]) : super
end