Rake tasks Flashcards

1
Q

How to create rake task with params? And run?

A
namespace :sample do
  task :import, [:filename, :another] do |_t, args|
    # ...
    p args[:filename] # hello
    p args[:another] # world
  end
end
# without quates and spaces
rake sample:import[hello,world]
How well did you know this?
1
Not at all
2
3
4
5
Perfectly