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.
18 19 20 21 22 23 24 25 |
# File 'lib/build/chain_node.rb', line 18 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.
28 29 30 |
# File 'lib/build/chain_node.rb', line 28 def arguments @arguments end |
#chain ⇒ Object (readonly)
Returns the value of attribute chain.
27 28 29 |
# File 'lib/build/chain_node.rb', line 27 def chain @chain end |
#environment ⇒ Object (readonly)
Returns the value of attribute environment.
29 30 31 |
# File 'lib/build/chain_node.rb', line 29 def environment @environment end |
Instance Method Details
#==(other) ⇒ Object
32 33 34 35 36 37 |
# File 'lib/build/chain_node.rb', line 32 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.
55 56 57 58 59 60 61 62 |
# File 'lib/build/chain_node.rb', line 55 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
40 41 42 |
# File 'lib/build/chain_node.rb', line 40 def hash super ^ @chain.hash ^ @arguments.hash ^ @environment.hash end |
#inspect ⇒ Object
65 66 67 |
# File 'lib/build/chain_node.rb', line 65 def inspect "#<#{self.class} #{@environment.inspect}>" end |
#name ⇒ Object
50 51 52 |
# File 'lib/build/chain_node.rb', line 50 def name @environment.name end |
#task_class(parent_task) ⇒ Object
45 46 47 |
# File 'lib/build/chain_node.rb', line 45 def task_class(parent_task) Task end |