Skip to content

Instantly share code, notes, and snippets.

@AlexWayfer
Forked from raggi/alias_task.rake
Created June 23, 2016 13:22
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AlexWayfer/d57f6fa0d69a8e352197ab83a82cff98 to your computer and use it in GitHub Desktop.
Save AlexWayfer/d57f6fa0d69a8e352197ab83a82cff98 to your computer and use it in GitHub Desktop.
A helper to alias a task in rake
def alias_task(name, old_name)
t = Rake::Task[old_name]
desc t.full_comment if t.full_comment
task name, *t.arg_names do |_, args|
# values_at is broken on Rake::TaskArguments
args = t.arg_names.map { |a| args[a] }
t.invoke(*args)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment