Don’t Step on a Rake, Use Rake::DSL

A murb'ed feed, posted more than 4 years ago filed in rake, ruby, rails, dsl & tasks. informs us (ruby-developers ;)) about what happens when we simply define a method within a rake file:

That’s correct: every instance of almost every class, including the classes and modules themselves, now get the methods defined in your .rake file. Polluting almost every object in your system with unnecessary methods is a bad practice and could have a variety of consequences.

But he follows up:

Fortunately for us, Rake actually provides a built-in facility for changing the scope of our tasks! It lives in the Rake::DSL module. From the docs:

DSL is a module that provides task, desc, namespace, etc. Use this when you’d like to use rake outside the top level scope.

Go to the original link.