Module: RakeTaskCleanup

Included in:
Object
Defined in:
lib/drumherum/rake.rb

Overview

Do you want to clean up the messy rake task list? Use hide_tasks to hide unused rake tasks from rake -T.

You hide tasks by clearing their descriptions. After this they still exist, but they are not listed anymore. Usage:

hide_tasks [ :announce, :audit, :check_extra_deps, :clobber_docs, :clobber_package, :default ]

If you want to override a task, you first have to delete it. Use remove_task for it. Usage:

remove_task 'test:plugins'

Instance Method Summary collapse

Instance Method Details

#hide_tasks(task_list) ⇒ Object

Do you want to clean up the messy rake task list? Use hide_tasks to hide unused rake tasks from rake -T.

You hide tasks by clearing their descriptions. After this they still exist, but they are not listed anymore. Usage:

hide_tasks [ :announce, :audit, :check_extra_deps, :clobber_docs, :clobber_package, :default ]


54
55
56
57
58
59
# File 'lib/drumherum/rake.rb', line 54

def hide_tasks(task_list)
  task_list.each do | task_name |
    t = Rake.application.lookup(task_name)
    t.hide! unless t.nil?
  end
end

#remove_task(task_name) ⇒ Object

If you want to override a task, you first have to delete it. Use remove_task for it. Usage:

remove_task 'test:plugins'


42
43
44
# File 'lib/drumherum/rake.rb', line 42

def remove_task(task_name)
  Rake.application.remove_task(task_name)
end