YAXML Parser allows to convert YAXML files to YAML files or JSON expressions. It permits reverse conversion, from YAML files and JSON expressions to YAXML files. This parser is based on the XML Binding for YAML proposed by YAML.org http://yaml.org/xml.html
= YAXML Module
YAXML Parser allows to convert YAXML files to YAML files or JSON expressions. It also permits reverse conversion, from YAML files and JSON expressions to YAXML files. This parser is based on the XML Binding for YAML proposed by YAML.org http://yaml.org/xml.html
This code is released under LGPL. YAXML module makes the following conversions:
And everywhere you can use a file or a string as source.
The module can be used in two ways:
Creating a Yaxml object
xml = Yaxml.new ‘file.yml’
xml.write( $stdout, 2)
xml.to_json
xml.to_yaml
Using static methods of Yaxml module
xml = Yaxml::yaml2yaxml( ‘file.yml’ )
xml.write( $stdout, 2)
Furthermore, you can use:
xml = Yaxml::json2yaxml( { numbers: [ 1, 2, 3 ]} )
yaml = Yaxml::yaxml2yaml( ‘file.yaxml’ )
json = Yaxml::yaxml2json( ‘file.yaxml’ )
YAXML is a standalone library. It requires no other libraries. Just Ruby!
Author:: Diego Moreno (dmoreno AT dit.upm.es)
License:: GNU Lesser General Public License (aka LGPL)
== Installing YAXML
You may get the latest stable version from Rubyforge.
$ gem install yaxml
== Loading YAXML
You do have probably got the gem, right? To load YAXML:
require ‘rubygems’
require ‘yaxml’
== Documentation
You can see the documentation in the project home page:
{YAXML Gem Homepage}[http://yaxml.rubyforge.org]
== Source Code
You can clone the repository from GitHub (http://github.com/dmoreno/yaxml/tree/master):