lib/sinatra/envconf.rb
# Returns the configuration file location given the name of 
# an environment variable.
#
# @param env_var [String] the environment variable name
# @return [String] the configuration file location
Returns the configuration file location given the name of
an environment variable.
Returns the configuration file location given the name of an environment variable .
def config_file_location(env_var)
      direct_config = "#{env_var}_CONFIG_FILE"
      if ENV[direct_config]
        return ENV[direct_config]
      end
      config_dir = File.expand_path("config", ENV[env_var] || '.' )
      File.expand_path("#{String(settings.environment)}.yml", config_dir)
    end
def config_file_location ( env_var ) direct_config = "#{env_var}_CONFIG_FILE" if ENV [ direct_config ] return ENV [ direct_config ] end config_dir = File . expand_path ( "config" , ENV [ env_var ] || '.' ) File . expand_path ( "#{String(settings.environment)}.yml" , config_dir ) end
Returns the configuration file location given the name of
an environment variable.
Returns the configuration file location given the name of an environment variable .
the configuration file location
the configuration file location
String
env_var
the environment variable name
the environment variable name