vendor/gems/app_config-1.2.0/lib/app_config.rb
# Create a new ApplicationConfiguration object.  <tt>conf_path_1</tt> is the path to your YAML configuration file.
# If <tt>conf_path_2</tt> is given, the contents are recursively merged with the contents of <tt>conf_path_1</tt>.
# This allows you to have a "base" configuration with settings that are overrided by "environment specific"
# (developement, test, production, etc) settings.
#
# Ex:
#  ApplicationConfiguration.new(RAILS_ROOT+"/config/base.yml", RAILS_ROOT+"/environments/#{RAILS_ENV}_config.yml")
Create a new ApplicationConfiguration object. conf_path_1 is the path to your YAML configuration file.
If conf_path_2 is given, the contents are recursively merged with the contents of conf_path_1.
This allows you to have a "base" configuration with settings that are overrided by "environment specific"
(developement, test, production, etc) settings.


Create a new ApplicationConfiguration object . conf_path_1 is the path to your YAML configuration file . If conf_path_2 is given the contents are recursively merged with the contents of conf_path_1 . This allows you to have a " base " configuration with settings that are overrided by " environment specific " ( developement test production etc ) settings .
def use_environment!(environment, options = {})
    raise ArgumentError, "environment doesn't exist in app config: #{environment}" \
      unless @config_hash.has_key?(environment.to_s)
    @config_hash = @config_hash[environment.to_s]
    @config = @config.send(environment)
    if options[:override_with] and File.exist?(options[:override_with])
      overriding_config = load_conf_file(options[:override_with])
      @config_hash = recursive_merge(@config_hash, overriding_config)
      @config = ClosedStruct.r_new(@config_hash)
    end
  end
def use_environment! ( environment , options = { } ) raise ArgumentError , "environment doesn't exist in app config: #{environment}" unless @config_hash . has_key? ( environment . to_s ) @config_hash = @config_hash [ environment . to_s ] @config = @config . send ( environment ) if options [ :override_with ] and File . exist? ( options [ :override_with ] ) overriding_config = load_conf_file ( options [ :override_with ] ) @config_hash = recursive_merge ( @config_hash , overriding_config ) @config = ClosedStruct . r_new ( @config_hash ) end end
Create a new ApplicationConfiguration object.
Create a new ApplicationConfiguration object .
environment
<not_specific>
options
<not_specific>