Method: Gemstash::Configuration#initialize
- Defined in:
- lib/gemstash/configuration.rb
#initialize(file: nil, config: nil) ⇒ Configuration
Returns a new instance of Configuration.
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/gemstash/configuration.rb', line 24 def initialize(file: nil, config: nil) if config @config = DEFAULTS.merge(config).freeze return end raise MissingFileError, file if file && !File.exist?(file) file ||= DEFAULT_FILE if File.exist?(file) @config = YAML.load_file(file) @config = DEFAULTS.merge(@config) @config.freeze else @config = DEFAULTS end end |