guillermo / rake-hooks

Rake hooks let you add callbacks to rake tasks.
MIT License
70 stars 21 forks source link

deprecation warnings w/rake 0.9.2.2 #8

Open mattscilipoti opened 12 years ago

mattscilipoti commented 12 years ago
WARNING: Global access to Rake DSL methods is deprecated.  Please include
    ...  Rake::DSL into classes and modules which use the Rake DSL methods.
WARNING: DSL method Module#desc called at /Users/matt/.rvm/gems/ruby-1.9.3-p0/gems/rake-hooks-1.2.3/lib/rake/hooks.rb:16:in `block in after'
WARNING: DSL method Module#task called at /Users/matt/.rvm/gems/ruby-1.9.3-p0/gems/rake-hooks-1.2.3/lib/rake/hooks.rb:17:in `block in after'
WARNING: DSL method Module#desc called at /Users/matt/.rvm/gems/ruby-1.9.3-p0/gems/rake-hooks-1.2.3/lib/rake/hooks.rb:16:in `block in after'
WARNING: DSL method Module#task called at /Users/matt/.rvm/gems/ruby-1.9.3-p0/gems/rake-hooks-1.2.3/lib/rake/hooks.rb:17:in `block in after'
mattscilipoti commented 12 years ago

A quick look identifies that this is cyclical. Rake wants you to include their DSL, but you include this module in Rake::DSL.

mattscilipoti commented 12 years ago

Clarification:

This only happens if you call:

Rake::Hooks.after 'db:migrate' do

Instead of using:

include Rake::Hooks
after 'db:migrate' do
guillermo commented 12 years ago

Can you generate a test case?