Module: Climatic::Initializer
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Instance Method Summary collapse
- #bootstrap(cmd_line_args: ARGV.dup, command_manager: Climatic::ConfigLayers::CommandLineLayer.default_command_line_manager) ⇒ Object
- #climatic_bootstrapped? ⇒ Boolean
- #climatic_bootstrapping? ⇒ Boolean
Methods included from Utils::ScriptHelper
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
7 8 9 |
# File 'lib/climatic/initializer.rb', line 7 def config @config end |
Instance Method Details
#bootstrap(cmd_line_args: ARGV.dup, command_manager: Climatic::ConfigLayers::CommandLineLayer.default_command_line_manager) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/climatic/initializer.rb', line 9 def bootstrap(cmd_line_args: ARGV.dup, command_manager: Climatic::ConfigLayers::CommandLineLayer.default_command_line_manager) raise Climatic::Error, 'You cannot bootstrap Climatic framework twice !' if climatic_bootstrapped? @climatic_status = :bootstrapping setup_initial_logger Climatic.logger.debug 'Starting Climatic framework setup...' # Get the config first to correctly setup the definitive logger setup_config_manager cmd_line_args, command_manager # Now we can setup the definitive logger setup_logger Climatic.logger.debug 'Climatic framework setup complete.' @climatic_status = :bootstrapped rescue Slop::UnknownOption Climatic.logger.debug 'Climatic initialization failed (wrong command line options) !' end |
#climatic_bootstrapped? ⇒ Boolean
29 30 31 |
# File 'lib/climatic/initializer.rb', line 29 def climatic_bootstrapped? @climatic_status == :bootstrapped end |
#climatic_bootstrapping? ⇒ Boolean
25 26 27 |
# File 'lib/climatic/initializer.rb', line 25 def climatic_bootstrapping? @climatic_status == :bootstrapping end |