Class: C::TargetTag

Inherits:
R::Target show all
Defined in:
lib/rub/c.rb

Overview

Tag Target

This is the target used for tags.

Direct Known Subclasses

L::Util::TargetUninstall, R::TargetHelp

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from R::Target

#clean?, #hash_input, #hash_output, #hash_outputs, #hash_self, #register

Constructor Details

#initialize(t) ⇒ TargetTag

Create a TargetTag

Parameters:

  • t (Symbol)

    the name of the tag.



116
117
118
119
120
121
122
# File 'lib/rub/c.rb', line 116

def initialize(t)
	t.is_a? Symbol or raise 'Targets can be created with symbols only.'

	@tag = t
	@output = Set[t]
	@input  = Set[]
end

Instance Attribute Details

#descriptionObject

Returns the value of attribute description.



111
112
113
# File 'lib/rub/c.rb', line 111

def description
  @description
end

#inputObject (readonly)

Returns the value of attribute input.



108
109
110
# File 'lib/rub/c.rb', line 108

def input
  @input
end

#outputObject (readonly)

Returns the value of attribute output.



108
109
110
# File 'lib/rub/c.rb', line 108

def output
  @output
end

#tagObject (readonly)

Returns the value of attribute tag.



109
110
111
# File 'lib/rub/c.rb', line 109

def tag
  @tag
end

Instance Method Details

#buildObject



134
135
136
# File 'lib/rub/c.rb', line 134

def build
	input.each{|i| R::get_target(i).build }
end

#require(f) ⇒ Object

Add a target to this tag.

Parameters:

  • f (Pathname, String)

    The path of the target.



127
128
129
130
131
132
# File 'lib/rub/c.rb', line 127

def require(f)
	f = R::Tool.make_set f
	f.map!{|e| C.path(e)}
	
	input.merge(f)
end