Class: Build::TargetNode

Inherits:
Graph::Node
  • Object
show all
Defined in:
lib/build/target_node.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(task_class, target, arguments) ⇒ TargetNode

Returns a new instance of TargetNode.



26
27
28
29
30
31
32
33
# File 'lib/build/target_node.rb', line 26

def initialize(task_class, target, arguments)
	@target = target
	@task_class = task_class
	@arguments = arguments
	
	# Wait here, for all dependent targets, to be done:
	super(Files::List::NONE, :inherit, target)
end

Instance Attribute Details

#task_classObject (readonly)

Returns the value of attribute task_class.



35
36
37
# File 'lib/build/target_node.rb', line 35

def task_class
  @task_class
end

Instance Method Details

#apply!(scope) ⇒ Object



41
42
43
# File 'lib/build/target_node.rb', line 41

def apply!(scope)
	scope.instance_exec(*@arguments, &@target.build)
end

#inspectObject



45
46
47
# File 'lib/build/target_node.rb', line 45

def inspect
	@task_class.name.inspect
end

#nameObject



37
38
39
# File 'lib/build/target_node.rb', line 37

def name
	@task_class.name
end

#to_sObject



49
50
51
# File 'lib/build/target_node.rb', line 49

def to_s
	"#<#{self.class} #{@target.name}>"
end