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

ruby-changes:3863

From: ko1@a...
Date: Thu, 31 Jan 2008 07:12:55 +0900 (JST)
Subject: [ruby-changes:3863] seki - Ruby:r15352 (ruby_1_8): should find a symbol by Symbol class.

seki	2008-01-31 07:12:40 +0900 (Thu, 31 Jan 2008)

  New Revision: 15352

  Modified files:
    branches/ruby_1_8/ChangeLog
    branches/ruby_1_8/lib/rinda/tuplespace.rb
    branches/ruby_1_8/test/rinda/test_rinda.rb

  Log:
    should find a symbol by Symbol class.

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8/ChangeLog?r1=15352&r2=15351&diff_format=u
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8/lib/rinda/tuplespace.rb?r1=15352&r2=15351&diff_format=u
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8/test/rinda/test_rinda.rb?r1=15352&r2=15351&diff_format=u

Index: ruby_1_8/ChangeLog
===================================================================
--- ruby_1_8/ChangeLog	(revision 15351)
+++ ruby_1_8/ChangeLog	(revision 15352)
@@ -1,3 +1,10 @@
+Thu Jan 31 07:00:19 2008  Masatoshi SEKI  <m_seki@m...>
+
+	* lib/rinda/tuplespace.rb (bin_for_find): should find a symbol by
+	  Symbol class.
+
+	* test/rinda/test_rinda.rb (test_symbol_tuple): ditto.
+
 Wed Jan 30 22:07:58 2008  Tadayoshi Funaba  <tadf@d...>
 
 	* lib/date.rb: refined deprecated methods.
Index: ruby_1_8/lib/rinda/tuplespace.rb
===================================================================
--- ruby_1_8/lib/rinda/tuplespace.rb	(revision 15351)
+++ ruby_1_8/lib/rinda/tuplespace.rb	(revision 15352)
@@ -411,7 +411,8 @@
     end
 
     def bin_for_find(template)
-      @hash.fetch(bin_key(template), @enum)
+      key = bin_key(template)
+      key ? @hash.fetch(key, []) : @enum
     end
   end
 
Index: ruby_1_8/test/rinda/test_rinda.rb
===================================================================
--- ruby_1_8/test/rinda/test_rinda.rb	(revision 15351)
+++ ruby_1_8/test/rinda/test_rinda.rb	(revision 15352)
@@ -253,6 +253,14 @@
     end
   end
 
+  def test_symbol_tuple
+    @ts.write([:symbol, :symbol])
+    @ts.write(['string', :string])
+    assert_equal([[:symbol, :symbol]], @ts.read_all([:symbol, nil]))
+    assert_equal([[:symbol, :symbol]], @ts.read_all([Symbol, nil]))
+    assert_equal([], @ts.read_all([:nil, nil]))
+  end
+
   def test_core_01
     5.times do |n|
       @ts.write([:req, 2])

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

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