[jdev] ruby xmppd, and Psi

Norman Rasmussen norman at rasmussen.co.za
Thu Sep 18 09:56:31 CDT 2008


(IANARC - I am not a ruby coder), here's another attempt:
   resp = Base64.decode64(elem.text)
   resp = resp.match(/(\w+\s*=\s*(?:(?:"[^"]+")|(?:[^,]+)))/)

   response = {}
   resp.captures do |kv|
       k, v = kv.split('=',2)
       v.gsub!(/^"(.*)"$/, '\1')

       response[k] = v

   end

-- 
- Norman Rasmussen
- Email: norman at rasmussen.co.za
- Home page: http://norman.rasmussen.co.za/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.jabber.org/jdev/attachments/20080918/c9490ca7/attachment-0002.htm>


More information about the JDev mailing list