Skip to content

Instantly share code, notes, and snippets.

@mschuerig
Created June 8, 2012 06:50
Show Gist options
  • Save mschuerig/2894059 to your computer and use it in GitHub Desktop.
Save mschuerig/2894059 to your computer and use it in GitHub Desktop.
Forget a Rake task
class Rake::Task
# Forget an already defined task.
#
# Rake tasks with the same name are cumulative,
# a new definition adds to an already existing one,
# it does not override it.
# In order to completely redefine a task, this
# method makes rake forget the previous definition(s).
#
def forget
prerequisites.clear
@actions.clear
@comment = nil
@full_comment = nil
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment