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

ruby-changes:56754

From: nagachika <ko1@a...>
Date: Thu, 1 Aug 2019 22:18:49 +0900 (JST)
Subject: [ruby-changes:56754] nagachika: a451d5d303 (ruby_2_6): merge revision(s) 5bab1304af25a843728dbcd2f3594913740aecb0: [Backport #15847]

https://git.ruby-lang.org/ruby.git/commit/?id=a451d5d303

From a451d5d303459e26f5d55f6a5a8a08492f98e849 Mon Sep 17 00:00:00 2001
From: nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>
Date: Thu, 1 Aug 2019 13:18:27 +0000
Subject: merge revision(s) 5bab1304af25a843728dbcd2f3594913740aecb0: [Backport
 #15847]

	fix visibility of SecureRandom.gen_random

	Aliasing a method preserves its visibility.  These aliases turn
	formerly-public methods into private.  Should make them public
	again.  [Bug #15847]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_6@67723 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

diff --git a/lib/securerandom.rb b/lib/securerandom.rb
index 470b48d..d01b474 100644
--- a/lib/securerandom.rb
+++ b/lib/securerandom.rb
@@ -68,6 +68,7 @@ module SecureRandom https://github.com/ruby/ruby/blob/trunk/lib/securerandom.rb#L68
             class << self
               remove_method :gen_random
               alias gen_random gen_random_openssl
+              public :gen_random
             end
           end
           return gen_random(n)
@@ -77,6 +78,7 @@ module SecureRandom https://github.com/ruby/ruby/blob/trunk/lib/securerandom.rb#L78
           class << self
             remove_method :gen_random
             alias gen_random gen_random_urandom
+            public :gen_random
           end
         end
         return gen_random(n)
diff --git a/test/test_securerandom.rb b/test/test_securerandom.rb
index 69d24c0..1bc35f9 100644
--- a/test/test_securerandom.rb
+++ b/test/test_securerandom.rb
@@ -184,4 +184,11 @@ end https://github.com/ruby/ruby/blob/trunk/test/test_securerandom.rb#L184
       assert_equal(idx, @it.send(:gen_random_openssl, idx).size)
     end
   end
+
+  def test_repeated_gen_random
+    assert_nothing_raised NoMethodError, '[ruby-core:92633] [Bug #15847]' do
+      @it.gen_random(1)
+      @it.gen_random(1)
+    end
+  end
 end
diff --git a/version.h b/version.h
index a8e3b29..6b0afc6 100644
--- a/version.h
+++ b/version.h
@@ -1,10 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/version.h#L1
 #define RUBY_VERSION "2.6.3"
 #define RUBY_RELEASE_DATE RUBY_RELEASE_YEAR_STR"-"RUBY_RELEASE_MONTH_STR"-"RUBY_RELEASE_DAY_STR
-#define RUBY_PATCHLEVEL 73
+#define RUBY_PATCHLEVEL 74
 
 #define RUBY_RELEASE_YEAR 2019
-#define RUBY_RELEASE_MONTH 7
-#define RUBY_RELEASE_DAY 31
+#define RUBY_RELEASE_MONTH 8
+#define RUBY_RELEASE_DAY 1
 
 #include "ruby/version.h"
 
-- 
cgit v0.10.2


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

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