Class: Rscons::ThreadedCommand
- Inherits:
-
Object
- Object
- Rscons::ThreadedCommand
- Defined in:
- lib/rscons/threaded_command.rb
Overview
If a builder returns an instance of this class from its #run method, then Rscons will execute the command specified in a thread and allow other builders to continue executing in parallel.
Instance Attribute Summary collapse
-
#build_operation ⇒ Hash
Field for Rscons to store the build operation while this threaded command is executing.
-
#builder_info ⇒ Object
readonly
Arbitrary object to store builder-specific info.
-
#command ⇒ Array<String>
readonly
The command to execute.
-
#short_description ⇒ String
readonly
Short description of the command.
-
#system_env ⇒ Hash
readonly
Environment Hash to pass to Kernel#system.
-
#system_options ⇒ Hash
readonly
Options Hash to pass to Kernel#system.
-
#thread ⇒ Thread
The thread waiting on this command to terminate.
Instance Method Summary collapse
-
#initialize(command, options = {}) ⇒ ThreadedCommand
constructor
Create a ThreadedCommand object.
Constructor Details
#initialize(command, options = {}) ⇒ ThreadedCommand
Create a ThreadedCommand object.
54 55 56 57 58 59 60 |
# File 'lib/rscons/threaded_command.rb', line 54 def initialize(command, = {}) @command = command @builder_info = [:builder_info] @short_description = [:short_description] @system_env = [:system_env] @system_options = [:system_options] end |
Instance Attribute Details
#build_operation ⇒ Hash
Returns Field for Rscons to store the build operation while this threaded command is executing.
32 33 34 |
# File 'lib/rscons/threaded_command.rb', line 32 def build_operation @build_operation end |
#builder_info ⇒ Object (readonly)
Returns Arbitrary object to store builder-specific info. This object value will be passed back into the builder’s #finalize method.
14 15 16 |
# File 'lib/rscons/threaded_command.rb', line 14 def builder_info @builder_info end |
#command ⇒ Array<String> (readonly)
Returns The command to execute.
9 10 11 |
# File 'lib/rscons/threaded_command.rb', line 9 def command @command end |
#short_description ⇒ String (readonly)
Returns Short description of the command. This will be printed to standard output if the Environment’s echo mode is :short.
19 20 21 |
# File 'lib/rscons/threaded_command.rb', line 19 def short_description @short_description end |
#system_env ⇒ Hash (readonly)
Returns Environment Hash to pass to Kernel#system.
23 24 25 |
# File 'lib/rscons/threaded_command.rb', line 23 def system_env @system_env end |
#system_options ⇒ Hash (readonly)
Returns Options Hash to pass to Kernel#system.
27 28 29 |
# File 'lib/rscons/threaded_command.rb', line 27 def @system_options end |
#thread ⇒ Thread
Returns The thread waiting on this command to terminate.
36 37 38 |
# File 'lib/rscons/threaded_command.rb', line 36 def thread @thread end |