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 +7 -0
- data/VERSION +1 -1
- data/lib/jstdutil.rb +2 -1
- data/lib/jstdutil/redgreen.rb +8 -8
- data/test/jstestdriver_test.rb +1 -1
- data/test/redgreen_test.rb +5 -2
- metadata +4 -4
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.
|
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'),
|
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
|
data/lib/jstdutil/redgreen.rb
CHANGED
@@ -1,18 +1,18 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
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 =>
|
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)
|
data/test/jstestdriver_test.rb
CHANGED
data/test/redgreen_test.rb
CHANGED
@@ -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[
|
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[
|
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:
|
4
|
+
hash: 27
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 3
|
9
|
-
-
|
10
|
-
version: 0.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-
|
18
|
+
date: 2010-10-31 00:00:00 +02:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|