ruby-changes:46029
From: usa <ko1@a...>
Date: Sun, 26 Mar 2017 01:35:29 +0900 (JST)
Subject: [ruby-changes:46029] usa:r58100 (ruby_2_2): merge revision(s) 57515: [Backport #13169]
usa 2017-03-26 01:35:25 +0900 (Sun, 26 Mar 2017) New Revision: 58100 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=58100 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_2/ Modified files: branches/ruby_2_2/lib/ostruct.rb branches/ruby_2_2/test/ostruct/test_ostruct.rb branches/ruby_2_2/version.h Index: ruby_2_2/lib/ostruct.rb =================================================================== --- ruby_2_2/lib/ostruct.rb (revision 58099) +++ ruby_2_2/lib/ostruct.rb (revision 58100) @@ -127,6 +127,7 @@ class OpenStruct https://github.com/ruby/ruby/blob/trunk/ruby_2_2/lib/ostruct.rb#L127 def each_pair return to_enum(__method__) { @table.size } unless block_given? @table.each_pair{|p| yield p} + self end # Index: ruby_2_2/test/ostruct/test_ostruct.rb =================================================================== --- ruby_2_2/test/ostruct/test_ostruct.rb (revision 58099) +++ ruby_2_2/test/ostruct/test_ostruct.rb (revision 58100) @@ -111,6 +111,7 @@ class TC_OpenStruct < Test::Unit::TestCa https://github.com/ruby/ruby/blob/trunk/ruby_2_2/test/ostruct/test_ostruct.rb#L111 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_2/version.h =================================================================== --- ruby_2_2/version.h (revision 58099) +++ ruby_2_2/version.h (revision 58100) @@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_2/version.h#L1 #define RUBY_VERSION "2.2.7" #define RUBY_RELEASE_DATE "2017-03-26" -#define RUBY_PATCHLEVEL 432 +#define RUBY_PATCHLEVEL 433 #define RUBY_RELEASE_YEAR 2017 #define RUBY_RELEASE_MONTH 3 Property changes on: ruby_2_2 ___________________________________________________________________ Modified: svn:mergeinfo Merged /trunk:r57515 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/