Class: R::TargetSmart
Overview
Target with additional functionality.
Direct Known Subclasses
L::C::TargetGeneratedHeader, L::Template::TargetRenderer, TargetGenerator
Instance Attribute Summary collapse
-
#input ⇒ Object
readonly
Returns the value of attribute input.
-
#output ⇒ Object
readonly
Returns the value of attribute output.
Instance Method Summary collapse
- #build ⇒ Object
-
#clean ⇒ void
Mark target as clean.
-
#clean? ⇒ true, false
Is this target clean?.
-
#initialize ⇒ TargetSmart
constructor
A new instance of TargetSmart.
Methods inherited from Target
#description, #hash_input, #hash_output, #hash_outputs, #hash_self, #register
Constructor Details
#initialize ⇒ TargetSmart
Returns a new instance of TargetSmart.
192 193 194 195 |
# File 'lib/rub/r/target.rb', line 192 def initialize @input = Set.new @output = Set.new end |
Instance Attribute Details
#input ⇒ Object (readonly)
Returns the value of attribute input.
190 191 192 |
# File 'lib/rub/r/target.rb', line 190 def input @input end |
#output ⇒ Object (readonly)
Returns the value of attribute output.
190 191 192 |
# File 'lib/rub/r/target.rb', line 190 def output @output end |
Instance Method Details
#build ⇒ Object
218 219 220 221 222 223 224 225 226 |
# File 'lib/rub/r/target.rb', line 218 def build build_dependancies clean? and return build_self clean end |
#clean ⇒ void
This method returns an undefined value.
Mark target as clean.
200 201 202 203 204 |
# File 'lib/rub/r/target.rb', line 200 def clean output.all?{|f| !f.is_a?(Symbol) and f.exist?} or return R::ppersistant["Rub.TargetSmart.#{@output.sort.join('\0')}"] = hash_self end |
#clean? ⇒ true, false
Is this target clean?
209 210 211 212 213 214 215 216 |
# File 'lib/rub/r/target.rb', line 209 def clean? output.each do |f| f.is_a?(Symbol) and return false # Tags are never clean. f.exist? or return false # Output missing, rebuild. end R::ppersistant["Rub.TargetSmart.#{@output.sort.join('\0')}"] == hash_self end |