lib/rant/import/nodes/default.rb in rant-0.4.8 vs lib/rant/import/nodes/default.rb in rant-0.5.0
- old
+ new
@@ -41,15 +41,10 @@
@name = name or raise ArgumentError, "name not given"
@pre = prerequisites || []
@pre_resolved = false
@block = block
@run = false
- # success has one of three values:
- # nil no invoke
- # false invoked, but fail
- # true invoked and run successfully
- @success = nil
@receiver = nil
end
# Get a list of the *names* of all prerequisites. The
# underlying list of prerequisites can't be modified by the
@@ -85,15 +80,10 @@
# True if last task run fail.
def fail?
@success == false
end
- # Task was run and didn't fail.
- def done?
- @success
- end
-
# Enhance this task with the given dependencies and blk.
def enhance(deps = nil, &blk)
if deps
@pre_resolved = false
@pre.concat deps
@@ -109,14 +99,10 @@
else
@block = blk
end
end
- def needed?
- invoke(:needed? => true)
- end
-
# Returns a true value if task was acutally run.
# Raises Rant::TaskFail to signal task (or prerequiste) failure.
def invoke(opt = INVOKE_OPT)
return circular_dep if @run
@run = true
@@ -317,15 +303,10 @@
def file_target?
true
end
- def needed?
- return false if done?
- invoke(:needed? => true)
- end
-
def invoke(opt = INVOKE_OPT)
return circular_dep if @run
@run = true
begin
return if done?
@@ -382,11 +363,11 @@
module AutoInvokeDirNode
private
def run
goto_task_home
- @rac.running_task(self)
+ return if @rac.running_task(self)
dir = File.dirname(name)
@rac.build dir unless dir == "." || dir == "/"
return unless @block
@block.arity == 0 ? @block.call : @block[self]
end
@@ -455,11 +436,11 @@
end
[dep, @block && File.mtime(dep) > @ts]
end
def run
- @rac.running_task(self)
+ return if @rac.running_task(self)
@rac.sys.mkdir @name unless @isdir
if @block
@block.arity == 0 ? @block.call : @block[self]
goto_task_home
@rac.sys.touch @name
@@ -535,13 +516,11 @@
}
end
}
@ts
end
- def needed?
- false
- end
def invoke(opt = INVOKE_OPT)
+ # self.timestamp would be required for correctness...
false
end
def related_sources
@pre
end