Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/atmos/dot_xen
parsing xen's .xen files for reading and writing
https://github.com/atmos/dot_xen
Last synced: 3 months ago
JSON representation
parsing xen's .xen files for reading and writing
- Host: GitHub
- URL: https://github.com/atmos/dot_xen
- Owner: atmos
- License: mit
- Created: 2008-06-28T19:31:04.000Z (over 16 years ago)
- Default Branch: master
- Last Pushed: 2008-10-22T07:01:11.000Z (about 16 years ago)
- Last Synced: 2024-04-15T13:59:30.851Z (9 months ago)
- Language: Ruby
- Homepage:
- Size: 105 KB
- Stars: 12
- Watchers: 5
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README
- License: LICENSE
Awesome Lists containing this project
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!",
]
=> nilThere'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.