Reputation: 922
My rake task (rake v 0.9.2.2) includes a bit to print out the name of the task. I'd like it to also print its namespace. Kind of like the following:
namespace :yelp do
desc "..."
task :scrape => :environment do
puts "rake #{task.namespace}:#{task.name}"
end
end
The problem is that namespace
is a private method.
rake aborted!
private method `namespace' called for <Rake::Task => []>:Rake::Task
Anyone have a solution?
Upvotes: 2
Views: 769
Reputation: 922
task.name
includes the namespace. Use this tip to get task.name
to print under rake 0.9.2.2.
Upvotes: 2