Skip to content

Instantly share code, notes, and snippets.

@stephanschubert
Created October 6, 2009 12:24
Show Gist options
  • Save stephanschubert/202963 to your computer and use it in GitHub Desktop.
Save stephanschubert/202963 to your computer and use it in GitHub Desktop.
class Rake::Task
def overwrite(&block)
abandon
enhance(&block)
end
def abandon
@actions.clear
prerequisites.clear
end
end
# Usage:
#
# 1) Undefine task "test"
# >> Rake::Task[:test].abandon
#
# 2) Overwrite task "test"
# >> Rake::task[:test].overwrite { ... }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment