Skip to content
This repository

Configus helps you easily manage environment specific settings

branch: master

Bump to 0.0.5

latest commit 9a6a6e3119
Andrew Kumanyaev zzet authored January 11, 2014
Octocat-spinner-32 lib Bump to 0.0.5 January 11, 2014
Octocat-spinner-32 spec Use config in config December 12, 2013
Octocat-spinner-32 .coveralls.yml fix token January 14, 2013
Octocat-spinner-32 .gitignore init project November 05, 2011
Octocat-spinner-32 .travis.yml removed unsupported rubies December 11, 2013
Octocat-spinner-32 Gemfile add rake to gemfile June 07, 2013
Octocat-spinner-32 README.md Use config in config December 12, 2013
Octocat-spinner-32 Rakefile refactor dependencies June 07, 2013
Octocat-spinner-32 configus.gemspec refactor dependencies June 07, 2013
README.md

Configus

Gem Version Build Status Dependency Status Code Climate Coverage Status Gem Version

Summary

Configus helps you easily manage environment specific settings

Installing

Add this to your Gemfile:

gem "configus"

Examples

Definition

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
  end

  env :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
end

reload

# config/environments/development.rb
ActionDispatch::Reloader.to_prepare do
  load Rails.root.join('lib/configus.rb')
end

Similar

Something went wrong with that request. Please try again.