module Coals::TaskTree

Public Instance Methods

build_tasks() click to toggle source

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`

# File lib/coals/task_tree.rb, line 23
def build_tasks
  load_rakefile
  Rake.application.tasks.reject { |t| t.comment.nil? }
end
load_rakefile() click to toggle source
# File lib/coals/task_tree.rb, line 28
def load_rakefile
  Rake::TaskManager.record_task_metadata = true
  load 'Rakefile'
end
task_tree() click to toggle source
# 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