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

ruby-changes:3711

From: ko1@a...
Date: Thu, 24 Jan 2008 03:54:14 +0900 (JST)
Subject: [ruby-changes:3711] naruse - Ruby:r15200 (trunk): * lib/rexml/text.rb, lib/rubygems/open-uri.rb, lib/open-uri.rb,

naruse	2008-01-24 03:53:52 +0900 (Thu, 24 Jan 2008)

  New Revision: 15200

  Modified files:
    trunk/ChangeLog
    trunk/lib/open-uri.rb
    trunk/lib/rexml/text.rb
    trunk/lib/rubygems/open-uri.rb
    trunk/test/logger/test_logger.rb
    trunk/test/ruby/test_regexp.rb

  Log:
    * lib/rexml/text.rb, lib/rubygems/open-uri.rb, lib/open-uri.rb,
      test/logger/test_logger.rb, test/ruby/test_regexp.rb:
      fix tests. [ruby-dev:33336]

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/lib/rexml/text.rb?r1=15200&r2=15199&diff_format=u
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=15200&r2=15199&diff_format=u
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/test/ruby/test_regexp.rb?r1=15200&r2=15199&diff_format=u
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/lib/open-uri.rb?r1=15200&r2=15199&diff_format=u
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/test/logger/test_logger.rb?r1=15200&r2=15199&diff_format=u
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/lib/rubygems/open-uri.rb?r1=15200&r2=15199&diff_format=u

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 15199)
+++ ChangeLog	(revision 15200)
@@ -1,3 +1,9 @@
+Thu Jan 24 03:47:41 2008  NARUSE, Yui  <naruse@r...>
+
+	* lib/rexml/text.rb, lib/rubygems/open-uri.rb, lib/open-uri.rb,
+	  test/logger/test_logger.rb, test/ruby/test_regexp.rb:
+	  fix tests. [ruby-dev:33336]
+
 Thu Jan 24 03:23:44 2008  Yukihiro Matsumoto  <matz@r...>
 
 	* string.c (rb_str_each_line): use memchr(3) for faster newline
Index: lib/rexml/text.rb
===================================================================
--- lib/rexml/text.rb	(revision 15199)
+++ lib/rexml/text.rb	(revision 15200)
@@ -50,7 +50,7 @@
          |  \xF0[\x90-\xBF][\x80-\xBF]{2}     # planes 1-3
          | [\xF1-\xF3][\x80-\xBF]{3}          # planes 4-15
          |  \xF4[\x80-\x8F][\x80-\xBF]{2}     # plane 16
-       )*$/x; 
+       )*$/nx; 
     end
 
     # Constructor
@@ -139,7 +139,7 @@
             end
           end
         else
-          string.scan(/[\x00-\x7F]|[\x80-\xBF][\xC0-\xF0]*|[\xC0-\xF0]/) do |c|
+          string.scan(/[\x00-\x7F]|[\x80-\xBF][\xC0-\xF0]*|[\xC0-\xF0]/n) do |c|
             case c.unpack('U')
             when *VALID_CHAR
             else
Index: lib/rubygems/open-uri.rb
===================================================================
--- lib/rubygems/open-uri.rb	(revision 15199)
+++ lib/rubygems/open-uri.rb	(revision 15200)
@@ -426,7 +426,7 @@
         subtype = $2.downcase
         parameters = []
         $3.scan(/;#{RE_LWS}?(#{RE_TOKEN})#{RE_LWS}?=#{RE_LWS}?(?:(#{RE_TOKEN})|(#{RE_QUOTED_STRING}))/no) {|att, val, qval|
-          val = qval.gsub(/[\r\n\t !#-\[\]-~\x80-\xff]+|(\\[\x00-\x7f])/) { $1 ? $1[1,1] : $& } if qval
+          val = qval.gsub(/[\r\n\t !#-\[\]-~\x80-\xff]+|(\\[\x00-\x7f])/n) { $1 ? $1[1,1] : $& } if qval
           parameters << [att.downcase, val]
         }
         ["#{type}/#{subtype}", *parameters]
Index: lib/open-uri.rb
===================================================================
--- lib/open-uri.rb	(revision 15199)
+++ lib/open-uri.rb	(revision 15200)
@@ -433,7 +433,7 @@
         subtype = $2.downcase
         parameters = []
         $3.scan(/;#{RE_LWS}?(#{RE_TOKEN})#{RE_LWS}?=#{RE_LWS}?(?:(#{RE_TOKEN})|(#{RE_QUOTED_STRING}))/no) {|att, val, qval|
-          val = qval.gsub(/[\r\n\t !#-\[\]-~\x80-\xff]+|(\\[\x00-\x7f])/) { $1 ? $1[1,1] : $& } if qval
+          val = qval.gsub(/[\r\n\t !#-\[\]-~\x80-\xff]+|(\\[\x00-\x7f])/n) { $1 ? $1[1,1] : $& } if qval
           parameters << [att.downcase, val]
         }
         ["#{type}/#{subtype}", *parameters]
Index: test/logger/test_logger.rb
===================================================================
--- test/logger/test_logger.rb	(revision 15199)
+++ test/logger/test_logger.rb	(revision 15200)
@@ -26,7 +26,7 @@
   class Log
     attr_reader :label, :datetime, :pid, :severity, :progname, :msg
     def initialize(line)
-      /\A(\w+), \[([^#]*)#(\d+)\]\s+(\w+) -- (\w*): ([\x0-\xff]*)/ =~ line
+      /\A(\w+), \[([^#]*)#(\d+)\]\s+(\w+) -- (\w*): ([\x0-\xff]*)/n =~ line
       @label, @datetime, @pid, @severity, @progname, @msg = $1, $2, $3, $4, $5, $6
     end
   end
Index: test/ruby/test_regexp.rb
===================================================================
--- test/ruby/test_regexp.rb	(revision 15199)
+++ test/ruby/test_regexp.rb	(revision 15200)
@@ -8,7 +8,7 @@
   end
 
   def test_ruby_talk_116455
-    assert_match(/^(\w{2,}).* ([A-Za-z\xa2\xc0-\xff]{2,}?)$/, "Hallo Welt")
+    assert_match(/^(\w{2,}).* ([A-Za-z\xa2\xc0-\xff]{2,}?)$/n, "Hallo Welt")
   end
 
   def test_ruby_dev_24887

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

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