Project

polyrex

0.01
Low commit activity in last 3 years
No release in over a year
A flavour of XML for storing and retrieving records in a Polyrex hierarchy
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

~> 1.10, >= 1.10.0
~> 0.2, >= 0.2.2
~> 0.2, >= 0.2.2
~> 1.0, >= 1.0.3
 Project Readme

#Using Polyrex with embedded YAML

require 'polyrex'

polyrex = Polyrex.new
polyrex.parse File.read('/tmp/px220712T1426.txt')
puts polyrex.to_xml pretty: true

polyrex.records[0].commands
#=> [{"s1"=>"rvm", "s2"=>"sudo rvm"}, {"s1"=>"rvm2", "s2"=>"sudo rvm2"}]

polyrex.find_by_machine_title('toni').storage
#=> ["/", "/media/usb1"]

file px220712T1426.txt:

<?polyrex schema="entries[title,tags,desc]/machine[title]"?>
title: Machines used for remote SSH commands
tags: ssh remote machine
desc: s1 is substituted with s2

amadora
  commands ---
    - {s1: rvm, s2: sudo rvm}  
    - {s1: rvm2, s2: sudo rvm2}      
lucia
toni
  commands ---
    - {s1: rvm, s2: /home/james/.rvm/bin/rvm}
  storage ---
    [/, /media/usb1]
niko
  commands ---
    - {s1: rvm, s2: /home/james/.rvm/bin/rvm}