Created
May 26, 2010 13:43
-
-
Save metaskills/414494 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# Place this in your rails lib directory and require in your Rakefile. | |
Rake::TaskManager.class_eval do | |
def alias_task(fq_name) | |
new_name = "#{fq_name}:original" | |
@tasks[new_name] = @tasks.delete(fq_name) | |
end | |
end | |
def alias_task(fq_name) | |
Rake.application.alias_task(fq_name) | |
end | |
def alias_task_chain(*args, &block) | |
name, params, deps = Rake.application.resolve_args(args.dup) | |
fq_name = Rake.application.instance_variable_get(:@scope).dup.push(name).join(':') | |
alias_task(fq_name) | |
Rake::Task.define_task(*args, &block) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment