Module: ConfigParser
- Defined in:
- lib/arkana/config_parser.rb
Overview
The config parser is responsible for parsing user CLI arguments, reading the config file and returning a ‘Config` object.
Class Method Summary collapse
-
.parse(arguments) ⇒ Config
Parses the config file defined by the user (if any), returning a Config object.
Class Method Details
.parse(arguments) ⇒ Config
Parses the config file defined by the user (if any), returning a Config object.
12 13 14 15 16 17 18 19 |
# File 'lib/arkana/config_parser.rb', line 12 def self.parse(arguments) yaml = YAML.load_file(arguments.config_filepath) config = Config.new(yaml) config.current_flavor = arguments.flavor config.dotenv_filepath = arguments.dotenv_filepath UI.warn("Dotenv file was specified but couldn't be found at '#{config.dotenv_filepath}'") if config.dotenv_filepath && !File.exist?(config.dotenv_filepath) config end |