When I saw commit 995b742d "fixed namespace task list bug" I was
reminded of the problem I had in Drake where Task#prerequisites gave
namespace-unqualified task names
(http://rubyforge.org/pipermail/rake-devel/2008-September/000574.html).
namespace :a do
task :x
task :y => :x
end
task :default do
p Rake::Task["a:y"].prerequisites #=> ["x"]
# should be ["a:x"] ?
end
Does this work as designed? I had initially conjectured that you
wanted a task manager to have context-dependent behavior (where the
"x" prereq can mean something different depending on the current
namespace), but it doesn't look like Rake is designed this way.
The other issue was that File#needed? does not look past its immediate prereqs.
file "parent" do
touch "parent"
end
file "child" => "parent" do
touch "child"
end
file "grandchild" => "child" do
touch "grandchild"
end
task :is_grandchild_needed do
p Rake::Task["grandchild"].needed?
end
% rake grandchild
(in /Users/jlawrence/test)
touch parent
touch child
touch grandchild
% touch parent
% rake is_grandchild_needed
(in /Users/jlawrence/test)
false
I hesitate to file bugs because Task#prerequisites and Task#needed?
may be intended for internal use only.
James M. Lawrence
_______________________________________________
Rake-devel mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/rake-devel