Project

confi

0.0
No release in over 3 years
Auto attr_accessor for a kind of configuration
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

 Project Readme

Confi

Gem Version Downloads GitHub Build Ruby Style Guide MIT License

A simple and efficient "configuration" gem for Ruby (can be used in Rails as well). Options can be initialized as required and later be accessed.

A global Confi (the usual usage) as well as an instance (not recommended) configuration are supported.

See Usage below.

Usage (global Confi)

require "confi"
...
Confi.debug = true
...
if Confi.debug
  ...
end
...

Configure (initialization)

Confi.configure(hash)
Confi.configure do |s|
  s.option = :active
  s.name = "name"
end

Usage (in instances)

require "confi"

class User # a sample
  include Confi
end
...
# create instance
user = User.new

# Functionality same as with Confi; use instance name
user.debug = false
...
...
# Not yet initialized attribute
if Confi.debug  # NoMethodError: undefined method 'debug'
  ...
end
...

Installation

As usual:

# Gemfile
...
gem "confi"
...

and run "bundle install".

Miscellaneous

Copyright (c) 2025 Dittmar Krall (www.matiq.com), released under the MIT license.