ruby rake task params

30 Jul 2014

rake task 从命令行传递参数

task :my_task, [:arg1, :arg2] do |t, args|
  puts "#{args}"
end
rake my_task["hello","world"]

输出: {:arg1 => "hello",:arg2 => "world"}