Module: MiGA::Project::Result
- Includes:
- Common::WithResult, Base
- Included in:
- MiGA::Project
- Defined in:
- lib/miga/project/result.rb
Overview
Helper module including specific functions to add project results.
Instance Method Summary collapse
-
#ignore_task?(task) ⇒ Boolean
Is this
taskto be bypassed?. -
#next_distances(save = true) ⇒ Object
Get the next distances task, saving intermediate results if
save. -
#next_inclade(save = true) ⇒ Object
Get the next inclade task, saving intermediate results if
save. -
#next_task(tasks = nil, save = true) ⇒ Object
Get the next task from
tasks, saving intermediate results ifsave. -
#project ⇒ Object
Return itself, to simplify modules.
-
#result_base ⇒ Object
Return the basename for results.
Methods included from Common::WithResult
#add_result, #each_result, #get_result, #result, #result_dirs, #results
Instance Method Details
#ignore_task?(task) ⇒ Boolean
Is this task to be bypassed?
28 29 30 31 32 |
# File 'lib/miga/project/result.rb', line 28 def ignore_task?(task) ["run_#{task}"] == false || (!is_clade? && @@INCLADE_TASKS.include?(task) && ["run_#{task}"] != true) end |
#next_distances(save = true) ⇒ Object
Get the next distances task, saving intermediate results if save. Returns a Symbol.
37 38 39 |
# File 'lib/miga/project/result.rb', line 37 def next_distances(save = true) next_task(@@DISTANCE_TASKS, save) end |
#next_inclade(save = true) ⇒ Object
Get the next inclade task, saving intermediate results if save. Returns a Symbol.
44 45 46 |
# 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) ⇒ Object
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.
52 53 54 55 56 57 |
# 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 ⇒ Object
Return itself, to simplify modules
22 23 24 |
# File 'lib/miga/project/result.rb', line 22 def project self end |
#result_base ⇒ Object
Return the basename for results
16 17 18 |
# File 'lib/miga/project/result.rb', line 16 def result_base 'miga-project' end |