Skip to content
A flavour of XML for storing and retrieveing records in a Polyrex hierarchy
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib
MIT-LICENSE
README.md
gem-public_cert.pem
polyrex.gemspec
test_polyrex.rb
testdata_polyrex.xml

README.md

#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}
You can’t perform that action at this time.