aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib
diff options
context:
space:
mode:
authorKasper Timm Hansen <kaspth@gmail.com>2017-06-11 12:22:39 +0200
committerKasper Timm Hansen <kaspth@gmail.com>2017-06-11 12:22:39 +0200
commitf81f840c02cff34c169e6fca348fab9a372c8372 (patch)
tree8b30b5c14d6274e82b4f79631c79dabc166d04fa /railties/lib
parent52f90044a159559d94b4f597e9d79b44024ed09a (diff)
downloadrails-f81f840c02cff34c169e6fca348fab9a372c8372.tar.gz
rails-f81f840c02cff34c169e6fca348fab9a372c8372.tar.bz2
rails-f81f840c02cff34c169e6fca348fab9a372c8372.zip
Access EDITOR through Ruby's cross-platform ENV.
Fix the mistake of not using Ruby's ENV hash from the get go and get windows support.
Diffstat (limited to 'railties/lib')
-rw-r--r--railties/lib/rails/commands/secrets/secrets_command.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/railties/lib/rails/commands/secrets/secrets_command.rb b/railties/lib/rails/commands/secrets/secrets_command.rb
index 651411d444..5f077a5bcb 100644
--- a/railties/lib/rails/commands/secrets/secrets_command.rb
+++ b/railties/lib/rails/commands/secrets/secrets_command.rb
@@ -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,7 +43,7 @@ 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