Class: Fudge::Tasks::SubProcess

Inherits:
Shell show all
Defined in:
lib/fudge/tasks/sub_process.rb

Overview

Allow use of shell commands as tasks.

Unlike Fudge::Shell, this task will not spawn a new shell.

Allows the caller to set environment variables for the process, and to specify process attributes, as with Process::Spawn.

The constructor and #run method each accept two new options, :environment and :spawn_options.

Instance Attribute Summary collapse

Attributes inherited from Shell

#arguments, #check_for

Attributes inherited from Task

#args, #options

Method Summary

Methods inherited from Shell

#initialize, #run

Methods inherited from Task

#initialize, name

Constructor Details

This class inherits a constructor from Fudge::Tasks::Shell

Instance Attribute Details

#environmentHash

Returns environment variables to be set for the process; the keys are strings, corresponding to the variables’ names (case sensitive).

Returns:

  • (Hash)

    environment variables to be set for the process; the keys are strings, corresponding to the variables’ names (case sensitive).



22
23
24
# File 'lib/fudge/tasks/sub_process.rb', line 22

def environment
  @environment
end

#spawn_optionsHash

Returns attributes for the spawned process (see Ruby’s Process::spawn documentation for details).

Returns:

  • (Hash)

    attributes for the spawned process (see Ruby’s Process::spawn documentation for details)



27
28
29
# File 'lib/fudge/tasks/sub_process.rb', line 27

def spawn_options
  @spawn_options
end