Class: Build::ChainNode
- Inherits:
-
Graph::Node
- Object
- Graph::Node
- Build::ChainNode
- Defined in:
- lib/build/chain_node.rb
Overview
Responsible for processing a chain into a series of dependency nodes.
Instance Attribute Summary collapse
-
#arguments ⇒ Object
readonly
Returns the value of attribute arguments.
-
#chain ⇒ Object
readonly
Returns the value of attribute chain.
-
#environment ⇒ Object
readonly
Returns the value of attribute environment.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#apply!(task) ⇒ Object
This is the main entry point when invoking the node from ‘Build::Task`.
- #hash ⇒ Object
-
#initialize(chain, arguments, environment) ⇒ ChainNode
constructor
A new instance of ChainNode.
- #inspect ⇒ Object
- #name ⇒ Object
- #task_class(parent_task) ⇒ Object
Constructor Details
#initialize(chain, arguments, environment) ⇒ ChainNode
Returns a new instance of ChainNode.
33 34 35 36 37 38 39 40 |
# File 'lib/build/chain_node.rb', line 33 def initialize(chain, arguments, environment) @chain = chain @arguments = arguments @environment = environment # Wait here, for all dependent targets, to be done: super(Files::List::NONE, :inherit) end |
Instance Attribute Details
#arguments ⇒ Object (readonly)
Returns the value of attribute arguments.
43 44 45 |
# File 'lib/build/chain_node.rb', line 43 def arguments @arguments end |
#chain ⇒ Object (readonly)
Returns the value of attribute chain.
42 43 44 |
# File 'lib/build/chain_node.rb', line 42 def chain @chain end |
#environment ⇒ Object (readonly)
Returns the value of attribute environment.
44 45 46 |
# File 'lib/build/chain_node.rb', line 44 def environment @environment end |
Instance Method Details
#==(other) ⇒ Object
46 47 48 49 50 51 |
# File 'lib/build/chain_node.rb', line 46 def == other super and @chain == other.chain and @arguments == other.arguments and @environment == other.environment end |
#apply!(task) ⇒ Object
This is the main entry point when invoking the node from ‘Build::Task`.
66 67 68 69 70 71 72 73 |
# File 'lib/build/chain_node.rb', line 66 def apply!(task) # Go through all the dependencies in order and apply them to the build graph: @chain.dependencies.each do |dependency| task.invoke( DependencyNode.new(@chain, dependency, @environment, @arguments) ) end end |
#hash ⇒ Object
53 54 55 |
# File 'lib/build/chain_node.rb', line 53 def hash super ^ @chain.hash ^ @arguments.hash ^ @environment.hash end |
#inspect ⇒ Object
75 76 77 |
# File 'lib/build/chain_node.rb', line 75 def inspect "#<#{self.class} #{@environment.inspect}>" end |
#name ⇒ Object
61 62 63 |
# File 'lib/build/chain_node.rb', line 61 def name @environment.name end |
#task_class(parent_task) ⇒ Object
57 58 59 |
# File 'lib/build/chain_node.rb', line 57 def task_class(parent_task) Task end |