diff options
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/lib/active_support.rb | 4 | ||||
-rw-r--r-- | activesupport/test/message_encryptor_test.rb | 2 | ||||
-rw-r--r-- | activesupport/test/notifications_test.rb | 2 | ||||
-rw-r--r-- | activesupport/test/secure_random_test.rb | 10 |
4 files changed, 10 insertions, 8 deletions
diff --git a/activesupport/lib/active_support.rb b/activesupport/lib/active_support.rb index a846f81c12..63830d721a 100644 --- a/activesupport/lib/active_support.rb +++ b/activesupport/lib/active_support.rb @@ -21,6 +21,8 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #++ +require 'securerandom' + module ActiveSupport class << self attr_accessor :load_all_hooks @@ -30,7 +32,7 @@ module ActiveSupport self.load_all_hooks = [] on_load_all do - [Dependencies, Deprecation, Gzip, MessageVerifier, Multibyte, SecureRandom] + [Dependencies, Deprecation, Gzip, MessageVerifier, Multibyte] end end diff --git a/activesupport/test/message_encryptor_test.rb b/activesupport/test/message_encryptor_test.rb index 419ac14283..e45d5ecd59 100644 --- a/activesupport/test/message_encryptor_test.rb +++ b/activesupport/test/message_encryptor_test.rb @@ -11,7 +11,7 @@ require 'active_support/time' class MessageEncryptorTest < Test::Unit::TestCase def setup - @encryptor = ActiveSupport::MessageEncryptor.new(ActiveSupport::SecureRandom.hex(64)) + @encryptor = ActiveSupport::MessageEncryptor.new(SecureRandom.hex(64)) @data = { :some => "data", :now => Time.local(2010) } end diff --git a/activesupport/test/notifications_test.rb b/activesupport/test/notifications_test.rb index 7b48b3f85b..cc0dc564f7 100644 --- a/activesupport/test/notifications_test.rb +++ b/activesupport/test/notifications_test.rb @@ -215,7 +215,7 @@ module Notifications protected def random_id - @random_id ||= ActiveSupport::SecureRandom.hex(10) + @random_id ||= SecureRandom.hex(10) end end end diff --git a/activesupport/test/secure_random_test.rb b/activesupport/test/secure_random_test.rb index 44694cd811..799ac2a87b 100644 --- a/activesupport/test/secure_random_test.rb +++ b/activesupport/test/secure_random_test.rb @@ -2,18 +2,18 @@ require 'abstract_unit' class SecureRandomTest < Test::Unit::TestCase def test_random_bytes - b1 = ActiveSupport::SecureRandom.random_bytes(64) - b2 = ActiveSupport::SecureRandom.random_bytes(64) + b1 = SecureRandom.random_bytes(64) + b2 = SecureRandom.random_bytes(64) assert_not_equal b1, b2 end def test_hex - b1 = ActiveSupport::SecureRandom.hex(64) - b2 = ActiveSupport::SecureRandom.hex(64) + b1 = SecureRandom.hex(64) + b2 = SecureRandom.hex(64) assert_not_equal b1, b2 end def test_random_number - assert ActiveSupport::SecureRandom.random_number(5000) < 5000 + assert SecureRandom.random_number(5000) < 5000 end end |