diff options
author | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-03-02 06:19:18 +0000 |
---|---|---|
committer | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-03-02 06:19:18 +0000 |
commit | a2845a44f82f23bd42cb5752f5f8cecdc88bf21b (patch) | |
tree | 14ab7cacb8a31b8cf2c9f1a984fc40d92f19dab9 /lib | |
parent | d8e3a924111fe46c93a7fc9c0fa00d579ff5ec1c (diff) | |
download | ruby-a2845a44f82f23bd42cb5752f5f8cecdc88bf21b.tar.gz |
* lib/xmlrpc.rb: Removed broken parser named XMLScanStreamParser.
It's not works with current Ruby version.
[fix GH-1271][ruby-core:59588][Bug #9369]
* lib/xmlrpc/config.rb: ditto.
* lib/xmlrpc/parser.rb: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53981 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/xmlrpc.rb | 3 | ||||
-rw-r--r-- | lib/xmlrpc/config.rb | 1 | ||||
-rw-r--r-- | lib/xmlrpc/parser.rb | 72 |
3 files changed, 1 insertions, 75 deletions
diff --git a/lib/xmlrpc.rb b/lib/xmlrpc.rb index c581efee7c..94d93a18b9 100644 --- a/lib/xmlrpc.rb +++ b/lib/xmlrpc.rb @@ -56,9 +56,6 @@ # * REXML (XMLParser::REXMLStreamParser) # * Not compiled (pure ruby) # * See ruby standard library -# * xml-scan (XMLParser::XMLScanStreamParser) -# * Not compiled (pure ruby) -# * See https://rubygems.org/gems/xmlscan # * libxml (LibXMLStreamParser) # * Compiled # * See https://rubygems.org/gems/libxml-ruby/ diff --git a/lib/xmlrpc/config.rb b/lib/xmlrpc/config.rb index 8c6ffc68ef..b7ed7a9f71 100644 --- a/lib/xmlrpc/config.rb +++ b/lib/xmlrpc/config.rb @@ -14,7 +14,6 @@ module XMLRPC # :nodoc: # === Available parsers # # * XMLParser::REXMLStreamParser - # * XMLParser::XMLScanStreamParser # * XMLParser::LibXMLStreamParser DEFAULT_PARSER = XMLParser::REXMLStreamParser diff --git a/lib/xmlrpc/parser.rb b/lib/xmlrpc/parser.rb index 7b11710d37..a58da33720 100644 --- a/lib/xmlrpc/parser.rb +++ b/lib/xmlrpc/parser.rb @@ -592,75 +592,6 @@ module XMLRPC # :nodoc: end - class XMLScanStreamParser < AbstractStreamParser - def initialize - require "xmlscan/parser" - @parser_class = XMLScanParser - end - - class XMLScanParser - include StreamParserMixin - - Entities = { - "lt" => "<", - "gt" => ">", - "amp" => "&", - "quot" => '"', - "apos" => "'" - } - - def parse(str) - parser = XMLScan::XMLParser.new(self) - parser.parse(str) - end - - alias :on_stag :startElement - alias :on_etag :endElement - - def on_stag_end(name); end - - def on_stag_end_empty(name) - startElement(name) - endElement(name) - end - - def on_chardata(str) - character(str) - end - - def on_cdata(str) - character(str) - end - - def on_entityref(ent) - str = Entities[ent] - if str - character(str) - else - raise "unknown entity" - end - end - - def on_charref(code) - character(code.chr) - end - - def on_charref_hex(code) - character(code.chr) - end - - def method_missing(*a) - end - - # TODO: call/implement? - # valid_name? - # valid_chardata? - # valid_char? - # parse_error - - end - end - class LibXMLStreamParser < AbstractStreamParser def initialize require 'libxml' @@ -692,8 +623,7 @@ module XMLRPC # :nodoc: end end - Classes = [REXMLStreamParser, XMLScanStreamParser, - LibXMLStreamParser] + Classes = [REXMLStreamParser, LibXMLStreamParser] # yields an instance of each installed parser def self.each_installed_parser |