mvidner/ruby-dbus — pull request #24 by geoffyoungs (2012-06-15 13:33:50+00:00)
Title: Abstract XML parsing to support multiple backends; Add nokogiri support

I find in desktop applications that introspection of DBUS can make an app feel much more sluggish than it needs to - and switching out REXML and replacing it with Nokogiri makes a noticeable difference.

Here's a patch that adds a minimal abstraction layer for the XML parsing.

It uses Nokogiri by default (if it can be loaded).
It falls back to REXML if Nokogiri isn't/can't be loaded.
It allows the developer to select the backend using:
DBus::IntrospectXMLParser.backend = DBus::IntrospectXMLParser::NokogiriParser
or
DBus::IntrospectXMLParser.backend = DBus::IntrospectXMLParser::REXMLParser

and comes with a simple test file which test introspection using each backend.