diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2015-01-07 14:46:47 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2015-01-07 14:50:19 +0900 |
commit | 92b19006a7ca74fadd9702b1db0642b257bf3327 (patch) | |
tree | 95e9eec5c4913d69e3282672aaf247904f60670c /railties/lib | |
parent | 5d28c6b5b8407abf9274f78502d387c98f209286 (diff) | |
download | rails-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.
Diffstat (limited to 'railties/lib')
-rw-r--r-- | railties/lib/rails/commands/dbconsole.rb | 4 |
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| |