Skip to content

Commit

Permalink
Better platform detection (works with old mswin32 Ruby, new MinGW Rub…
Browse files Browse the repository at this point in the history
…yInstaller, JRuby and IronRuby). Also require win32console gem if on Windows, but fail gracefully if it's not installed.
  • Loading branch information
Charles Roper committed Feb 20, 2010
1 parent f5aaf65 commit 15e3da2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/autotest.rb
Expand Up @@ -72,7 +72,7 @@ def options;@@options;end

HOOKS = Hash.new { |h,k| h[k] = [] } #unfound keys are []
unless defined? WINDOZE then
WINDOZE = /win32/ =~ RUBY_PLATFORM
WINDOZE = /mswin|mingw|windows/ =~ Config::CONFIG['host_os']
SEP = WINDOZE ? '&' : ';'
end

Expand Down Expand Up @@ -112,6 +112,10 @@ def self.add_discovery &proc
#
def self.autodiscover
require 'rubygems'
begin
require 'win32console' if WINDOZE
rescue LoadError
end

Gem.find_files("autotest/discover").each do |f|
load f
Expand Down

0 comments on commit 15e3da2

Please sign in to comment.