How to use this with namespaces?
I tried:
namespace :db do before :migrate do puts "before db:migrate" end end
but that triggers errors about calling full_comment on nil.
I also tried
before "db:migrate"
and
before "db:migrate".to_sym
No luck with those either.
I found an alternative approach just using the built-in capacities of rake documented here: http://whynotwiki.com/Rake#Can_I_.22append.22_to_.2F_add_a_postrequisite_to_a_task.3F
But I like the rake-hooks syntax and would gladly use it if I could get it to work with namespaced tasks.
Can you please attach a patch for solving this?
It does work with namespaces ... like this:
namespace :greetings do
task :hola do puts "Hola!" end ;
task :bonjour do puts "Bonjour!" end ;
task :gday do puts "G'day!" end ;
end
before "greetings:hola", "greetings:bonjour", "greetings:gday" do
puts "Hello!"
end
rake greetings:hola # => "Hello! Hola!"
I've also written a couple of tests to demonstrate that it works with namespaces. Let me know if you want them.
p.s. the "before" call has to come after the namespace and outside of it.