Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions railties/lib/rails/commands/secret/secret_command.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# frozen_string_literal: true

module Rails
module Command
class SecretCommand < Base # :nodoc:
desc "secret", "Generate a cryptographically secure secret key (this is typically used to generate a secret for cookie sessions)."
def perform
require "securerandom"
puts SecureRandom.hex(64)
end
end
end
end
6 changes: 0 additions & 6 deletions railties/lib/rails/tasks/misc.rake
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
# frozen_string_literal: true

desc "Generate a cryptographically secure secret key (this is typically used to generate a secret for cookie sessions)."
task :secret do
require "securerandom"
puts SecureRandom.hex(64)
end

desc "List versions of all Rails frameworks and the environment"
task about: :environment do
puts Rails::Info
Expand Down