Nodaire is a Ruby gem for parsing text file formats. It supports the Indental and Tablatal file formats.

Usage example

Given an Indental file:

; example.ndtl
NAME
  KEY : VALUE
  LIST
    ITEM1
    ITEM2

You can convert this to a Ruby hash and to JSON.

require 'nodaire/indental'

source = File.read('example.ndtl')
doc = Nodaire::Indental.parse(source)

doc.valid?     # true
doc.categories # ["NAME"]
doc.to_h       # {"NAME"=>{"KEY"=>"VALUE", "LIST"=>["ITEM1", "ITEM2"]}}
doc.to_json    # '{"NAME":{"KEY":"VALUE","LIST":["ITEM1","ITEM2"]}}'

How to install

Install nodaire via RubyGems:

gem install nodaire

Source code

The source code is available on GitHub.

License

This project is licensed under the MIT License.