module MiGA::Project::Result

Helper module including specific functions to add project results.

Public Instance Methods

ignore_task?(task) click to toggle source

Is this task to be bypassed?

# File lib/miga/project/result.rb, line 28
def ignore_task?(task)
  metadata["run_#{task}"] == false ||
    (!is_clade? && @@INCLADE_TASKS.include?(task) &&
      metadata["run_#{task}"] != true)
end
next_distances(save = true) click to toggle source

Get the next distances task, saving intermediate results if save. Returns a Symbol.

# File lib/miga/project/result.rb, line 37
def next_distances(save = true)
  next_task(@@DISTANCE_TASKS, save)
end
next_inclade(save = true) click to toggle source

Get the next inclade task, saving intermediate results if save. Returns a Symbol.

# File lib/miga/project/result.rb, line 44
def next_inclade(save = true)
  next_task(@@INCLADE_TASKS, save)
end
next_task(tasks = nil, save = true) click to toggle source

Get the next task from tasks, saving intermediate results if save. If tasks is nil (default), it uses the entire list of tasks. Returns a Symbol.

# File lib/miga/project/result.rb, line 52
def next_task(tasks = nil, save = true)
  tasks ||= @@DISTANCE_TASKS + @@INCLADE_TASKS
  tasks.find do |t|
    ignore_task?(t) ? false : add_result(t, save).nil?
  end
end
project() click to toggle source

Return itself, to simplify modules

# File lib/miga/project/result.rb, line 22
def project
  self
end
result_base() click to toggle source

Return the basename for results

# File lib/miga/project/result.rb, line 16
def result_base
  'miga-project'
end