Skip to content
This repository
Browse code

Removed ActiveSupport::SecureRandom in favour of SecureRandom from th…

…e standard library. (It has been deprecated in the 3-1-stable branch.)
  • Loading branch information...
commit 1170cceaaec8c0c8aef173913405be1456e4b2be 1 parent d411c85
Jon Leighton authored May 23, 2011
6  activesupport/CHANGELOG
... ...
@@ -1,5 +1,11 @@
  1
+*Rails 3.2.0 (unreleased)*
  2
+
  3
+* Removed ActiveSupport::SecureRandom in favour of SecureRandom from the standard library [Jon Leighton]
  4
+
1 5
 *Rails 3.1.0 (unreleased)*
2 6
 
  7
+* Deprecated ActiveSupport::SecureRandom in favour of SecureRandom from the standard library [Jon Leighton]
  8
+
3 9
 * New reporting method Kernel#quietly. [fxn]
4 10
 
5 11
 * Add String#inquiry as a convenience method for turning a string into a StringInquirer object [DHH]
1  activesupport/lib/active_support.rb
@@ -70,7 +70,6 @@ module ActiveSupport
70 70
     autoload :OrderedHash
71 71
     autoload :OrderedOptions
72 72
     autoload :Rescuable
73  
-    autoload :SecureRandom
74 73
     autoload :StringInquirer
75 74
     autoload :XmlMini
76 75
   end
1  activesupport/lib/active_support/notifications/instrumenter.rb
... ...
@@ -1,4 +1,3 @@
1  
-require 'active_support/secure_random'
2 1
 require 'active_support/core_ext/module/delegation'
3 2
 
4 3
 module ActiveSupport
6  activesupport/lib/active_support/secure_random.rb
... ...
@@ -1,6 +0,0 @@
1  
-require 'securerandom'
2  
-
3  
-module ActiveSupport
4  
-  # Use Ruby's SecureRandom library.
5  
-  SecureRandom = ::SecureRandom # :nodoc:
6  
-end
19  activesupport/test/secure_random_test.rb
... ...
@@ -1,19 +0,0 @@
1  
-require 'abstract_unit'
2  
-
3  
-class SecureRandomTest < Test::Unit::TestCase
4  
-  def test_random_bytes
5  
-    b1 = SecureRandom.random_bytes(64)
6  
-    b2 = SecureRandom.random_bytes(64)
7  
-    assert_not_equal b1, b2
8  
-  end
9  
-
10  
-  def test_hex
11  
-    b1 = SecureRandom.hex(64)
12  
-    b2 = SecureRandom.hex(64)
13  
-    assert_not_equal b1, b2
14  
-  end
15  
-
16  
-  def test_random_number
17  
-    assert SecureRandom.random_number(5000) < 5000
18  
-  end
19  
-end
2  railties/lib/rails/generators/app_base.rb
... ...
@@ -1,5 +1,5 @@
1 1
 require 'digest/md5'
2  
-require 'active_support/secure_random'
  2
+require 'securerandom'
3 3
 require 'active_support/core_ext/string/strip'
4 4
 require 'rails/version' unless defined?(Rails::VERSION)
5 5
 require 'rbconfig'
2  railties/lib/rails/tasks/misc.rake
@@ -9,7 +9,7 @@ end
9 9
 
10 10
 desc 'Generate a cryptographically secure secret key (this is typically used to generate a secret for cookie sessions).'
11 11
 task :secret do
12  
-  require 'active_support/secure_random'
  12
+  require 'securerandom'
13 13
   puts SecureRandom.hex(64)
14 14
 end
15 15
 

0 notes on commit 1170cce

Please sign in to comment.
Something went wrong with that request. Please try again.