Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/thinkswan/app-yml-rails
A gem that provides environment-specific settings for Rails apps.
https://github.com/thinkswan/app-yml-rails
gem ruby ruby-on-rails
Last synced: 13 days ago
JSON representation
A gem that provides environment-specific settings for Rails apps.
- Host: GitHub
- URL: https://github.com/thinkswan/app-yml-rails
- Owner: thinkswan
- License: mit
- Created: 2012-04-27T07:08:11.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2012-05-01T18:13:01.000Z (over 12 years ago)
- Last Synced: 2024-03-14T23:06:43.075Z (10 months ago)
- Topics: gem, ruby, ruby-on-rails
- Language: Ruby
- Homepage: https://rubygems.org/gems/app-yml-rails
- Size: 168 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: MIT-LICENSE
Awesome Lists containing this project
README
# app-yml-rails
This gem provides a Rails application with project-wide settings via an **app.yml** file. Settings can be accessed anywhere: controllers, helpers, views, models, tests, in the console, etc.
## Features
- Provides project-wide settings via **config/app.yml**.
- Supports `App.settings.nested_settings` syntax.
- Supports **all/production/staging/development/test** environments (specific environment settings over settings from the 'all' environment).
- Auto-refreshes **app.yml** changes without requiring an application restart.## Installation
Add the following line to your project's **Gemfile**:
gem 'app-yml-rails'
Install the gem using **Bundler**:
$ bundle
Install the config and initializer files:
$ rails generate app_yml:install
## Usage
1. Edit your project settings in **config/app.yml**.
2. Access settings anywhere in your application via `App.settings.nested_setting` syntax.## Examples
If your **config/app.yml** file appears as follows:
all:
emails:
admin: [email protected]
team:
ceo: [email protected]
max_search_results: 20
app_name: My Amazing Applicationdevelopment:
emails:
team:
ceo: ceo@localhost
app_name: My Amazing Application (development)production:
app_name: My Amazing Application (production)Settings in the **development** environment:
App.emails.admin => '[email protected]'
App.emails.team.ceo => 'ceo@localhost'
App.max_search_results => 20
App.app_name => 'My Amazing Application (development)'Settings in the **production** environment:
App.emails.admin => '[email protected]'
App.emails.team.ceo => '[email protected]'
App.max_search_results => 20
App.app_name => 'My Amazing Application (production)'## License
[MIT License](https://github.com/thinkswan/app-yml-rails/blob/master/MIT-LICENSE)