Method: CommandMapper::Command.spawn

Defined in:
lib/command_mapper/command.rb

.spawn(params = {}, **kwargs) {|command| ... } ⇒ Integer

Initializes and spawns the command as a separate process, returning the PID of the process.

Parameters:

  • params (Hash{Symbol => Object}) (defaults to: {})

    The option and argument values.

  • kwargs (Hash{Symbol => Object})

    Additional keywords arguments. These will be used to populate the command's params.

Yields:

  • (command)

    The newly initialized command.

Yield Parameters:

Returns:

  • (Integer)

    The PID of the new command process.

Raises:

  • (Errno::ENOENT)

    The command could not be found.

Since:

  • 0.2.0



134
135
136
137
# File 'lib/command_mapper/command.rb', line 134

def self.spawn(params={},**kwargs,&block)
  command = new(params,**kwargs,&block)
  command.spawn_command
end