Class: Gorgon::Configuration::ConfigurationParser

Inherits:
Object
  • Object
show all
Defined in:
lib/gorgon/configuration.rb

Instance Method Summary collapse

Constructor Details

#initialize(file_loader:) ⇒ ConfigurationParser

Returns a new instance of ConfigurationParser.



18
19
20
# File 'lib/gorgon/configuration.rb', line 18

def initialize(file_loader:)
  @file_loader = file_loader
end

Instance Method Details

#load_from_files(first_filename:, merge_filename:) ⇒ Object



22
23
24
25
26
27
28
# File 'lib/gorgon/configuration.rb', line 22

def load_from_files(first_filename:, merge_filename:)
  if merge_filename && @file_loader.exists?(merge_filename)
    load_file(first_filename).deep_merge(load_file(merge_filename))
  else
    load_file(first_filename)
  end
end