Socket
Book a DemoInstallSign in
Socket

reference_book

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

reference_book

0.0.3
bundlerRubygems
Version published
Maintainers
1
Created
Source

ReferenceBook

A multi-context configuration library and DSL.
ReferenceBook provides an easy interface to define, validate and query multi-context configuration data.

What does multi-context mean?
Any setting that should be static and that exist in different alternative versions.

Usage

TODO: Write usage instructions here

Examples

Lots are available in the repo.

Features/Problems

  • requires Ruby >= 2.0.0
  • simple configuration DSL, with validations
  • configuration data exists as frozen objects, not namespaced constants
  • library and books metaphor
  • easy and flexible query interface

Rubies

ReferenceBook requires a Ruby patch level >= 2.0.
It doesn't use any 2-only syntax features, but it does rely on some core classes' methods that only appeared with MRI 2.0.0.

MRI: supported, tested with 2.0 and 2.1.
JRuby: tested in 2.0 mode (JRUBY_OPTS=--2.0 rake test).
Rubinius: not supported, even in 2.1 mode its standard library classes seem to expose a 1.9 interface.

Tests

rake test

To Do

  • add support for different libraries, each with an enforced book structure
  • make it work with Ruby 1.9.3 (involves implementing methods that at the moment are provided by core classes).
  • memoize results of pluck and hash_pluck
  • implement library_key aliases, so that books can be retrieved with strings. Library keys have to be symbols, because they are used to define the accessor methods

Installation

Add this line to your application's Gemfile:

gem 'reference_book'

And then execute:

$ bundle

Or install it yourself as:

$ gem install reference_book

Contributing

FAQs

Package last updated on 19 Aug 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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.