Hello Eveybody,
I found that having the same parameter name for two task, when calling
one it automatically overwrite the others value.
task :bar, [:version] do |t, args|
version = args.version || 'unstable'
puts "Bar version #{version}"
end
task :foo, [:version] => [:bar] do |t, args|
version = args.version || 'stable'
puts "Foo version #{version}"
end
Calling 'foo' without parameters:
[EMAIL PROTECTED] (D:\Users\Luis\Desktop)
$ rake foo
(in D:/Users/Luis/Desktop)
Bar version unstable
Foo version stable
But calling 'foo' with '1.8', overwrites also bar task
[EMAIL PROTECTED] (D:\Users\Luis\Desktop)
$ rake foo[1.8]
(in D:/Users/Luis/Desktop)
Bar version 1.8
Foo version 1.8
I've tried the code above and also usage of with_defaults to setup the
arguments options, both with same results.
Should this be considered a bug? At first sight the TaskArguments
should be per-task and not global available to all the tasks.
--
Luis Lavena
AREA 17
-
Human beings, who are almost unique in having the ability to learn from
the experience of others, are also remarkable for their apparent
disinclination to do so.
Douglas Adams
_______________________________________________
Rake-devel mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/rake-devel