Skip to content

SergXIIIth/config_env

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Configurate ENV with Ruby syntax. Upload to Heroku

Code Climate Dependency Status

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

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

About

Configurate ENV with Ruby syntax. Upload to Heroku

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages