Project

nodaire

0.0
No release in over 3 years
Low commit activity in last 3 years
Nodaire is a collection of text file parsers.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

Nodaire

Gem Version

Nodaire is a collection of text file parsers. It supports Ruby 2.5.0 or greater.

Note: This is a new gem, and the interface is not yet stable. Expect breaking API changes before v1.0.0 is released.

File formats

Nodaire supports the following text file formats:

File format Documentation and examples Origin
Indental Nodaire::Indental https://wiki.xxiivv.com/#indental
Tablatal Nodaire::Tablatal https://wiki.xxiivv.com/#tablatal

Install

Install nodaire from RubyGems:

gem install nodaire

Documentation

Code documentation is available.

Keep reading below for examples of how to use Nodaire.

Usage example

require 'nodaire/indental'

source = <<~NDTL
  NAME
    KEY : VALUE
    LIST
      ITEM1
      ITEM2
NDTL

doc = Nodaire::Indental.parse(source)

doc.valid?
#=> true

doc.categories
#=> ["NAME"]

doc['NAME']['KEY']
#=> "VALUE"

doc.to_h
#=> {"NAME" => {"KEY"=>"VALUE", "LIST"=>["ITEM1", "ITEM2"]}}

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

Development

To run the latest source code, check out the Git repository:

git clone https://github.com/ljcooke/nodaire.git

Install the dependencies using Bundler:

gem install bundler
bundle install

Analyse the code and run unit tests using Bundler:

bundle exec rake rubocop
bundle exec rake spec