Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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
@jonleighton jonleighton authored
View
6 activesupport/CHANGELOG
@@ -1,5 +1,11 @@
+*Rails 3.2.0 (unreleased)*
+
+* Removed ActiveSupport::SecureRandom in favour of SecureRandom from the standard library [Jon Leighton]
+
*Rails 3.1.0 (unreleased)*
+* Deprecated ActiveSupport::SecureRandom in favour of SecureRandom from the standard library [Jon Leighton]
+
* New reporting method Kernel#quietly. [fxn]
* Add String#inquiry as a convenience method for turning a string into a StringInquirer object [DHH]
View
1  activesupport/lib/active_support.rb
@@ -70,7 +70,6 @@ module ActiveSupport
autoload :OrderedHash
autoload :OrderedOptions
autoload :Rescuable
- autoload :SecureRandom
autoload :StringInquirer
autoload :XmlMini
end
View
1  activesupport/lib/active_support/notifications/instrumenter.rb
@@ -1,4 +1,3 @@
-require 'active_support/secure_random'
require 'active_support/core_ext/module/delegation'
module ActiveSupport
View
6 activesupport/lib/active_support/secure_random.rb
@@ -1,6 +0,0 @@
-require 'securerandom'
-
-module ActiveSupport
- # Use Ruby's SecureRandom library.
- SecureRandom = ::SecureRandom # :nodoc:
-end
View
19 activesupport/test/secure_random_test.rb
@@ -1,19 +0,0 @@
-require 'abstract_unit'
-
-class SecureRandomTest < Test::Unit::TestCase
- def test_random_bytes
- b1 = SecureRandom.random_bytes(64)
- b2 = SecureRandom.random_bytes(64)
- assert_not_equal b1, b2
- end
-
- def test_hex
- b1 = SecureRandom.hex(64)
- b2 = SecureRandom.hex(64)
- assert_not_equal b1, b2
- end
-
- def test_random_number
- assert SecureRandom.random_number(5000) < 5000
- end
-end
View
2  railties/lib/rails/generators/app_base.rb
@@ -1,5 +1,5 @@
require 'digest/md5'
-require 'active_support/secure_random'
+require 'securerandom'
require 'active_support/core_ext/string/strip'
require 'rails/version' unless defined?(Rails::VERSION)
require 'rbconfig'
View
2  railties/lib/rails/tasks/misc.rake
@@ -9,7 +9,7 @@ end
desc 'Generate a cryptographically secure secret key (this is typically used to generate a secret for cookie sessions).'
task :secret do
- require 'active_support/secure_random'
+ require 'securerandom'
puts SecureRandom.hex(64)
end
Please sign in to comment.
Something went wrong with that request. Please try again.