Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

qonf

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

qonf

  • 0.0.4
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Qonf

Versitle configuration management. Pull data from ENV or config files. Simplest use case:

Usage

Qonf works well with or without Rails. If using Rails, Qonf will assume config files are in Rails.root/config directory. Otherwise, you'll need to set the root yourself:

Qonf.configure do
  self.base_dir = "./config"
end

Qonf also allows you to use environment based keys, these will come preconfigured for Rails or could be set by other ruby applications:

Qonf.configure do
  self.env = "staging" # hash under this key will be merged into top-level hash
  self.environments = %w{test staging production} # these will be removed from hash if they are top-level keys
end

So, if you config is as follows:

# config/names.json
{
  "test": {
    "name": "Test data"
  },
  "staging": {
    "name": "Bob Jones"
  }
}

Qonf.get(:names,:name) # Bob Jones

Config Files

Config files can be either json or yml. They are addressed by name and must live in the base_dir path (for Rails, this is Rails.root/config)

# config/qonf.json
{
  "host": "http://google.com"
}

Qonf.host # "http://google.com"

YAML can also be used:

# config/redis.yml
development:
  host: localhost

Qonf.get(:redis,:host) # "localhost"

Installation

Add this line to your application's Gemfile:

gem 'qonf'

And then execute:

$ bundle

Or install it yourself as:

$ gem install qonf

Testing

Tests are maintained by RSpec. To run test cases:

bundle exec rake test

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

FAQs

Package last updated on 22 Oct 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc