Method: Configurative::SettingsLoader#load!

Defined in:
lib/configurative/settings_loader.rb

#load!(path) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/configurative/settings_loader.rb', line 12

def load!(path)
  type = MIME::Types.type_for(path).first.content_type
  case type
    when "application/json"
      load_json_file!(path)
    when "text/x-yaml"
      load_yaml_file!(path)
    else
      raise ConfigurationError, "Unsupported confguration file type '#{type}' encountered."
  end
end