Class: R::TargetSource

Inherits:
Target show all
Defined in:
lib/rub/r/target.rb

Overview

A target for existing sources.

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#outputObject (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

#buildObject



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