Class: KmsTools::Config
- Inherits:
-
Object
- Object
- KmsTools::Config
- Defined in:
- lib/kms-tools/config.rb
Class Method Summary collapse
- .config ⇒ Object
- .config_data ⇒ Object
- .load(path) ⇒ Object
- .load_config(file) ⇒ Object
- .method_missing(method, args = false) ⇒ Object
Class Method Details
.config ⇒ Object
8 9 10 |
# File 'lib/kms-tools/config.rb', line 8 def config config_data.to_hash end |
.config_data ⇒ Object
17 18 19 |
# File 'lib/kms-tools/config.rb', line 17 def config_data @config_data ||= Hashie::Mash.new end |
.load(path) ⇒ Object
12 13 14 15 |
# File 'lib/kms-tools/config.rb', line 12 def load(path) load_config(path) config end |
.load_config(file) ⇒ Object
27 28 29 30 |
# File 'lib/kms-tools/config.rb', line 27 def load_config(file) raise MissingConfig, "Missing configuration file: #{file} Run help command for config file switch" unless File.exist?(file) config_data.merge! YAML.load_file(file) end |
.method_missing(method, args = false) ⇒ Object
22 23 24 |
# File 'lib/kms-tools/config.rb', line 22 def method_missing(method, args=false) config_data.send(method, args) end |