public
Description: parsing xen's .xen files for reading and writing
Homepage:
Clone URL: git://github.com/atmos/dot_xen.git
atmos (author)
Tue Oct 21 23:56:25 -0700 2008
commit  c035c3cfcdeff3c0441fb931eec85b53e892d822
tree    528057a3f4d73f21add2578a09077684dc6cd77d
parent  46e22416b375725e757658bd0d51e0c4fd553b2d parent  afbab49775e8a92192b693069015a23d994c7bdd
name age message
file LICENSE Loading commit data...
file README
file Rakefile
file TODO
file dot_xen.gemspec
directory lib/
directory script/
directory spec/
README
dot_xen
=======

A gem that provides reading and writing of xen files

Usage
=====

mpro% irb            
>> require 'lib/dot_xen'
=> true
>> puts XenConfigFile::Parser.new.simple_parse(File.read("spec/fixtures/ey00-s00348.xen")).to_s
#  -*- mode: python; -*-
kernel = "/boot/vmlinuz-2.6.18-xenU"
memory = 712
maxmem = 4096
name = "ey00-s00348"
vif = [ "bridge=xenbr0" ]
root = "/dev/sda1 ro"
vcpus = 1
cpu_cap = 100
disk = [ 
         "phy:/dev/ey00-data4/root-s00348,sda1,w",
         "phy:/dev/ey00-data4/swap-s00348,sda2,w",
         "phy:/dev/ey00-data4/gfs-00218,sdb1,w!",
         ]
=> nil


There's two parts to this

The .simple_parse traverses the tree and builds the representation using the models in lib/xen/ast.rb.  It'll return nil 
if the document is invalid.