Configus helps you easily manage environment specific settings
Add this to your Gemfile
:
gem "configus"
Configus.build :development do # set current environment
env :production do
website_url 'http://example.com'
email do
pop do
address 'pop.example.com'
port 110
end
smtp do
address 'smtp.example.com'
port 25
end
end
end
env :development, :parent => :production do
website_url 'http://text.example.com'
email do
smtp do
address 'smpt.text.example.com'
end
end
end
end
configus.website_url # => 'http://text.example.com'
configus.email.pop.port # => 110
define your config in lib/configus.rb
Configus.build Rails.env do
# settings
end
reload
# config/environments/development.rb
ActionDispatch::Reloader.to_prepare do
load Rails.root.join('lib/configus.rb')
end