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?, #kill, #resume

Constructor Details

#initialize(arguments, **options) ⇒ Spawn

Returns a new instance of Spawn.



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

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

Instance Attribute Details

#argumentsObject (readonly)

Returns the value of attribute arguments.



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

def arguments
  @arguments
end

Instance Method Details

#call(**options) ⇒ Object



69
70
71
72
73
# File 'lib/process/group.rb', line 69

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