From 92b19006a7ca74fadd9702b1db0642b257bf3327 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Wed, 7 Jan 2015 14:46:47 +0900 Subject: 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. --- railties/lib/rails/commands/dbconsole.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'railties') 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| -- cgit v1.2.3