Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

50 lines (39 sloc) 0.779 kb
require 'rexml/document'
require 'rexml/streamlistener'
require 'Addon'
include REXML
class WoWInterfaceListener
include REXML::StreamListener
def initialize(raw_xml, name)
@raw_xml = raw_xml
@current_element = nil
@current_addon = nil
@name = name
end
def get_addons
Document.parse_stream( @raw_xml, self)
@current_addon
end
def tag_start(name, attributes)
case name
when 'Current'
@current_addon = Addon.new
@current_addon.name = @name;
else
@current_element = name
end
end
def text(text)
case @current_element
when 'UIFileURL'
if @current_addon then
@current_addon.url = text
end
when 'UIVersion'
if @current_addon then
@current_addon.remote_version = text
end
end
@current_element = nil
end
end
Jump to Line
Something went wrong with that request. Please try again.