diff options
author | unknown <agrimm@.(none)> | 2010-04-25 17:26:36 +1000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2010-04-26 10:57:44 -0700 |
commit | e813ad2a42549e308a69fd9473f1b9ed531a0d7e (patch) | |
tree | 89d50b1bdf54f4f9f67a57a5ab4754a8173a4018 /railties | |
parent | 176fbfd66fe500ddfd04ffeb08ed014e705a82f9 (diff) | |
download | rails-e813ad2a42549e308a69fd9473f1b9ed531a0d7e.tar.gz rails-e813ad2a42549e308a69fd9473f1b9ed531a0d7e.tar.bz2 rails-e813ad2a42549e308a69fd9473f1b9ed531a0d7e.zip |
Make db console work for all versions of ruby on Windows.
[#3999 state:committed]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
Diffstat (limited to 'railties')
-rw-r--r-- | 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 68982b9f52..8957f11724 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| |