From 26c14846d25274ee62f2318945eb128420412d8c Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 25 Apr 2010 17:26:36 +1000 Subject: [PATCH] Make db console work for all versions of ruby on Windows. --- railties/lib/rails/commands/dbconsole.rb | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/railties/lib/rails/commands/dbconsole.rb b/railties/lib/rails/commands/dbconsole.rb index 68982b9..8957f11 100644 --- a/railties/lib/rails/commands/dbconsole.rb +++ b/railties/lib/rails/commands/dbconsole.rb @@ -1,6 +1,7 @@ require 'erb' require 'yaml' require 'optparse' +require 'rbconfig' module Rails class DBConsole @@ -41,7 +42,7 @@ module Rails def find_cmd(*commands) dirs_on_path = ENV['PATH'].to_s.split(File::PATH_SEPARATOR) - commands += commands.map{|cmd| "#{cmd}.exe"} if RUBY_PLATFORM =~ /win32/ + commands += commands.map{|cmd| "#{cmd}.exe"} if Config::CONFIG['host_os'] =~ /mswin|mingw/ full_path_command = nil found = commands.detect do |cmd| -- 1.6.5.1.1367.gcd48