ruby-changes:45820
From: naruse <ko1@a...>
Date: Sun, 12 Mar 2017 16:34:47 +0900 (JST)
Subject: [ruby-changes:45820] naruse:r57893 (ruby_2_4): merge revision(s) 57515: [Backport #13169]
naruse 2017-03-12 16:34:42 +0900 (Sun, 12 Mar 2017) New Revision: 57893 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=57893 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_4/ Modified files: branches/ruby_2_4/lib/ostruct.rb branches/ruby_2_4/test/ostruct/test_ostruct.rb branches/ruby_2_4/version.h Index: ruby_2_4/test/ostruct/test_ostruct.rb =================================================================== --- ruby_2_4/test/ostruct/test_ostruct.rb (revision 57892) +++ ruby_2_4/test/ostruct/test_ostruct.rb (revision 57893) @@ -141,6 +141,7 @@ class TC_OpenStruct < Test::Unit::TestCa https://github.com/ruby/ruby/blob/trunk/ruby_2_4/test/ostruct/test_ostruct.rb#L141 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_4/version.h =================================================================== --- ruby_2_4/version.h (revision 57892) +++ ruby_2_4/version.h (revision 57893) @@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_4/version.h#L1 #define RUBY_VERSION "2.4.0" #define RUBY_RELEASE_DATE "2017-03-12" -#define RUBY_PATCHLEVEL 50 +#define RUBY_PATCHLEVEL 51 #define RUBY_RELEASE_YEAR 2017 #define RUBY_RELEASE_MONTH 3 Index: ruby_2_4/lib/ostruct.rb =================================================================== --- ruby_2_4/lib/ostruct.rb (revision 57892) +++ ruby_2_4/lib/ostruct.rb (revision 57893) @@ -130,6 +130,7 @@ class OpenStruct https://github.com/ruby/ruby/blob/trunk/ruby_2_4/lib/ostruct.rb#L130 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_4 ___________________________________________________________________ Modified: svn:mergeinfo Merged /trunk:r57515 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/