module Rake

def self.all_tasks

Simple shortcut for Rake.application.all_tasks
#
def self.all_tasks
  Rake.application.all_tasks
end

def self.clear_tasks(*tasks)

of extend it.
regexp. Use this if you want to completely override a task instead
Hooks into rake and allows us to clear out a task by name or
#
def self.clear_tasks(*tasks)
  tasks.flatten.each do |name|
    case name
    when Regexp then
      all_tasks.delete_if { |k, _| k =~ name }
    else
      all_tasks.delete(name)
    end
  end
end

def self.undo(*names)

Rake.undo("test") # rolls out rails' test task
require 'tasks/rails'
require 'hoe'

actions.
libraries define the same task and you only want one of the
Removes the last action added to a task. Use this when two
#
def self.undo(*names)
  names.each do |name|
    all_tasks[name].actions.delete_at(-1)
  end
end