Class: TurboTest::Configuration
- Inherits:
-
Object
- Object
- TurboTest::Configuration
- Defined in:
- lib/turbo_test/configuration.rb
Defined Under Namespace
Classes: Loader
Constant Summary collapse
Instance Attribute Summary collapse
-
#jobs ⇒ Object
Returns the value of attribute jobs.
-
#loaded ⇒ Object
Returns the value of attribute loaded.
-
#worker ⇒ Object
Returns the value of attribute worker.
Instance Method Summary collapse
- #defaults!(pwd = Dir.pwd) ⇒ Object
- #finalize! ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #load(path) ⇒ Object
- #queue(matching) ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
27 28 29 30 31 |
# File 'lib/turbo_test/configuration.rb', line 27 def initialize @loaded = false @worker = nil @jobs = [] end |
Instance Attribute Details
#jobs ⇒ Object
Returns the value of attribute jobs.
35 36 37 |
# File 'lib/turbo_test/configuration.rb', line 35 def jobs @jobs end |
#loaded ⇒ Object
Returns the value of attribute loaded.
33 34 35 |
# File 'lib/turbo_test/configuration.rb', line 33 def loaded @loaded end |
#worker ⇒ Object
Returns the value of attribute worker.
34 35 36 |
# File 'lib/turbo_test/configuration.rb', line 34 def worker @worker end |
Instance Method Details
#defaults!(pwd = Dir.pwd) ⇒ Object
62 63 64 65 66 67 68 |
# File 'lib/turbo_test/configuration.rb', line 62 def defaults!(pwd = Dir.pwd) loader = Loader.new(self, pwd) loader.defaults! return loader end |
#finalize! ⇒ Object
45 46 47 48 49 |
# File 'lib/turbo_test/configuration.rb', line 45 def finalize! unless @loaded self.defaults! end end |
#load(path) ⇒ Object
37 38 39 40 41 42 43 |
# File 'lib/turbo_test/configuration.rb', line 37 def load(path) loader = Loader.new(self, File.dirname(path)) loader.instance_eval(File.read(path), path.to_s) return loader end |
#queue(matching) ⇒ Object
51 52 53 54 55 56 57 58 |
# File 'lib/turbo_test/configuration.rb', line 51 def queue(matching) if matching.nil? or matching.empty? # No filtering required, return all jobs: return @jobs.dup else return @jobs.select{|klass, path| matching.include?(path)} end end |