P
Patrick Doyle
When I run the example given in the rake documentation under "Tasks
that expect parameters", namely:
task :name, [:first_name, :last_name] do |t, args|
args.with_defaults
first_name => "John", :last_name => "Dough")
puts "First name is #{args.first_name}"
puts "Last name is #{args.last_name}"
end
I get the following error:
$ rake -f foo.rb
(in C:/home/wpd/ruby/gdsii)
rake aborted!
undefined method `to_sym' for [:first_name, :last_name]:Array
C:/home/wpd/ruby/gdsii/foo.rb:1
(See full trace by running task with --trace)
Any clues where to start to track this down? I am running rake
version 0.8.1 on top of Ruby 1.8.6 (on an XP platform, if that
matters).
Also, as long as I'm in the neighborhood, the documentation on
rake.rubyforge.org states:
"Tasks that use parameters have a slightly different format for
prerequisites. Use the :needs keyword to specify the prerequisites for
tasks with arguments. For example: " ... but the example that follows
doesn't show the use of the ":needs" keyword".
(This hasn't been an issue for me yet, but I happened to notice that
as I read the docs and wondered about it at the time.)
--wpd
that expect parameters", namely:
task :name, [:first_name, :last_name] do |t, args|
args.with_defaults
puts "First name is #{args.first_name}"
puts "Last name is #{args.last_name}"
end
I get the following error:
$ rake -f foo.rb
(in C:/home/wpd/ruby/gdsii)
rake aborted!
undefined method `to_sym' for [:first_name, :last_name]:Array
C:/home/wpd/ruby/gdsii/foo.rb:1
(See full trace by running task with --trace)
Any clues where to start to track this down? I am running rake
version 0.8.1 on top of Ruby 1.8.6 (on an XP platform, if that
matters).
Also, as long as I'm in the neighborhood, the documentation on
rake.rubyforge.org states:
"Tasks that use parameters have a slightly different format for
prerequisites. Use the :needs keyword to specify the prerequisites for
tasks with arguments. For example: " ... but the example that follows
doesn't show the use of the ":needs" keyword".
(This hasn't been an issue for me yet, but I happened to notice that
as I read the docs and wondered about it at the time.)
--wpd