Class: Kitchen::Config
- Inherits:
-
Object
- Object
- Kitchen::Config
- Defined in:
- lib/kitchen/config.rb
Overview
Base configuration class for Kitchen. This class exposes configuration such as the location of the Kitchen config file, instances, log_levels, etc.
Instance Attribute Summary collapse
-
#kitchen_root ⇒ Object
readonly
Returns the value of attribute kitchen_root.
-
#loader ⇒ Object
readonly
Returns the value of attribute loader.
-
#log_level ⇒ Object
Returns the value of attribute log_level.
-
#log_root ⇒ Object
readonly
Returns the value of attribute log_root.
-
#test_base_path ⇒ Object
readonly
Returns the value of attribute test_base_path.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Config
constructor
Creates a new configuration.
-
#instances ⇒ Array<Instance>
All instances, resulting from all platform and suite combinations.
-
#platforms ⇒ Array<Platform>
All defined platforms which will be used in convergence integration.
-
#suites ⇒ Array<Suite>
All defined suites which will be used in convergence integration.
Constructor Details
#initialize(options = {}) ⇒ Config
Creates a new configuration.
41 42 43 44 45 46 47 |
# File 'lib/kitchen/config.rb', line 41 def initialize( = {}) @loader = .fetch(:loader) { Kitchen::Loader::YAML.new } @kitchen_root = .fetch(:kitchen_root) { Dir.pwd } @log_level = .fetch(:log_level) { Kitchen::DEFAULT_LOG_LEVEL } @log_root = .fetch(:log_root) { default_log_root } @test_base_path = .fetch(:test_base_path) { default_test_base_path } end |
Instance Attribute Details
#kitchen_root ⇒ Object (readonly)
Returns the value of attribute kitchen_root.
27 28 29 |
# File 'lib/kitchen/config.rb', line 27 def kitchen_root @kitchen_root end |
#loader ⇒ Object (readonly)
Returns the value of attribute loader.
30 31 32 |
# File 'lib/kitchen/config.rb', line 30 def loader @loader end |
#log_level ⇒ Object
Returns the value of attribute log_level.
31 32 33 |
# File 'lib/kitchen/config.rb', line 31 def log_level @log_level end |
#log_root ⇒ Object (readonly)
Returns the value of attribute log_root.
28 29 30 |
# File 'lib/kitchen/config.rb', line 28 def log_root @log_root end |
#test_base_path ⇒ Object (readonly)
Returns the value of attribute test_base_path.
29 30 31 |
# File 'lib/kitchen/config.rb', line 29 def test_base_path @test_base_path end |
Instance Method Details
#instances ⇒ Array<Instance>
Returns all instances, resulting from all platform and suite combinations.
51 52 53 |
# File 'lib/kitchen/config.rb', line 51 def instances @instances ||= Collection.new(build_instances) end |
#platforms ⇒ Array<Platform>
Returns all defined platforms which will be used in convergence integration.
57 58 59 60 |
# File 'lib/kitchen/config.rb', line 57 def platforms @platforms ||= Collection.new( data.platform_data.map { |pdata| Platform.new(pdata) }) end |
#suites ⇒ Array<Suite>
Returns all defined suites which will be used in convergence integration.
64 65 66 67 |
# File 'lib/kitchen/config.rb', line 64 def suites @suites ||= Collection.new( data.suite_data.map { |sdata| Suite.new(sdata) }) end |