Method: Gemstash::Configuration#initialize
- Defined in:
- lib/gemstash/configuration.rb
#initialize(file: nil, config: nil) ⇒ Configuration
Returns a new instance of Configuration.
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/gemstash/configuration.rb', line 36 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 |