J
Jim Menard
I think I've found a minor bug in Rake with the "desc" method and -T flag.
task :default => [ne]
task ne do
puts 'one'
end
desc "description of task one"
task ne => [:anything]
desc "description of task two"
task :two do
puts 'two'
end
% rake -T
(in c:/jmenard)
rake two # description of task two
This only happens if "task ne" appears more than once and the description
comes after the first "task ne". For example, reversing the tasks but
keeping the desc after the second one does the same thing:
task :default => [ne]
task ne do
puts 'one'
end
desc "description of task one"
task ne => [:anything]
desc "description of task two"
task :two do
puts 'two'
end
% rake -T
(in c:/jmenard)
rake two # description of task two
If I move the desc up before the first "task ne" then both descriptions get
printed:
task :default => [ne]
desc "description of task one"
task ne => [:anything]
task ne do
puts 'one'
end
desc "description of task two"
task :two do
puts 'two'
end
~> rake -T
(in c:/jmenard)
rake one # description of task one
rake two # description of task two
Looking at rake.rb, I think the problem is that $last_comment is only used
when a new task is created, not when an existing one is extended (re-opened?
added to?). I don't know if using $last_comment inside Task.define_task
instead of in the initialize method makes sense or if that would break
something else.
Jim
task :default => [ne]
task ne do
puts 'one'
end
desc "description of task one"
task ne => [:anything]
desc "description of task two"
task :two do
puts 'two'
end
% rake -T
(in c:/jmenard)
rake two # description of task two
This only happens if "task ne" appears more than once and the description
comes after the first "task ne". For example, reversing the tasks but
keeping the desc after the second one does the same thing:
task :default => [ne]
task ne do
puts 'one'
end
desc "description of task one"
task ne => [:anything]
desc "description of task two"
task :two do
puts 'two'
end
% rake -T
(in c:/jmenard)
rake two # description of task two
If I move the desc up before the first "task ne" then both descriptions get
printed:
task :default => [ne]
desc "description of task one"
task ne => [:anything]
task ne do
puts 'one'
end
desc "description of task two"
task :two do
puts 'two'
end
~> rake -T
(in c:/jmenard)
rake one # description of task one
rake two # description of task two
Looking at rake.rb, I think the problem is that $last_comment is only used
when a new task is created, not when an existing one is extended (re-opened?
added to?). I don't know if using $last_comment inside Task.define_task
instead of in the initialize method makes sense or if that would break
something else.
Jim