SDL4R is a SDL parser for Ruby.

Compatible with version 1.3 of the SDL syntax.
The current version is v0.9.8.

Find versions for Java, C#, C++, etc, at Ikayzo.

News:
  • Next step: v1.0, fast emitter
  • 26-dec-2010: v0.9.11 is out!
    • SDL4R.load() / SDL4R.dump(), serialization
    • new pull parser implementation
    • TZInfo support
    • easy Time support
  • 19-nov-2010: v0.9.9 is out.
  • 16-sep-2010: v0.9.8 is out.

The Simple Declarative Language provides an easy way to describe lists, maps, and trees of typed data in a compact, easy to read and type-aware representation. For property files, configuration files, logs, and simple serialization requirements, SDL provides a compelling alternative to XML and Properties files.

SDL?

SDL uses a syntax based on tags (like XML) to represent structured data.

SDL is type-aware:
  • unicode strings,
  • numbers (including big decimals),
  • booleans,
  • dates,
  • datetimes,
  • time spans (e.g. 12:14:42 for 12 hours, 14 minutes and 42 seconds),
  • binary (base 64)
  • null.

More information about the SDL language there: Language Guide.

Installation

gem install sdl4r
Alternatively, you can get the source from Ikayzo.
SDL4R has been tested on Ruby (1.8.7, 1.9.1, 1.9.2) and JRuby (1.5.6 --1.8).

Licence

GNU Lesser General Public License version 2.1

Source Version Control

For now, the source code is hosted by Ikayzo. If it is necessary, we'll manage an anonymous access. You'll find the whole project in the source archive.

Extras

Contact

Don't hesitate to send your comments to
# SDL Example

folder "myFiles" color="yellow" protection=on {
    folder "my images" {
        file "myHouse.jpg" color=true date=2005/11/05
        file "myCar.jpg" color=false date=2002/01/05
    }
    folder "my documents" {
        document "resume.pdf" size=2953 \
            timestamp=1989/8/12 15:23:12.234-JST
    }
}

Basic Usage:
require 'sdl4r'

top = SDL4R::load(<<-EOS)
  food name="chili con carne" {
    ingredient "beans"
    ingredient "chili"
    ingredient "cheese"
    score 8.9
  }
EOS

puts top.food.name # >> "chili con carne"
puts top.food.ingredient # >> ["beans", "chili", "cheese"]
puts top.food.score # >> 8.9

Generated with the excellent Nanoc. Last update: 2010-12-26 23:23:03