Module: CLIUtils::Configuration
Overview
Configuration Module Manages any configuration values and the flat YAML file into which they get stored.
Constant Summary collapse
- LOG_LEVELS =
Allows easy access to Logger levels.
{ 'DEBUG' => Logger::DEBUG, 'INFO' => Logger::INFO, 'WARN' => Logger::WARN, 'ERROR' => Logger::ERROR, 'FATAL' => Logger::FATAL }
- @@configuration =
nil
Instance Method Summary collapse
-
#configuration ⇒ Configurator
Singleton method to return (or initialize, if needed) a Configurator.
-
#load_configuration(path) ⇒ void
(also: #filepath=)
Singleton method to return (or initialize, if needed) a Configurator.
Instance Method Details
#configuration ⇒ Configurator
Singleton method to return (or initialize, if needed) a Configurator.
24 25 26 27 28 29 30 31 |
# File 'lib/cliutils/configuration.rb', line 24 def configuration if @@configuration @@configuration else fail 'Attempted to access `configuration` before ' \ 'executing `load_configuration`' end end |
#load_configuration(path) ⇒ void Also known as: filepath=
This method returns an undefined value.
Singleton method to return (or initialize, if needed) a Configurator.
37 38 39 |
# File 'lib/cliutils/configuration.rb', line 37 def load_configuration(path) @@configuration = Configurator.new(path) end |