Configurate ENV with Ruby syntax. Upload to Heroku
Features:
- Describe
ENV['key']
configuration with Ruby syntax - Upload configuration to Heroku
Usage
gem 'config_env'
ConfigEnv.init("#{__dir__}/env.rb")
Create file config/env.rb
:
config_env do
set 'all_env_key', '1'
end
config_env :test do
set 'test_key', '2'
end
config_env :production, :development do
set 'production_and_development_key', '3'
end
Add to application.rb
ConfigEnv.init("#{__dir__}/env.rb")
Add line to .gitignore
config/env.rb
Upload configurated variables to Heroku
Add to Rakefile
require 'config_env/rake_tasks'
ConfigEnv.init("#{__dir__}/config/env.rb")
Run
rake config_env:heroku
rake config_env:heroku[app]
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request