aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/tasks/misc.rake
blob: e44ab2cf178836941abb48b3a8b4680003a56d20 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
task :default => :test
task :environment do
  require(File.join(RAILS_ROOT, 'config', 'environment'))
end

require 'rails_generator/secret_key_generator'
desc 'Generate a crytographically secure secret key. This is typically used to generate a secret for cookie sessions. Pass a unique identifier to the generator using ID="some unique identifier" for greater security.'
task :secret do
  puts Rails::SecretKeyGenerator.new(ENV['ID']).generate_secret
end