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.
-
#dependency ⇒ Object
readonly
Returns the value of attribute dependency.
-
#environment ⇒ Object
readonly
Returns the value of attribute environment.
-
#provisions ⇒ Object
readonly
Returns the value of attribute provisions.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #apply!(task) ⇒ Object
- #hash ⇒ Object
- #initial_environment ⇒ Object
-
#initialize(environment, dependency, provisions, arguments) ⇒ BuildNode
constructor
A new instance of BuildNode.
- #name ⇒ Object
- #task_class(parent_task) ⇒ Object
Constructor Details
#initialize(environment, dependency, provisions, arguments) ⇒ BuildNode
Returns a new instance of BuildNode.
28 29 30 31 32 33 34 35 |
# File 'lib/build/build_node.rb', line 28 def initialize(environment, dependency, provisions, arguments) @environment = environment @dependency = dependency @provisions = provisions @arguments = arguments super(Files::List::NONE, :inherit) end |
Instance Attribute Details
#arguments ⇒ Object (readonly)
Returns the value of attribute arguments.
40 41 42 |
# File 'lib/build/build_node.rb', line 40 def arguments @arguments end |
#dependency ⇒ Object (readonly)
Returns the value of attribute dependency.
38 39 40 |
# File 'lib/build/build_node.rb', line 38 def dependency @dependency end |
#environment ⇒ Object (readonly)
Returns the value of attribute environment.
37 38 39 |
# File 'lib/build/build_node.rb', line 37 def environment @environment end |
#provisions ⇒ Object (readonly)
Returns the value of attribute provisions.
39 40 41 |
# File 'lib/build/build_node.rb', line 39 def provisions @provisions end |
Instance Method Details
#==(other) ⇒ Object
42 43 44 45 46 47 48 |
# File 'lib/build/build_node.rb', line 42 def == other super and @environment == other.environment and @dependency == other.dependency and @provisions == other.provisions and @arguments == other.arguments end |
#apply!(task) ⇒ Object
66 67 68 69 70 71 72 73 74 |
# File 'lib/build/build_node.rb', line 66 def apply!(task) output_environment = self.initial_environment @provisions.each do |provision| output_environment.construct!(task, *@arguments, &provision.value) end task.output_environment = output_environment end |
#hash ⇒ Object
50 51 52 |
# File 'lib/build/build_node.rb', line 50 def hash super ^ @environment.hash ^ @dependency.hash ^ @provisions.hash ^ @arguments.hash end |
#initial_environment ⇒ Object
58 59 60 |
# File 'lib/build/build_node.rb', line 58 def initial_environment Build::Environment.new(@environment, name: @dependency.name) end |
#name ⇒ Object
62 63 64 |
# File 'lib/build/build_node.rb', line 62 def name @dependency.name end |