Permalink
Browse files

use SecureRandom if available, fixes #2

  • Loading branch information...
1 parent cf3ecdb commit e696320f89939fb2e566ec453583ab4de39f67d0 @grosser committed Apr 29, 2012
@@ -1 +1,2 @@
-UrlStore.defaults = {:secret => '<%= ActiveSupport::SecureRandom.hex(16) %>'}
+<% generator = (defined?(SecureRandom) ? SecureRandom : ActiveSupport::SecureRandom) -%>
+UrlStore.defaults = {:secret => '<%= generator.hex(16) %>'}
View
@@ -1,5 +1,4 @@
class UrlStore::Railtie < ::Rails::Railtie
-
generators do
require 'url_store/generators/initializer'
end
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../spec_helper'
+require "spec_helper"
describe UrlStore::CompactEncoder do
before do

0 comments on commit e696320

Please sign in to comment.