aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2015-01-07 14:46:47 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2015-01-07 14:50:19 +0900
commit92b19006a7ca74fadd9702b1db0642b257bf3327 (patch)
tree95e9eec5c4913d69e3282672aaf247904f60670c
parent5d28c6b5b8407abf9274f78502d387c98f209286 (diff)
downloadrails-92b19006a7ca74fadd9702b1db0642b257bf3327.tar.gz
rails-92b19006a7ca74fadd9702b1db0642b257bf3327.tar.bz2
rails-92b19006a7ca74fadd9702b1db0642b257bf3327.zip
Use EXEEXT
Use the configured variable EXEEXT, instead of hardcoded suffix and platform names. And on such platforms, files which do not end with the suffix are not executable, so the original names are not necessary, in general.
-rw-r--r--railties/lib/rails/commands/dbconsole.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/railties/lib/rails/commands/dbconsole.rb b/railties/lib/rails/commands/dbconsole.rb
index 0d8b3de0eb..3f313c1d8c 100644
--- a/railties/lib/rails/commands/dbconsole.rb
+++ b/railties/lib/rails/commands/dbconsole.rb
@@ -172,7 +172,9 @@ module Rails
commands = Array(commands)
dirs_on_path = ENV['PATH'].to_s.split(File::PATH_SEPARATOR)
- commands += commands.map{|cmd| "#{cmd}.exe"} if RbConfig::CONFIG['host_os'] =~ /mswin|mingw/
+ unless (ext = RbConfig::CONFIG['EXEEXT']).empty?
+ commands = commands.map{|cmd| "#{cmd}#{ext}"}
+ end
full_path_command = nil
found = commands.detect do |cmd|