Module: Coals::TaskTree
- Included in:
- RakeRunner
- Defined in:
- lib/coals/task_tree.rb
Instance Method Summary collapse
-
#build_tasks ⇒ Object
Coals assumes that any task lacking a description is not meant to be called directly, i.e.
- #load_rakefile ⇒ Object
- #task_tree ⇒ Object
Instance Method Details
#build_tasks ⇒ Object
Coals assumes that any task lacking a description is not meant to be called directly, i.e. a ‘subtask’ This is in line with the list rendered by ‘rake -T`
23 24 25 26 |
# File 'lib/coals/task_tree.rb', line 23 def build_tasks load_rakefile Rake.application.tasks.reject { |t| t.comment.nil? } end |
#load_rakefile ⇒ Object
28 29 30 31 |
# File 'lib/coals/task_tree.rb', line 28 def load_rakefile Rake::TaskManager. = true load 'Rakefile' end |
#task_tree ⇒ Object
14 15 16 17 18 |
# File 'lib/coals/task_tree.rb', line 14 def task_tree @_task_tree ||= build_tasks.each_with_object(Hash.new { |h, k| h[k] = [] }) do |task, tree| tree[task.namespace] << task end end |