Method: Gemstash::Configuration#initialize
- Defined in:
- lib/gemstash/configuration.rb
#initialize(file: nil, config: nil) ⇒ Configuration
Returns a new instance of Configuration.
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/gemstash/configuration.rb', line 30 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 = parse_config(file) @config = DEFAULTS.merge(@config) @config.freeze else @config = DEFAULTS end end |