{"id":13483620,"url":"https://github.com/philnash/envyable","last_synced_at":"2025-04-06T16:12:03.489Z","repository":{"id":12982512,"uuid":"15661302","full_name":"philnash/envyable","owner":"philnash","description":"The simplest yaml to ENV config loader.","archived":false,"fork":false,"pushed_at":"2021-01-06T05:49:05.000Z","size":47,"stargazers_count":78,"open_issues_count":2,"forks_count":13,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-30T14:11:15.411Z","etag":null,"topics":["configuration-management","env","environment-variables","environment-vars","envyable"],"latest_commit_sha":null,"homepage":"https://rubygems.org/gems/envyable","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/philnash.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"philnash"}},"created_at":"2014-01-06T00:05:25.000Z","updated_at":"2024-05-01T23:47:11.000Z","dependencies_parsed_at":"2022-09-13T17:50:39.952Z","dependency_job_id":null,"html_url":"https://github.com/philnash/envyable","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philnash%2Fenvyable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philnash%2Fenvyable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philnash%2Fenvyable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philnash%2Fenvyable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/philnash","download_url":"https://codeload.github.com/philnash/envyable/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247509224,"owners_count":20950232,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["configuration-management","env","environment-variables","environment-vars","envyable"],"created_at":"2024-07-31T17:01:13.392Z","updated_at":"2025-04-06T16:12:03.467Z","avatar_url":"https://github.com/philnash.png","language":"Ruby","readme":"# Envyable\n\nThe simplest yaml to ENV config loader.\n\n[![Gem version](https://badge.fury.io/rb/envyable.svg)](https://rubygems.org/gems/envyable) ![Build Status](https://github.com/philnash/envyable/workflows/tests/badge.svg) [![Code Climate](https://codeclimate.com/github/philnash/envyable/badges/gpa.svg)](https://codeclimate.com/github/philnash/envyable)\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n    gem 'envyable'\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install envyable\n\n### Install task\n\nOnce the gem is included in your project, you can then use it to generate the\ndefault required files. Just run:\n\n    $ envyable install\n\nand you will get a `config` directory containing an `env.yml` and a\n`env.yml.example` file. If you have a `.gitignore` file this will also append\nthe line:\n\n```yaml\n/config/env.yml\n```\n\nto your config so that you do not check in `/config/env.yml`.\n\nIf you have [Spring](https://github.com/rails/spring) bundled with your\napplication this will append the following line to `/config/spring.rb`:\n\n```ruby\nSpring.watch 'config/env.yml'\n```\n\nIf the file `/config/spring.rb` does not exist, it will be created.\n\n## Usage\n\n### YAML file\n\nCreate a yaml file that holds your settings. You can put default settings into the root of the yaml file and then override those on an environment by environment basis. For example, the following yaml file will load the id \"development-id\" into all environments it is loaded in except for the test environment, where the id would be \"test-id\".\n\n```\nAPI_CLIENT_ID: development-id\ntest:\n  API_CLIENT_ID: test-id\n```\n\n### Rails\n\nOnce installed in a Rails app, add your yaml file at `config/env.yml`. The gem will load the correct environment on initialization of the application. If you are using Spring to load your Rails application, [add `config/env.yml` to Spring's watch list](https://github.com/rails/spring#watching-files-and-directories).\n\n### Load Immediately\n\nIf you have gems that require variables to be set earlier then place `envyable` in the `Gemfile` before those gems and require `envyable/rails-now`:\n```\ngem 'envyable', require: 'envyable/rails-now'\ngem 'other-gem-that-requires-env-variables'\n```\n\n### Other applications\n\nWith the exception of loading Envyable immediately via the Gemfile, you can create your yaml file anywhere (though why not `config/env.yml`?). To load your yaml file into `ENV`, call:\n```\nEnvyable.load('path/to/yml', environment)\n```\n\nThe default environment is development if you leave that argument blank.  For example, if your variables are in a config folder in a file called env.yml, and you want to load development only, include in your script:\n```\nrequire 'envyable'\nEnvyable.load('config/env.yml')\n```\n\n### Version control\n\nIt is not recommended that you check the yaml file in to version control. Personally, I like to check in a `env.yml.example` file that shows the required keys, but does not include any credentials. If you generate your Envyable files using the installer, `config/env.yml` will be added to your `.gitignore` file.\n\n## Troubleshooting\n\nIf your ENV values don't update when you modify `config/env.yml`, verify whether you have Spring (or another application preloader) that isn't configured to watch and reload when you update values.  You should try configuring the preloader or just restarting it.\n\n## Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n","funding_links":["https://github.com/sponsors/philnash"],"categories":["Configuration"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphilnash%2Fenvyable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphilnash%2Fenvyable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphilnash%2Fenvyable/lists"}