Method: ConfigFor.load_config!

Defined in:
lib/config_for.rb

.load_config!(path, name, env) ⇒ ActiveSupport::HashWithIndifferentAccess

Same as ConfigFor.load_config but raises exception when environment is not found. Note that this is the preferred way of loading configuration. Also it is used by Rails and Sinatra integrations.

Parameters:

  • path (Pathname, String)

    partial of full path to folder with configs

  • name (String)

    without extension

  • env (Symbol, String)

    key to get from the config

Returns:

  • (ActiveSupport::HashWithIndifferentAccess)

    config file for given env

Raises:


39
40
41
# File 'lib/config_for.rb', line 39

def self.load_config!(path, name, env)
  config(path, name).fetch(env)
end