aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/commands/secrets/secrets_command.rb
diff options
context:
space:
mode:
Diffstat (limited to 'railties/lib/rails/commands/secrets/secrets_command.rb')
-rw-r--r--railties/lib/rails/commands/secrets/secrets_command.rb14
1 files changed, 9 insertions, 5 deletions
diff --git a/railties/lib/rails/commands/secrets/secrets_command.rb b/railties/lib/rails/commands/secrets/secrets_command.rb
index 651411d444..45e02fa730 100644
--- a/railties/lib/rails/commands/secrets/secrets_command.rb
+++ b/railties/lib/rails/commands/secrets/secrets_command.rb
@@ -1,5 +1,5 @@
require "active_support"
-require "rails/secrets"
+require_relative "../../secrets"
module Rails
module Command
@@ -31,7 +31,7 @@ module Rails
require_application_and_environment!
Rails::Secrets.read_for_editing do |tmp_path|
- system("\$EDITOR #{tmp_path}")
+ system("#{ENV["EDITOR"]} #{tmp_path}")
end
say "New secrets encrypted and saved."
@@ -43,15 +43,19 @@ module Rails
raise unless error.message =~ /secrets\.yml\.enc/
Rails::Secrets.read_template_for_editing do |tmp_path|
- system("\$EDITOR #{tmp_path}")
+ system("#{ENV["EDITOR"]} #{tmp_path}")
generator.skip_secrets_file { setup }
end
end
+ def show
+ say Rails::Secrets.read
+ end
+
private
def generator
- require "rails/generators"
- require "rails/generators/rails/encrypted_secrets/encrypted_secrets_generator"
+ require_relative "../../generators"
+ require_relative "../../generators/rails/encrypted_secrets/encrypted_secrets_generator"
Rails::Generators::EncryptedSecretsGenerator
end