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

ruby-changes:16287

From: wyhaines <ko1@a...>
Date: Thu, 10 Jun 2010 22:53:42 +0900 (JST)
Subject: [ruby-changes:16287] Ruby:r28255 (ruby_1_8_6): lib/uri/generic.rb: Backport #2428 ; fixed #eql? so that it can handle being passed a nil value.

wyhaines	2010-06-10 22:53:27 +0900 (Thu, 10 Jun 2010)

  New Revision: 28255

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=28255

  Log:
    lib/uri/generic.rb: Backport #2428 [ruby-core:27019]; fixed #eql? so that it can handle being passed a nil value.
    test/generic/test_generic.rb: added a test for the fix to #eql?.

  Modified files:
    branches/ruby_1_8_6/ChangeLog
    branches/ruby_1_8_6/lib/uri/generic.rb
    branches/ruby_1_8_6/test/uri/test_generic.rb
    branches/ruby_1_8_6/version.h

Index: ruby_1_8_6/ChangeLog
===================================================================
--- ruby_1_8_6/ChangeLog	(revision 28254)
+++ ruby_1_8_6/ChangeLog	(revision 28255)
@@ -1,8 +1,13 @@
+Thu Jun 10 22:50:00 Kirk Haines <khaines@r...>
+
+	* lib/uri/generic.rb: Backport #2428 [ruby-core:27019]; fixed #eql? so that it can handle being passed a nil value.
+	* test/generic/test_generic.rb: added a test for the fix to #eql?.
+
 Thu Jun 10 06:46:00 Kirk Haines <khaines@r...>
 
-	* ext/nkf/nkf-utf8/nkf.c: Backport #2953 [ruby-dev:40606]; change nkf_char buffer in numchar_getc() size form 8 to 10 to avoid potential for a segfault.
+	* ext/nkf/nkf-utf8/nkf.c: Backport #2953 [ruby-dev:40606]; change nkf_char buffer in numchar_getc() size form 8 to 10 to avoid potential for a segfault. r28242
 
-	* test/nkf/test_nkf.rb: Added a test for the change.
+	* test/nkf/test_nkf.rb: Added a test for the change. r28242
 
 Thu Jun 10 01:40:00 Kirk Haines <khaines@r...>
 
Index: ruby_1_8_6/version.h
===================================================================
--- ruby_1_8_6/version.h	(revision 28254)
+++ ruby_1_8_6/version.h	(revision 28255)
@@ -2,7 +2,7 @@
 #define RUBY_RELEASE_DATE "2010-06-10"
 #define RUBY_VERSION_CODE 186
 #define RUBY_RELEASE_CODE 20100610
-#define RUBY_PATCHLEVEL 413
+#define RUBY_PATCHLEVEL 414
 
 #define RUBY_VERSION_MAJOR 1
 #define RUBY_VERSION_MINOR 8
Index: ruby_1_8_6/lib/uri/generic.rb
===================================================================
--- ruby_1_8_6/lib/uri/generic.rb	(revision 28254)
+++ ruby_1_8_6/lib/uri/generic.rb	(revision 28255)
@@ -1054,6 +1054,7 @@
     end
 
     def eql?(oth)
+      self.class == oth.class &&
       self.component_ary.eql?(oth.component_ary)
     end
 
Index: ruby_1_8_6/test/uri/test_generic.rb
===================================================================
--- ruby_1_8_6/test/uri/test_generic.rb	(revision 28254)
+++ ruby_1_8_6/test/uri/test_generic.rb	(revision 28255)
@@ -692,6 +692,14 @@
     assert_raises(URI::InvalidURIError) { uri.path = 'bar' }
     assert_raises(URI::InvalidURIError) { uri.query = 'bar' }
   end
+
+  def test_eql
+    require 'uri'
+    uri = URI.parse 'http://gemcutter.org'
+
+    assert_equal(false,uri.eql?(nil))  # => blows up prior to the bug fix for Backport #2428 [ruby-core:27019]
+  end
+
 end
 
 

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

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