Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kaize/configus
Configus helps you easily manage environment specific settings
https://github.com/kaize/configus
Last synced: about 1 month ago
JSON representation
Configus helps you easily manage environment specific settings
- Host: GitHub
- URL: https://github.com/kaize/configus
- Owner: kaize
- Created: 2011-11-05T11:52:51.000Z (about 13 years ago)
- Default Branch: master
- Last Pushed: 2018-11-08T23:01:48.000Z (about 6 years ago)
- Last Synced: 2024-10-07T20:37:57.642Z (2 months ago)
- Language: Ruby
- Homepage:
- Size: 28.3 KB
- Stars: 61
- Watchers: 30
- Forks: 12
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-ruby - Configus - Helps you easily manage environment specific settings. (Configuration)
README
# Configus
[![Gem Version](https://badge.fury.io/rb/configus.svg)](https://rubygems.org/gems/configus)
[![Build Status](https://travis-ci.org/kaize/configus.svg)](https://travis-ci.org/kaize/configus)
[![Dependency Status](https://gemnasium.com/kaize/configus.svg)](https://gemnasium.com/kaize/configus)
[![Code Climate](https://codeclimate.com/github/kaize/configus.svg)](https://codeclimate.com/github/kaize/configus)
[![Coverage Status](https://coveralls.io/repos/kaize/configus/badge.svg?branch=master)](https://coveralls.io/r/kaize/configus)## Summary
Configus helps you easily manage environment specific settings
## Installing
Add this to your `Gemfile`:
gem "configus"
## Examples
### Definition
``` ruby
Configus.build :development do # set current environment
env :production do
site_name 'Example'
web do
domain 'example.com'
protocol 'https'
port 80
uri -> { "#{protocol}://#{domain}:#{port}" }
end
site_uri -> { web.uri }
email do
pop do
address 'pop.example.com'
port 110
end
smtp do
address 'smtp.example.com'
port 25
end
end
endenv :development, :parent => :production do
web do
domain 'localhost'
protocol 'http'
port 9292
end
email do
smtp do
address 'smpt.text.example.com'
end
end
end
end
```### Usage
configus.site_name # => 'Example'
configus.web.uri # => 'https://example.com:80'
configus.site_uri # => 'https://example.com:80'
configus.email.pop.port # => 110### Rails
define your config in `lib/configus.rb`
Configus.build Rails.env do
# settings
endreload
# config/environments/development.rb
ActionDispatch::Reloader.to_prepare do
load Rails.root.join('lib/configus.rb')
end## Similar
* https://github.com/markbates/configatron
* https://github.com/railsjedi/rails_config