jstdutil 0.3.3 → 0.3.4

Sign up to get free protection for your applications and to get access to all the features.
data/Changelog CHANGED
@@ -1,3 +1,10 @@
1
+ == 0.3.4 / 2010-10-31
2
+ * Xavier Vergés helped improve Windows support
3
+ * Proper Windows platform detection for ANSI colors
4
+ (ideas from Matt Mower <self@mattmower.com>)
5
+ * Brighter colors
6
+ * JSTESTDRIVER_HOME is properly set on Windows
7
+
1
8
  == 0.3.3 / 2010-10-16
2
9
  * Remove "clever" argument handling
3
10
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.3
1
+ 0.3.4
data/lib/jstdutil.rb CHANGED
@@ -14,7 +14,8 @@ module Jstdutil
14
14
  # Also checks current working directory
15
15
  #
16
16
  def self.jar(classpath = ENV["JSTESTDRIVER_HOME"] || Dir.pwd)
17
- files = Dir.glob(File.join(classpath, 'jstest*.jar'), File::FNM_CASEFOLD)
17
+ files = Dir.glob(File.expand_path(File.join(classpath, 'jstest*.jar')),
18
+ File::FNM_CASEFOLD)
18
19
  files.sort! { |f1, f2| f1.downcase <=> f2.downcase }
19
20
 
20
21
  if !files || !files.first
@@ -1,18 +1,18 @@
1
- begin
2
- require 'Win32/Console/ANSI' if PLATFORM =~ /win32/
3
- rescue LoadError
4
- raise 'You must gem install win32console to use color on Windows'
5
- rescue NameError
6
- # PLATFORM is not defined, not a problem on windows.
7
- # On other platforms we don't care
1
+ if RUBY_PLATFORM =~ /mswin/i || RUBY_PLATFORM =~ /mingw/i || RUBY_PLATFORM =~ /bccwin/i || RUBY_PLATFORM =~ /wince/i
2
+ begin
3
+ require 'Win32/Console/ANSI'
4
+ rescue LoadError
5
+ raise 'You must gem install win32console to use color on Windows'
6
+ end
8
7
  end
8
+
9
9
  module Jstdutil
10
10
  class RedGreen
11
11
  # Borrowed from the ruby redgreen gem
12
12
  # Not included as a gem dependency since it drags in Test::Unit
13
13
  # and friends, which is overkill for our situation
14
14
  module Color
15
- COLORS = { :clear => 0, :red => 31, :green => 32, :yellow => 33 }
15
+ COLORS = { :clear => 0, :red => 91, :green => 92, :yellow => 93 }
16
16
 
17
17
  def self.method_missing(color_name, *args)
18
18
  color(color_name) + args.first + color(:clear)
@@ -18,7 +18,7 @@ class JstdutilCliTest < Test::Unit::TestCase
18
18
  end
19
19
  end
20
20
 
21
- assert_equal "", stdout
21
+ assert_match /^\n?$/, stdout
22
22
  end
23
23
  end
24
24
  end
@@ -4,13 +4,16 @@ class RedGreenTest < Test::Unit::TestCase
4
4
  context "adding pretty colors" do
5
5
 
6
6
  should "wrap in green" do
7
- assert_equal "\e[32mtrees\e[0m", Jstdutil::RedGreen::Color.green("trees")
7
+ assert_equal "\e[92mtrees\e[0m", Jstdutil::RedGreen::Color.green("trees")
8
8
  end
9
9
 
10
10
  should "wrap in red" do
11
- assert_equal "\e[31mdress\e[0m", Jstdutil::RedGreen::Color.red("dress")
11
+ assert_equal "\e[91mdress\e[0m", Jstdutil::RedGreen::Color.red("dress")
12
12
  end
13
13
 
14
+ should "wrap in yellow" do
15
+ assert_equal "\e[93mdress\e[0m", Jstdutil::RedGreen::Color.yellow("dress")
16
+ end
14
17
  end
15
18
 
16
19
  context "wrapping report" do
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jstdutil
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
4
+ hash: 27
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 3
10
- version: 0.3.3
9
+ - 4
10
+ version: 0.3.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Christian Johansen
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-10-16 00:00:00 +02:00
18
+ date: 2010-10-31 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency