Back ported a lot of changes made to the Koans directory.

Evidently, a lot of changes / pull requests were made to the koans
directory and not to the src directory.  Perhaps we should remove the
koans directory entirely from the repo.
This commit is contained in:
Jim Weirich
2011-12-04 02:00:22 -05:00
parent 51acb84736
commit 6592f3d36e
16 changed files with 145 additions and 81 deletions

View File

@@ -2,6 +2,10 @@
# -*- ruby -*-
require 'test/unit/assertions'
begin
require 'win32console'
rescue LoadError
end
# --------------------------------------------------------------------
# Support code for the Ruby Koans.
@@ -107,7 +111,9 @@ module EdgeCase
def use_colors?
return false if ENV['NO_COLOR']
if ENV['ANSI_COLOR'].nil?
! using_windows?
if using_windows?
using_win32console
end
else
ENV['ANSI_COLOR'] =~ /^(t|y)/i
end
@@ -116,6 +122,10 @@ module EdgeCase
def using_windows?
File::ALT_SEPARATOR
end
def using_win32console
defined? Win32::Console
end
end
class Sensei