ruby-changes:51913
From: usa <ko1@a...>
Date: Mon, 30 Jul 2018 23:00:19 +0900 (JST)
Subject: [ruby-changes:51913] usa:r64127 (ruby_2_4): merge revision(s) 63112: [Backport #14818]
usa 2018-07-30 23:00:13 +0900 (Mon, 30 Jul 2018) New Revision: 64127 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=64127 Log: merge revision(s) 63112: [Backport #14818] Remove outdated example from Numeric documentation Since 2.5, Numeric instances can be cloned and duplicated. [Fix GH-1850] From: Miguel Landaeta <miguel@m...> Modified directories: branches/ruby_2_4/ Modified files: branches/ruby_2_4/numeric.c branches/ruby_2_4/version.h Index: ruby_2_4/numeric.c =================================================================== --- ruby_2_4/numeric.c (revision 64126) +++ ruby_2_4/numeric.c (revision 64127) @@ -5179,10 +5179,11 @@ int_truncate(int argc, VALUE* argv, VALU https://github.com/ruby/ruby/blob/trunk/ruby_2_4/numeric.c#L5179 * puts 1.object_id == a.object_id #=> true * * There can only ever be one instance of the integer +1+, for example. Ruby ensures this - * by preventing instantiation and duplication. + * by preventing instantiation. If duplication is attempted, the same instance is returned. * - * Integer.new(1) #=> NoMethodError: undefined method `new' for Integer:Class - * 1.dup #=> TypeError: can't dup Integer + * Integer.new(1) #=> NoMethodError: undefined method `new' for Integer:Class + * 1.dup #=> 1 + * 1.object_id == 1.dup.object_id #=> true * * For this reason, Numeric should be used when defining other numeric classes. * Index: ruby_2_4/version.h =================================================================== --- ruby_2_4/version.h (revision 64126) +++ ruby_2_4/version.h (revision 64127) @@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_4/version.h#L1 #define RUBY_VERSION "2.4.5" #define RUBY_RELEASE_DATE "2018-07-30" -#define RUBY_PATCHLEVEL 307 +#define RUBY_PATCHLEVEL 308 #define RUBY_RELEASE_YEAR 2018 #define RUBY_RELEASE_MONTH 7 Index: ruby_2_4 =================================================================== --- ruby_2_4 (revision 64126) +++ ruby_2_4 (revision 64127) Property changes on: ruby_2_4 ___________________________________________________________________ Modified: svn:mergeinfo ## -0,0 +0,1 ## Merged /trunk:r63112 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/