Class: Build::BuildNode
- Inherits:
-
Graph::Node
- Object
- Graph::Node
- Build::BuildNode
- Defined in:
- lib/build/build_node.rb
Instance Attribute Summary collapse
-
#arguments ⇒ Object
readonly
Returns the value of attribute arguments.
-
#environment ⇒ Object
readonly
Returns the value of attribute environment.
-
#provision ⇒ Object
readonly
Returns the value of attribute provision.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #apply!(task) ⇒ Object
- #hash ⇒ Object
- #initial_environment ⇒ Object
-
#initialize(environment, provision, arguments) ⇒ BuildNode
constructor
A new instance of BuildNode.
- #name ⇒ Object
- #task_class(parent_task) ⇒ Object
Constructor Details
#initialize(environment, provision, arguments) ⇒ BuildNode
Returns a new instance of BuildNode.
28 29 30 31 32 33 34 |
# File 'lib/build/build_node.rb', line 28 def initialize(environment, provision, arguments) @environment = environment @provision = provision @arguments = arguments super(Files::List::NONE, :inherit) end |
Instance Attribute Details
#arguments ⇒ Object (readonly)
Returns the value of attribute arguments.
38 39 40 |
# File 'lib/build/build_node.rb', line 38 def arguments @arguments end |
#environment ⇒ Object (readonly)
Returns the value of attribute environment.
36 37 38 |
# File 'lib/build/build_node.rb', line 36 def environment @environment end |
#provision ⇒ Object (readonly)
Returns the value of attribute provision.
37 38 39 |
# File 'lib/build/build_node.rb', line 37 def provision @provision end |
Instance Method Details
#==(other) ⇒ Object
40 41 42 43 44 45 |
# File 'lib/build/build_node.rb', line 40 def == other super and @environment == other.environment and @provision == other.provision and @arguments == other.arguments end |
#apply!(task) ⇒ Object
63 64 65 66 67 68 69 |
# File 'lib/build/build_node.rb', line 63 def apply!(task) output_environment = self.initial_environment output_environment.construct!(task, *@arguments, &@provision.value) task.output_environment = output_environment end |
#hash ⇒ Object
47 48 49 |
# File 'lib/build/build_node.rb', line 47 def hash super ^ @environment.hash ^ @provision.hash ^ @arguments.hash end |
#initial_environment ⇒ Object
55 56 57 |
# File 'lib/build/build_node.rb', line 55 def initial_environment Build::Environment.new(@environment) end |
#name ⇒ Object
59 60 61 |
# File 'lib/build/build_node.rb', line 59 def name @environment.name end |