lib/rails_config.rb in rails_config-0.3.4 vs lib/rails_config.rb in rails_config-0.4.1

- old
+ new

@@ -1,18 +1,20 @@ require 'active_support/core_ext/module/attribute_accessors' -require 'rails_config/options' -require "rails_config/sources/yaml_source" - +require 'rails_config/options' +require 'rails_config/version' +require 'rails_config/engine' +require 'rails_config/sources/yaml_source' require 'rails_config/vendor/deep_merge' unless defined?(DeepMerge) module RailsConfig # ensures the setup only gets run once @@_ran_once = false - mattr_accessor :const_name + mattr_accessor :const_name, :use_env @@const_name = "Settings" + @@use_env = false def self.setup yield self if @@_ran_once == false @@_ran_once = true end @@ -26,9 +28,10 @@ [files].flatten.compact.uniq.each do |file| config.add_source!(file.to_s) end config.load! + config.load_env! if @@use_env config end # Loads and sets the settings constant! def self.load_and_set_settings(*files)