Description
A sane configuration format from @mojombo. This is far superior to YAML and JSON because it doesn't suck. Really it doesn't.
TOML alternatives and similar gems
Based on the "Parsers" category.
Alternatively, view TOML alternatives based on common mentions on social networks and blogs.
-
Nokogiri
Nokogiri (鋸) makes it easy and painless to work with XML and HTML from Ruby. -
Sablon
Ruby Document Template Processor based on docx templates and Mail Merge fields. -
ROXML
ROXML is a module for binding Ruby classes to XML. It supports custom mapping and bidirectional marshalling between Ruby and XML using annotation-style class methods, via Nokogiri or LibXML. -
Shale
Shale is a Ruby object mapper and serializer for JSON, YAML and XML. It allows you to parse JSON, YAML and XML data and convert it into Ruby data structures, as well as serialize data structures into JSON, YAML or XML. -
HappyMapper
Object to XML mapping library, using Nokogiri (Fork from John Nunemaker's Happymapper) -
Nokolexbor
High-performance HTML5 parser for Ruby based on Lexbor, with support for both CSS selectors and XPath. -
Tomlib
Tomlib is a fast and standards-compliant TOML parser and generator for Ruby.
Static code analysis for 29 languages.
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of TOML or a related project?
Popular Comparisons
README
TOML
A sane configuration format from @mojombo. More information here: https://github.com/mojombo/toml
This is far superior to YAML and JSON because it doesn't suck. Really it doesn't.
Usage
Add to your Gemfile:
gem "toml", "~> 0.3.0"
It's simple, really.
content = <<-TOML
# Hello, this is an example.
[things]
other = "things"
what = 900000
TOML
parser = TOML::Parser.new(content).parsed
# => { "things" => { "other" => "things", "what" => 900000 } }
You can also use the same API as YAML
if you'd like:
TOML.load("thing = 9")
# => {"thing" => 9}
TOML.load_file("my_file.toml")
# => {"whatever" => "keys"}
There's also a beta feature for generating a TOML file from a Ruby hash. Please note this will likely not give beautiful output right now.
hash = {
"integer" => 1,
"float" => 3.14159,
"true" => true,
"false" => false,
"string" => "hi",
"array" => [[1], [2], [3]],
"key" => {
"group" => {
"value" => "lol"
}
}
}
doc = TOML::Generator.new(hash).body
# doc will be a string containing a proper TOML document.
Contributors
Written by Jeremy McAnally (@jm) and Dirk Gadsden (@dirk) based on TOML from Tom Preston-Werner (@mojombo).