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

ruby-changes:57276

From: usa <ko1@a...>
Date: Tue, 27 Aug 2019 00:14:06 +0900 (JST)
Subject: [ruby-changes:57276] usa: 7cdacb99ad (ruby_2_5): merge revision(s) 5bab1304af25a843728dbcd2f3594913740aecb0: [Backport #15847]

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

From 7cdacb99ad17c859dc701843bd37d49412305716 Mon Sep 17 00:00:00 2001
From: usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>
Date: Mon, 26 Aug 2019 15:13:49 +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_5@67762 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

diff --git a/lib/securerandom.rb b/lib/securerandom.rb
index 6d5520f..e263245 100644
--- a/lib/securerandom.rb
+++ b/lib/securerandom.rb
@@ -63,6 +63,7 @@ module SecureRandom https://github.com/ruby/ruby/blob/trunk/lib/securerandom.rb#L63
             class << self
               remove_method :gen_random
               alias gen_random gen_random_openssl
+              public :gen_random
             end
           end
           return gen_random(n)
@@ -72,6 +73,7 @@ module SecureRandom https://github.com/ruby/ruby/blob/trunk/lib/securerandom.rb#L73
           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 f9096b5..522a552 100644
--- a/version.h
+++ b/version.h
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/version.h#L1
 #define RUBY_VERSION "2.5.6"
 #define RUBY_RELEASE_DATE "2019-08-27"
-#define RUBY_PATCHLEVEL 180
+#define RUBY_PATCHLEVEL 181
 
 #define RUBY_RELEASE_YEAR 2019
 #define RUBY_RELEASE_MONTH 8
-- 
cgit v0.10.2


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

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