0.0
No commit activity in last 3 years
No release in over 3 years
Provides a simple way to define a configuration with validation
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 0.1
~> 2.0
>= 12.3.3
~> 3.0
 Project Readme

UltraConfig

Ruby gem for application configuration with validation. UltraConfig provides an all-in-one solution for defining your configuration with default values, namespacing and validation.

Installation

Add this line to your application's Gemfile:

gem 'ultra_config'

And then execute:

$ bundle

Or install it yourself as:

$ gem install ultra_config

Usage

Example Usage:

require 'ultra_config'

ConfigTest = UltraConfig.define do
  config :blank
  config :default, :value

  config :one_of, :this do
    one_of %i[this that]
  end

  config :match, 'this' do
    match /this/
  end

  config :range, 4 do
    range 1, 9
  end

  namespace :space1 do
    config :default, :another_value
  end

  namespace :space2 do
    namespace :space3 do
      config :default, :a_third_value
    end
  end
end

# It can then be used like:

ConfigTest.space2.space3.default

Development

After checking out the repo, run bundle install to install dependencies. Then, run rake spec to run the tests.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/SpyMachine/ultra_config.

License

The gem is available as open source under the terms of the MIT License.