Sha256: 96c70ebdff892a7716f836e4fce331ade675603ee5ef45ddd13030beb8333042

Contents?: true

Size: 554 Bytes

Versions: 1

Compression:

Stored size: 554 Bytes

Contents

module Rails
	module ApplicationConfig
		class Railtie < Rails::Railtie
			initializer "setup config" do
				begin
				  config = ::ApplicationConfig::Base.new
				  [Rails.root.join("config", "application.yml"), Rails.root.join("config", "environments", "application-#{Rails.env.to_s}.yml")].each do |config_file|
				    next unless config_file.file?
				    read = IO.read(config_file)
				    erb_result = ERB.new(read).result
				    config.add(erb_result)
				  end
				  ::ApplicationConfig::Base.singleton(config)
				end
			end
		end
	end
end


Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
application_config-0.0.2 lib/application_config/railtie.rb