This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| msgs = {} | |
| state = nil | |
| id = nil | |
| mqstdout.each_line do |line| | |
| line.strip! | |
| case | |
| when state.nil? && /^(?<msgid>[0-9A-F]+)\s+(?<size>[0-9]+)\s+(?<date>.+[^\s])\s+(?<sender>[^\s]+)$/ =~ line | |
| id = msgid | |
| msgs[id] = { | |
| size: size.to_i, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'rubygems' | |
| # xml-simple has a bug that needs to be fixed before this works, see: | |
| # https://github.com/pdf/xml-simple/commit/b4da34165c88fe912b45af614b326ed512a666c7 | |
| require 'xmlsimple' | |
| # domain1 omits the __value__ key except where required | |
| domain1 = { | |
| "@type"=>"kvm", | |
| "name"=>"demo1", | |
| "uuid"=>"4dea24b3-1d52-d8f3-2516-782e98a23fa1", |
NewerOlder