Permalink
Browse files

Fixed broken console handling on Windows/JRuby that was introduced in…

… 0.6.0.
  • Loading branch information...
1 parent 6411bfe commit f39992ed06f19be040d0f1a2fa6303b307332dcb @aslakhellesoy aslakhellesoy committed Jan 3, 2010
Showing with 21 additions and 10 deletions.
  1. +5 −0 History.txt
  2. +2 −2 VERSION.yml
  3. +2 −2 cucumber.gemspec
  4. +1 −1 lib/cucumber/formatter/ansicolor.rb
  5. +11 −5 lib/cucumber/formatter/unicode.rb
View
@@ -1,3 +1,8 @@
+== 0.6.1 2010-01-03
+
+=== Bugfixes
+* Fixed broken console handling on Windows/JRuby that was introduced in 0.6.0. (Aslak Hellesøy)
+
== 0.6.0 2010-01-03
Bumping to 0.6.0 for this release since we're breaking backwards compatibility with tags.
View
@@ -1,5 +1,5 @@
---
-:patch: 0
+:patch: 1
:build:
:major: 0
-:minor: 7
+:minor: 6
View
@@ -5,7 +5,7 @@
Gem::Specification.new do |s|
s.name = %q{cucumber}
- s.version = "0.6.0"
+ s.version = "0.6.1"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Aslak Helles\303\270y"]
@@ -547,7 +547,7 @@ Gem::Specification.new do |s|
(::) U P G R A D I N G (::)
-Thank you for installing cucumber-0.6.0.
+Thank you for installing cucumber-0.6.1.
Please be sure to read http://wiki.github.com/aslakhellesoy/cucumber/upgrading
for important information about this release. Happy cuking!
@@ -18,7 +18,7 @@
end
end
-Term::ANSIColor.coloring = false if !STDOUT.tty? and not ENV.has_key?("AUTOTEST")
+Term::ANSIColor.coloring = false if !STDOUT.tty? && !ENV.has_key?("AUTOTEST")
module Cucumber
module Formatter
@@ -4,9 +4,15 @@
$KCODE='u' unless Cucumber::RUBY_1_9
if Cucumber::WINDOWS
+ if Cucumber::WINDOWS_MRI
+ Cucumber::CODEPAGE = "cp#{Win32::Console::OutputCP()}"
+ elsif `cmd /c chcp` =~ /(\d+)/
+ Cucumber::CODEPAGE = "cp#{$1.to_i}"
+ else
+ raise "Cucumber couldn't detect the output codepage"
+ end
+
require 'iconv'
- require 'Win32/Console/ANSI'
- Cucumber::CODEPAGE = "cp#{Win32::Console::OutputCP()}"
module Cucumber
module WindowsOutput #:nodoc:
@@ -32,9 +38,9 @@ def puts(*a)
end
end
- Kernel.extend(self) if STDOUT.tty?
- STDOUT.extend(self) if STDOUT.tty?
- STDERR.extend(self) if STDERR.tty?
+ Kernel.extend(self)
+ STDOUT.extend(self)
+ STDERR.extend(self)
end
end
end

0 comments on commit f39992e

Please sign in to comment.