add ThreadedCommand class
This commit is contained in:
parent
ef4f9882cd
commit
6b8fda706d
@ -3,6 +3,7 @@ require_relative "rscons/builder"
|
||||
require_relative "rscons/cache"
|
||||
require_relative "rscons/environment"
|
||||
require_relative "rscons/job_set"
|
||||
require_relative "rscons/threaded_command"
|
||||
require_relative "rscons/varset"
|
||||
require_relative "rscons/version"
|
||||
|
||||
|
31
lib/rscons/threaded_command.rb
Normal file
31
lib/rscons/threaded_command.rb
Normal file
@ -0,0 +1,31 @@
|
||||
module Rscons
|
||||
# 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.
|
||||
class ThreadedCommand
|
||||
|
||||
# @return [Array<String>]
|
||||
# The command to execute.
|
||||
attr_reader :command
|
||||
|
||||
# @return [Object]
|
||||
# Arbitrary object to store builder-specific info. This object value will
|
||||
# be passed back into the builder's #finalize method.
|
||||
attr_reader :builder_info
|
||||
|
||||
# Create a ThreadedCommand object.
|
||||
#
|
||||
# @param command [Array<String>]
|
||||
# The command to execute.
|
||||
# @param options [Hash]
|
||||
# Optional parameters.
|
||||
# @option options [Object] :builder_info
|
||||
# Arbitrary object to store builder-specific info. This object value will
|
||||
# be passed back into the builder's #finalize method.
|
||||
def initialize(command, options = {})
|
||||
@command = command
|
||||
@builder_info = options[:builder_info]
|
||||
end
|
||||
|
||||
end
|
||||
end
|
Loading…
x
Reference in New Issue
Block a user