Class: Rscons::ThreadedCommand

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Constructor Details

#initialize(command, options = {}) ⇒ ThreadedCommand

Create a ThreadedCommand object.

Options Hash (options):

  • :builder_info (Object)

    Arbitrary object to store builder-specific info. This object value will be passed back into the builder's #finalize method.

  • :short_description (String)

    Short description of the command. This will be printed to standard output if the Environment's echo mode is :short.

  • :system_env (Hash)

    Environment Hash to pass to Kernel#system.

  • :system_options (Hash)

    Options Hash to pass to Kernel#system.


54
55
56
57
58
59
60
# File 'lib/rscons/threaded_command.rb', line 54

def initialize(command, options = {})
  @command = command
  @builder_info = options[:builder_info]
  @short_description = options[:short_description]
  @system_env = options[:system_env]
  @system_options = options[:system_options]
end

Instance Attribute Details

#build_operationHash


32
33
34
# File 'lib/rscons/threaded_command.rb', line 32

def build_operation
  @build_operation
end

#builder_infoObject (readonly)


14
15
16
# File 'lib/rscons/threaded_command.rb', line 14

def builder_info
  @builder_info
end

#commandArray<String> (readonly)


9
10
11
# File 'lib/rscons/threaded_command.rb', line 9

def command
  @command
end

#short_descriptionString (readonly)


19
20
21
# File 'lib/rscons/threaded_command.rb', line 19

def short_description
  @short_description
end

#system_envHash (readonly)


23
24
25
# File 'lib/rscons/threaded_command.rb', line 23

def system_env
  @system_env
end

#system_optionsHash (readonly)


27
28
29
# File 'lib/rscons/threaded_command.rb', line 27

def system_options
  @system_options
end

#threadThread


36
37
38
# File 'lib/rscons/threaded_command.rb', line 36

def thread
  @thread
end