Class: Process::Group::Spawn

Inherits:
Command
  • Object
show all
Defined in:
lib/process/group.rb

Overview

Executes a command using Process.spawn with the given arguments and options.

Instance Attribute Summary collapse

Attributes inherited from Command

#options, #pid

Instance Method Summary collapse

Methods inherited from Command

#foreground?, #resume

Constructor Details

#initialize(arguments, **options) ⇒ Spawn

Returns a new instance of Spawn.



57
58
59
60
61
# File 'lib/process/group.rb', line 57

def initialize(arguments, **options)
	@arguments = arguments
	
	super(**options)
end

Instance Attribute Details

#argumentsObject (readonly)

Returns the value of attribute arguments.



63
64
65
# File 'lib/process/group.rb', line 63

def arguments
  @arguments
end

Instance Method Details

#call(**options) ⇒ Object



65
66
67
68
69
# File 'lib/process/group.rb', line 65

def call(**options)
	options = @options.merge(options)
	
	@pid = Process.spawn(*@arguments, **options)
end