class R::TargetSmart

Target with additional functionality.

Attributes

input[R]
output[R]

Public Class Methods

new() click to toggle source
# File lib/rub/r/target.rb, line 192
def initialize
        @input  = Set.new
        @output = Set.new
end

Public Instance Methods

build() click to toggle source
# File lib/rub/r/target.rb, line 218
def build
        build_dependancies
        
        clean? and return
        
        build_self
        
        clean
end
clean() click to toggle source

Mark target as clean.

@return [void]

# 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?() click to toggle source

Is this target clean?

@return [true,false] True if this target is up-to-date.

# 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