Created
October 26, 2011 11:48
-
-
Save kschiess/1316118 to your computer and use it in GitHub Desktop.
How to prevent rake from polluting global namespace
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Module | |
def with_rake_pollution_prevention_append_features(klass) | |
unless caller.first.match(/rake/) && self.name == "Rake::DeprecatedObjectDSL" | |
without_rake_pollution_prevention_append_features(klass) | |
end | |
end | |
alias without_rake_pollution_prevention_append_features append_features | |
alias append_features with_rake_pollution_prevention_append_features | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment