Low commit activity in last 3 years
No release in over a year
Query the registry using objects built dynamically from a string which maps each object to a registry key.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

~> 0.5, >= 0.5.0
~> 1.4, >= 1.4.0
 Project Readme

Introducing the XML Registry Objects gem

require 'xmlregistry_objects'


s =<<REG
app/app1
admin: jrobertson
pin_no: 1234

app/app2
admin: dsmith
pin_no: 4321

hkey_network/thinclient
active: false
name: niko2

hkey_apps/email
new: true
last_received: 20-Aug-2014 @ 09:10

hkey_apps/suntimes
sunrise: 05:45
sunset: 08:43
REG

reg = XMLRegistry.new 
reg.import s

# the following nested list maps the registry key with 
#                                        associated object and attributes
list = <<EOF
thinclient = [hkey_network/thinclient]
  active? = Bool active
  name = name
email = [hkey_apps/email]
  new? = Bool new
  last_received = last_received
suntimes = [hkey_apps/suntimes]
  sunrise = sunrise
  sunset = sunset
EOF
 

h = XMLRegistryObjects.new(reg,list).to_h

h [:email].last_received  #=> "20-Aug-2014 @ 09:10" 

thinclient = h[:thinclient]
thinclient.name     #=> "niko2" 
thinclient.active?  #=> false 

The above example shows hows objects can easily be contructed to query the XML registry.

The XML Registry Objects gem 2.0.0

require 'xmlregistry_objects'


s =<<REG
app/app1
admin: jrobertson
pin_no: 1234

app/app2
admin: dsmith
pin_no: 4321

hkey_network/thinclient
active: false
name: niko2

hkey_apps/email
new: true
last_received: 20-Aug-2014 @ 09:10

hkey_apps/suntimes
sunrise: 05:45
sunset: 08:43
REG

reg = XMLRegistry.new 
reg.import s

# the following nested list maps the registry key with 
#                                        associated object and attributes
list = <<EOF
thinclient = [hkey_network/thinclient]
  active? = Bool active
  name = name
email = [hkey_apps/email]
  new? = Bool new
  recent = last_received
sun = [hkey_apps/suntimes]
EOF
 

h = XMLRegistryObjects.new(reg,list).to_h

h[:sun].sunset      #=> "08:43" 
h[:email].recent    #=> "20-Aug-2014 @ 09:10" 
h[:thinclient].name #=> "niko2"

Resources

xmlregistry xmlregistry_objects gem