Class: Nutella::RunListHash
- Inherits:
-
PersistedHash
- Object
- PersistedHash
- Nutella::RunListHash
- Defined in:
- lib/config/runlist.rb
Instance Method Summary collapse
-
#extract_run_id(run_name) ⇒ String
Extracts the
run_idfrom the run name (specified at command line) was specified) or the concatenation ofproject_nameandrun_name. -
#runs_by_project(project_name = nil) ⇒ Array<String>
Returns the
run_idnames for a certain project If no project is specified, run_ids for all projects are returned.
Methods inherited from PersistedHash
#[], #[]=, #add?, #delete, #delete?, #empty?, #has_key?, #include?, #initialize, #keys, #length, #to_h, #to_s
Constructor Details
This class inherits a constructor from Nutella::PersistedHash
Instance Method Details
#extract_run_id(run_name) ⇒ String
Extracts the run_id from the run name (specified at command line) was specified) or the concatenation of project_name and run_name
19 20 21 |
# File 'lib/config/runlist.rb', line 19 def extract_run_id( run_name ) run_name.to_s.empty? ? Nutella.current_project.config['name'] : "#{Nutella.current_project.config['name']}_#{run_name}" end |
#runs_by_project(project_name = nil) ⇒ Array<String>
Returns the run_id names for a certain project If no project is specified, run_ids for all projects are returned
11 12 13 |
# File 'lib/config/runlist.rb', line 11 def runs_by_project( project_name=nil ) (project_name == nil) ? keys : keys.select { |run| run.start_with?(project_name) } end |