leftright 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.rdoc +4 -0
- data/WHATSNEW +6 -0
- data/leftright.gemspec +2 -0
- data/lib/leftright.rb +42 -3
- data/lib/leftright/color.rb +1 -1
- data/lib/leftright/force_tty.rb +6 -0
- data/lib/leftright/tty.rb +6 -0
- data/lib/leftright/version.rb +1 -1
- metadata +19 -5
data/README.rdoc
CHANGED
data/WHATSNEW
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
* 0.0.?
|
2
|
+
- Ignoring certain testcases (like ActionController::IntegrationTest) when
|
3
|
+
calculating the left margin. Does not break if Rails is not present.
|
4
|
+
- Added support for JRuby (using ffi-ncurses instead of stty (Zach Holman))
|
5
|
+
- Added (very basic) tests
|
6
|
+
|
1
7
|
* 0.0.3 (2009-11-03):
|
2
8
|
- Removed 'XMLOBJECT_GEMSPEC' from gemspec (copy & paste gone wrong) :(
|
3
9
|
- Changed the TestCase collector to work like Test::Unit's.
|
data/leftright.gemspec
CHANGED
data/lib/leftright.rb
CHANGED
@@ -3,6 +3,7 @@ require 'test/unit/ui/console/testrunner'
|
|
3
3
|
|
4
4
|
require 'leftright/version' # to open the module
|
5
5
|
|
6
|
+
require 'leftright/tty'
|
6
7
|
require 'leftright/color'
|
7
8
|
require 'leftright/runner'
|
8
9
|
require 'leftright/autorun'
|
@@ -45,6 +46,14 @@ module LeftRight
|
|
45
46
|
found << klass if Test::Unit::TestCase > klass
|
46
47
|
end
|
47
48
|
|
49
|
+
# Rails 2.3.5 defines these, and they cramp up my style.
|
50
|
+
found.reject! { |k| k.to_s == 'ActiveRecord::TestCase' }
|
51
|
+
found.reject! { |k| k.to_s == 'ActionMailer::TestCase' }
|
52
|
+
found.reject! { |k| k.to_s == 'ActionView::TestCase' }
|
53
|
+
found.reject! { |k| k.to_s == 'ActionController::TestCase' }
|
54
|
+
found.reject! { |k| k.to_s == 'ActionController::IntegrationTest' }
|
55
|
+
found.reject! { |k| k.to_s == 'ActiveSupport::TestCase' }
|
56
|
+
|
48
57
|
found
|
49
58
|
end
|
50
59
|
end
|
@@ -72,7 +81,37 @@ module LeftRight
|
|
72
81
|
# Tries to get the terminal width in columns.
|
73
82
|
#
|
74
83
|
def self.terminal_width
|
75
|
-
@terminal_width ||=
|
84
|
+
@terminal_width ||= if RUBY_ENGINE.match 'jruby'
|
85
|
+
ncurses_terminal_width
|
86
|
+
else
|
87
|
+
stty_terminal_width
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
91
|
+
# Uses stty to determine terminal width
|
92
|
+
def self.stty_terminal_width
|
93
|
+
`stty size`.split[-1].to_i
|
94
|
+
rescue
|
95
|
+
0
|
96
|
+
end
|
97
|
+
|
98
|
+
# Uses ffi-ncurses to determine terminal width
|
99
|
+
#
|
100
|
+
def self.ncurses_terminal_width
|
101
|
+
require 'ffi-ncurses'
|
102
|
+
|
103
|
+
begin
|
104
|
+
FFI::NCurses.initscr
|
105
|
+
FFI::NCurses.getmaxyx(FFI::NCurses._initscr).reverse.first.to_i
|
106
|
+
rescue
|
107
|
+
0
|
108
|
+
ensure
|
109
|
+
FFI::NCurses.endwin
|
110
|
+
end
|
111
|
+
rescue LoadError
|
112
|
+
puts %{ Under JRuby, you need to install the 'ffi-ncurses' gem,
|
113
|
+
since `stty` is not available. }.strip.gsub /\s+/, ' '
|
114
|
+
exit 1
|
76
115
|
end
|
77
116
|
|
78
117
|
# Tries to get the left side width in columns.
|
@@ -108,7 +147,7 @@ module LeftRight
|
|
108
147
|
# http://blog.macromates.com/2006/wrapping-text-with-regular-expressions/
|
109
148
|
#
|
110
149
|
def self.wrap(line)
|
111
|
-
return line unless
|
150
|
+
return line unless tty?
|
112
151
|
width = right_side_width - MID_SEPARATOR - RIGHT_MARGIN
|
113
152
|
line.gsub /(.{1,#{width}})( +|$)\n?|(.{#{width}})/, "\\1\\3\n"
|
114
153
|
end
|
@@ -159,7 +198,7 @@ module LeftRight
|
|
159
198
|
# Returns a passing dot, aware of how many to print per-line.
|
160
199
|
#
|
161
200
|
def self.P
|
162
|
-
return '.' unless
|
201
|
+
return '.' unless tty?
|
163
202
|
|
164
203
|
state.dots += 1
|
165
204
|
|
data/lib/leftright/color.rb
CHANGED
data/lib/leftright/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: leftright
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
hash: 23
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 0
|
9
|
+
- 4
|
10
|
+
version: 0.0.4
|
5
11
|
platform: ruby
|
6
12
|
authors:
|
7
13
|
- Jordi Bunster
|
@@ -9,7 +15,7 @@ autorequire:
|
|
9
15
|
bindir: bin
|
10
16
|
cert_chain: []
|
11
17
|
|
12
|
-
date:
|
18
|
+
date: 2010-07-31 00:00:00 -07:00
|
13
19
|
default_executable:
|
14
20
|
dependencies: []
|
15
21
|
|
@@ -30,7 +36,9 @@ files:
|
|
30
36
|
- lib/leftright/autorun.rb
|
31
37
|
- lib/leftright/color.rb
|
32
38
|
- lib/leftright/runner.rb
|
39
|
+
- lib/leftright/tty.rb
|
33
40
|
- lib/leftright/version.rb
|
41
|
+
- lib/leftright/force_tty.rb
|
34
42
|
has_rdoc: true
|
35
43
|
homepage:
|
36
44
|
licenses: []
|
@@ -41,21 +49,27 @@ rdoc_options: []
|
|
41
49
|
require_paths:
|
42
50
|
- lib
|
43
51
|
required_ruby_version: !ruby/object:Gem::Requirement
|
52
|
+
none: false
|
44
53
|
requirements:
|
45
54
|
- - ">="
|
46
55
|
- !ruby/object:Gem::Version
|
56
|
+
hash: 3
|
57
|
+
segments:
|
58
|
+
- 0
|
47
59
|
version: "0"
|
48
|
-
version:
|
49
60
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
61
|
+
none: false
|
50
62
|
requirements:
|
51
63
|
- - ">="
|
52
64
|
- !ruby/object:Gem::Version
|
65
|
+
hash: 3
|
66
|
+
segments:
|
67
|
+
- 0
|
53
68
|
version: "0"
|
54
|
-
version:
|
55
69
|
requirements: []
|
56
70
|
|
57
71
|
rubyforge_project:
|
58
|
-
rubygems_version: 1.3.
|
72
|
+
rubygems_version: 1.3.7
|
59
73
|
signing_key:
|
60
74
|
specification_version: 3
|
61
75
|
summary: Cool replacement for Test::Unit's TestRunner
|