Class: InSpecMultiServer::Config::Settings
- Inherits:
-
Object
- Object
- InSpecMultiServer::Config::Settings
- Defined in:
- lib/inspec-multi-server/config/config.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#file ⇒ Object
readonly
Returns the value of attribute file.
Class Method Summary collapse
- .cookbook_directory(path) ⇒ Object
- .current ⇒ Object
- .current=(value) ⇒ Object
- .default_project ⇒ Object
- .default_stage ⇒ Object
- .load(config) ⇒ Object
Instance Method Summary collapse
-
#initialize(file) ⇒ Settings
constructor
A new instance of Settings.
- #server(server) ⇒ Object
Constructor Details
#initialize(file) ⇒ Settings
Returns a new instance of Settings.
6 7 8 9 |
# File 'lib/inspec-multi-server/config/config.rb', line 6 def initialize(file) @file = file @data = JSON.parse(File.read(file)) end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
5 6 7 |
# File 'lib/inspec-multi-server/config/config.rb', line 5 def data @data end |
#file ⇒ Object (readonly)
Returns the value of attribute file.
5 6 7 |
# File 'lib/inspec-multi-server/config/config.rb', line 5 def file @file end |
Class Method Details
.cookbook_directory(path) ⇒ Object
27 28 29 |
# File 'lib/inspec-multi-server/config/config.rb', line 27 def self.cookbook_directory(path) File.join(path) end |
.current ⇒ Object
23 24 25 |
# File 'lib/inspec-multi-server/config/config.rb', line 23 def self.current Thread.current[:inspec_settings] end |
.current=(value) ⇒ Object
19 20 21 |
# File 'lib/inspec-multi-server/config/config.rb', line 19 def self.current=(value) Thread.current[:inspec_settings] = value end |
.default_project ⇒ Object
15 16 17 |
# File 'lib/inspec-multi-server/config/config.rb', line 15 def self.default_project 'cme-eventhub-core' end |
.default_stage ⇒ Object
11 12 13 |
# File 'lib/inspec-multi-server/config/config.rb', line 11 def self.default_stage 'development' end |
.load(config) ⇒ Object
35 36 37 |
# File 'lib/inspec-multi-server/config/config.rb', line 35 def self.load(config) InSpecMultiServer::Config::Settings.new(config) end |
Instance Method Details
#server(server) ⇒ Object
31 32 33 |
# File 'lib/inspec-multi-server/config/config.rb', line 31 def server(server) servers[server] end |