XML-registry store keys and values in a hierarchical format within an XML file.
Ruby
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
MIT-LICENSE
README.md
gem-public_cert.pem
xml-registry.gemspec

README.md

Introducing the xml-registry gem

Installation

gem install xml-registry

Example

require 'xml-registry' 

s =<<REG
[app/app1]
"admin"="jrobertson"
"pin-no"="1234"

[app/app2]
"admin"="dsmith"
"pin-no"="4321"
REG

reg = XMLRegistry.new 
reg.set_key 'app/whiteboard/colour', 'red' 
reg.to_xml 
#=> "red" 

reg.import s 
reg.to_xml

output:

<root>
  <system/>
  <app>
    <whiteboard>
      <colour>red</colour>
    </whiteboard>
    <app1>
      <admin>jrobertson</admin>
      <pin-no>1234</pin-no>
    </app1>
    <app2>
      <admin>dsmith</admin>
      <pin-no>4321</pin-no>
    </app2>
  </app>
</root>

puts reg.export 

output:

[app/whiteboard]
"colour"="red"

[app/app1]
"admin"="jrobertson"
"pin-no"="1234"

[app/app2]
"admin"="dsmith"
"pin-no"="4321"