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.
10 11 12 13 14 |
# File 'lib/turbo_test/configuration.rb', line 10 def initialize @loaded = false @worker = nil @jobs = [] end |
Instance Attribute Details
#jobs ⇒ Object
Returns the value of attribute jobs.
18 19 20 |
# File 'lib/turbo_test/configuration.rb', line 18 def jobs @jobs end |
#loaded ⇒ Object
Returns the value of attribute loaded.
16 17 18 |
# File 'lib/turbo_test/configuration.rb', line 16 def loaded @loaded end |
#worker ⇒ Object
Returns the value of attribute worker.
17 18 19 |
# File 'lib/turbo_test/configuration.rb', line 17 def worker @worker end |
Instance Method Details
#defaults!(pwd = Dir.pwd) ⇒ Object
45 46 47 48 49 50 51 |
# File 'lib/turbo_test/configuration.rb', line 45 def defaults!(pwd = Dir.pwd) loader = Loader.new(self, pwd) loader.defaults! return loader end |
#finalize! ⇒ Object
28 29 30 31 32 |
# File 'lib/turbo_test/configuration.rb', line 28 def finalize! unless @loaded self.defaults! end end |
#load(path) ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/turbo_test/configuration.rb', line 20 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
34 35 36 37 38 39 40 41 |
# File 'lib/turbo_test/configuration.rb', line 34 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 |