Class: TestBoosters::Files::SplitConfiguration
- Inherits:
-
Object
- Object
- TestBoosters::Files::SplitConfiguration
- Defined in:
- lib/test_boosters/files/split_configuration.rb
Defined Under Namespace
Classes: Job
Instance Method Summary collapse
- #all_files ⇒ Object
- #files_for_job(job_index) ⇒ Object
-
#initialize(path) ⇒ SplitConfiguration
constructor
A new instance of SplitConfiguration.
- #jobs ⇒ Object
- #present? ⇒ Boolean
- #valid? ⇒ Boolean
Constructor Details
#initialize(path) ⇒ SplitConfiguration
Returns a new instance of SplitConfiguration.
7 8 9 10 |
# File 'lib/test_boosters/files/split_configuration.rb', line 7 def initialize(path) @path = path @valid = true end |
Instance Method Details
#all_files ⇒ Object
22 23 24 |
# File 'lib/test_boosters/files/split_configuration.rb', line 22 def all_files @all_files ||= jobs.map(&:files).flatten.sort end |
#files_for_job(job_index) ⇒ Object
26 27 28 29 30 |
# File 'lib/test_boosters/files/split_configuration.rb', line 26 def files_for_job(job_index) job = jobs[job_index] job ? job.files : [] end |
#jobs ⇒ Object
32 33 34 |
# File 'lib/test_boosters/files/split_configuration.rb', line 32 def jobs @jobs ||= present? ? load_data : [] end |
#present? ⇒ Boolean
12 13 14 |
# File 'lib/test_boosters/files/split_configuration.rb', line 12 def present? File.exist?(@path) end |
#valid? ⇒ Boolean
16 17 18 19 20 |
# File 'lib/test_boosters/files/split_configuration.rb', line 16 def valid? jobs # try to load data into memory @valid end |