Project

multi_toml

0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
A gem to provide easy switching between different TOML backends, including toml, toml-ruby, and toml2.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 10.0
~> 2.11
 Project Readme

multi_toml

multi_toml is an interface gem for https://github.com/mojombo/toml.

There are many great TOML libraries out there. If you're writing an application, you should be able to use any one you want. If you're writing a library that other libraries or applications will use, you should use multi_toml so that you don't impose a particular implementation on the consuming application.

Implementations

Seriously?

Not entirely seriously, no.

But Why?

Because application developers shouldn't have to install 3 TOML libraries.

Usage

Add one of the supported gems to your Gemfile (or you global gem path), then

require 'multi_toml'
MultiToml.load('a toml string')

MultiToml will try to guess the best adapter for you. If you need to specify an adapter:

require 'multi_toml'
MultiToml.adapter = :toml
MultiToml.load('a toml string') # parsed with the toml gem