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

ruby-changes:46107

From: nagachika <ko1@a...>
Date: Tue, 28 Mar 2017 01:55:24 +0900 (JST)
Subject: [ruby-changes:46107] nagachika:r58178 (ruby_2_3): merge revision(s) 57515: [Backport #13169]

nagachika	2017-03-28 01:55:20 +0900 (Tue, 28 Mar 2017)

  New Revision: 58178

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

  Log:
    merge revision(s) 57515: [Backport #13169]
    
    lib/ostruct.rb: Fix returned value of each_pair.
    
    From a patch by Marcus Stollsteimer. [Fixes #13169]

  Modified directories:
    branches/ruby_2_3/
  Modified files:
    branches/ruby_2_3/lib/ostruct.rb
    branches/ruby_2_3/test/ostruct/test_ostruct.rb
    branches/ruby_2_3/version.h
Index: ruby_2_3/version.h
===================================================================
--- ruby_2_3/version.h	(revision 58177)
+++ ruby_2_3/version.h	(revision 58178)
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_3/version.h#L1
 #define RUBY_VERSION "2.3.3"
 #define RUBY_RELEASE_DATE "2017-03-28"
-#define RUBY_PATCHLEVEL 287
+#define RUBY_PATCHLEVEL 288
 
 #define RUBY_RELEASE_YEAR 2017
 #define RUBY_RELEASE_MONTH 3
Index: ruby_2_3/test/ostruct/test_ostruct.rb
===================================================================
--- ruby_2_3/test/ostruct/test_ostruct.rb	(revision 58177)
+++ ruby_2_3/test/ostruct/test_ostruct.rb	(revision 58178)
@@ -140,6 +140,7 @@ class TC_OpenStruct < Test::Unit::TestCa https://github.com/ruby/ruby/blob/trunk/ruby_2_3/test/ostruct/test_ostruct.rb#L140
   def test_each_pair
     h = {name: "John Smith", age: 70, pension: 300}
     os = OpenStruct.new(h)
+    assert_same os, os.each_pair{ }
     assert_equal '#<Enumerator: #<OpenStruct name="John Smith", age=70, pension=300>:each_pair>', os.each_pair.inspect
     assert_equal [[:name, "John Smith"], [:age, 70], [:pension, 300]], os.each_pair.to_a
     assert_equal 3, os.each_pair.size
Index: ruby_2_3/lib/ostruct.rb
===================================================================
--- ruby_2_3/lib/ostruct.rb	(revision 58177)
+++ ruby_2_3/lib/ostruct.rb	(revision 58178)
@@ -134,6 +134,7 @@ class OpenStruct https://github.com/ruby/ruby/blob/trunk/ruby_2_3/lib/ostruct.rb#L134
   def each_pair
     return to_enum(__method__) { @table.size } unless block_given?
     @table.each_pair{|p| yield p}
+    self
   end
 
   #

Property changes on: ruby_2_3
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r57515


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

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