Class: R::TargetSource
Overview
A target for existing sources.
Instance Attribute Summary collapse
-
#output ⇒ Object
readonly
Returns the value of attribute output.
Instance Method Summary collapse
- #build ⇒ Object
- #hash_output(f) ⇒ Object
-
#initialize(p) ⇒ TargetSource
constructor
A new instance of TargetSource.
Methods inherited from Target
#clean?, #description, #hash_input, #hash_outputs, #hash_self, #input, #register
Constructor Details
#initialize(p) ⇒ TargetSource
Returns a new instance of TargetSource.
233 234 235 236 |
# File 'lib/rub/r/target.rb', line 233 def initialize(p) @src = p @output = Set[p] end |
Instance Attribute Details
#output ⇒ Object (readonly)
Returns the value of attribute output.
231 232 233 |
# File 'lib/rub/r/target.rb', line 231 def output @output end |
Instance Method Details
#build ⇒ Object
242 243 244 245 246 247 248 |
# File 'lib/rub/r/target.rb', line 242 def build if not @src.exist? #p self $stderr.puts "Error: source file #{@src} does not exist!" Sysexits.exit :noinput end end |
#hash_output(f) ⇒ Object
238 239 240 |
# File 'lib/rub/r/target.rb', line 238 def hash_output(f) @hashcache ||= Digest::SHA1.file(f).to_s end |