Skip to content
Ruby parsers for text file formats.
Ruby
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github/ISSUE_TEMPLATE
lib
scripts
spec
.gitignore
.rspec
.rubocop.yml
.rubocop_todo.yml
.ruby-version
.travis.yml
.yardopts
CHANGELOG.md
Gemfile
LICENSE
README.md
Rakefile
nodaire.gemspec

README.md

Nodaire Gem Version Build Status

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/slisne/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
You can’t perform that action at this time.