[前][次][番号順一覧][スレッド一覧]

ruby-changes:41907

From: hsbt <ko1@a...>
Date: Wed, 2 Mar 2016 15:19:23 +0900 (JST)
Subject: [ruby-changes:41907] hsbt:r53981 (trunk): * lib/xmlrpc.rb: Removed broken parser named XMLScanStreamParser.

hsbt	2016-03-02 15:19:18 +0900 (Wed, 02 Mar 2016)

  New Revision: 53981

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=53981

  Log:
    * 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.

  Modified files:
    trunk/ChangeLog
    trunk/lib/xmlrpc/config.rb
    trunk/lib/xmlrpc/parser.rb
    trunk/lib/xmlrpc.rb
Index: lib/xmlrpc/parser.rb
===================================================================
--- lib/xmlrpc/parser.rb	(revision 53980)
+++ lib/xmlrpc/parser.rb	(revision 53981)
@@ -592,75 +592,6 @@ module XMLRPC # :nodoc: https://github.com/ruby/ruby/blob/trunk/lib/xmlrpc/parser.rb#L592
 
     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: https://github.com/ruby/ruby/blob/trunk/lib/xmlrpc/parser.rb#L623
       end
     end
 
-    Classes = [REXMLStreamParser, XMLScanStreamParser,
-               LibXMLStreamParser]
+    Classes = [REXMLStreamParser, LibXMLStreamParser]
 
     # yields an instance of each installed parser
     def self.each_installed_parser
Index: lib/xmlrpc/config.rb
===================================================================
--- lib/xmlrpc/config.rb	(revision 53980)
+++ lib/xmlrpc/config.rb	(revision 53981)
@@ -14,7 +14,6 @@ module XMLRPC # :nodoc: https://github.com/ruby/ruby/blob/trunk/lib/xmlrpc/config.rb#L14
     # === Available parsers
     #
     # * XMLParser::REXMLStreamParser
-    # * XMLParser::XMLScanStreamParser
     # * XMLParser::LibXMLStreamParser
     DEFAULT_PARSER = XMLParser::REXMLStreamParser
 
Index: lib/xmlrpc.rb
===================================================================
--- lib/xmlrpc.rb	(revision 53980)
+++ lib/xmlrpc.rb	(revision 53981)
@@ -56,9 +56,6 @@ https://github.com/ruby/ruby/blob/trunk/lib/xmlrpc.rb#L56
 #   * 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/
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 53980)
+++ ChangeLog	(revision 53981)
@@ -1,3 +1,11 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Wed Mar  2 15:13:33 2016  herwinw  <herwin@q...>
+
+	* 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.
+
 Wed Mar  2 15:08:33 2016  herwinw  <herwin@q...>
 
 	* lib/xmlrpc.rb: Removed broken parser named XMLTreeParser.

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]