facets 2.0.2 → 2.0.3
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/AUTHORS +3 -3
- data/README +6 -7
- data/lib/core/facets.rb +1 -46
- data/lib/core/facets/array.rb +3 -0
- data/lib/core/facets/array/indexable.rb +6 -1
- data/lib/core/facets/array/only.rb +20 -0
- data/lib/core/facets/dir/multiglob.rb +12 -1
- data/lib/core/facets/enumerable.rb +0 -1
- data/lib/core/facets/enumerable/collect.rb +1 -0
- data/lib/core/facets/enumerable/combination.rb +44 -90
- data/lib/core/facets/facets.rb +46 -0
- data/lib/core/facets/file/write.rb +46 -58
- data/lib/core/facets/hash.rb +2 -0
- data/lib/core/facets/hash/select.rb +14 -0
- data/lib/core/facets/integer/multiples.rb +12 -55
- data/lib/core/facets/kernel/val.rb +14 -0
- data/lib/core/facets/module/alias.rb +28 -9
- data/lib/core/facets/module/methods.rb +18 -0
- data/lib/core/facets/module/traits.rb +65 -70
- data/lib/core/facets/proc/compose.rb +15 -12
- data/lib/core/facets/stackable.rb +3 -2
- data/lib/core/facets/string/format.rb +4 -6
- data/lib/core/facets/string/tabs.rb +34 -0
- data/lib/core/facets/symbol.rb +1 -0
- data/lib/core/facets/symbol/succ.rb +1 -42
- data/lib/core/facets/symbol/to_proc.rb +34 -0
- data/lib/methods/facets/array/contains.rb +1 -0
- data/lib/methods/facets/facets/require_core.rb +1 -0
- data/lib/methods/facets/file/writelines.rb +1 -0
- data/lib/methods/facets/io/writelines.rb +1 -0
- data/lib/methods/facets/kernel/not_nil.rb +1 -0
- data/lib/methods/facets/module/conflict.rb +1 -0
- data/lib/methods/facets/module/instance_method_defined.rb +1 -0
- data/lib/methods/facets/module/module_method_defined.rb +1 -0
- data/lib/methods/facets/module/private_conflict.rb +1 -0
- data/lib/methods/facets/module/protected_conflict.rb +1 -0
- data/lib/methods/facets/module/public_conflict.rb +1 -0
- data/lib/methods/facets/string/expand_tabs.rb +1 -0
- data/lib/methods/facets/string/outdent.rb +1 -0
- data/lib/methods/facets/string/taballto.rb +1 -0
- data/lib/more/facets/arguments.rb +1 -1
- data/lib/more/facets/association.rb +0 -46
- data/lib/more/facets/autoarray.rb +0 -28
- data/lib/more/facets/command.rb +341 -8
- data/lib/more/facets/dictionary.rb +25 -131
- data/lib/more/facets/downloader.rb +1 -1
- data/lib/more/facets/infinity.rb +3 -3
- data/lib/more/facets/interval.rb +0 -161
- data/lib/more/facets/multiton.rb +16 -12
- data/lib/more/facets/namespace.rb +1 -1
- data/lib/more/facets/ostruct.rb +46 -10
- data/lib/more/facets/overload.rb +0 -51
- data/lib/more/facets/paramix.rb +0 -97
- data/lib/more/facets/pp_s.rb +30 -0
- data/lib/more/facets/progressbar.rb +18 -10
- data/lib/more/facets/prototype.rb +1 -40
- data/lib/more/facets/random.rb +1 -0
- data/lib/more/facets/rbsystem.rb +4 -1
- data/lib/more/facets/snapshot.rb +8 -1
- data/lib/more/facets/stylize.rb +2 -0
- data/meta/{project.yaml → facets-2.0.3.roll} +22 -14
- data/meta/manifest.txt +38 -8
- data/task/{config.yaml → config/general.yaml} +7 -2
- data/task/{rdoc.yaml → config/rdoc.yaml} +1 -1
- data/task/crosstest +309 -0
- data/task/isotest +293 -0
- data/task/loadtest +28 -0
- data/task/methods +4 -4
- data/task/prepare +5 -0
- data/task/publish +2 -2
- data/task/rdoc +1 -0
- data/task/syntax +29 -0
- data/task/test +0 -1
- data/task/testeach +42 -0
- data/task/testpairs +50 -0
- data/test/lib/rq.rb +15 -0
- data/test/unit/array/test_merge.rb +21 -43
- data/test/unit/array/test_only.rb +21 -0
- data/test/unit/enumerable/test_collect.rb +1 -21
- data/test/unit/enumerable/test_combination.rb +50 -44
- data/test/unit/file/test_topath.rb +48 -57
- data/test/unit/file/test_write.rb +82 -0
- data/test/unit/hash/test_select.rb +43 -0
- data/test/unit/integer/test_multiples.rb +28 -32
- data/test/unit/kernel/test_report.rb +9 -12
- data/test/unit/kernel/test_val.rb +50 -45
- data/test/unit/module/test_include.rb +56 -57
- data/test/unit/module/test_name.rb +42 -55
- data/test/unit/module/test_traits.rb +46 -47
- data/test/unit/string/test_filter.rb +19 -34
- data/test/unit/string/test_format.rb +87 -96
- data/test/unit/string/test_regesc.rb +18 -26
- data/test/unit/string/test_tabs.rb +226 -119
- data/test/unit/symbol/test_succ.rb +14 -23
- data/test/unit/symbol/test_to_proc.rb +41 -0
- data/test/unit/test_association.rb +38 -47
- data/test/unit/test_attributes.rb +24 -33
- data/test/unit/test_autoarray.rb +23 -32
- data/test/unit/test_command.rb +26 -0
- data/test/unit/test_dictionary.rb +123 -117
- data/test/unit/test_infinity.rb +41 -47
- data/test/unit/test_inheritor.rb +133 -142
- data/test/unit/test_interval.rb +129 -93
- data/test/unit/test_ostruct.rb +148 -101
- data/test/unit/test_overload.rb +8 -15
- data/test/unit/test_paramix.rb +67 -73
- data/test/unit/test_pp_s.rb +23 -0
- data/test/unit/test_prototype.rb +28 -38
- metadata +47 -11
- data/lib/core/facets/enumerable/instance_map.rb +0 -0
- data/lib/more/facets/command_options.rb +0 -328
- data/meta/version.txt +0 -1
- data/task/load +0 -39
- data/test/unit/test_command_options.rb +0 -29
data/task/isotest
ADDED
@@ -0,0 +1,293 @@
|
|
1
|
+
#!/usr/bin/env ratch
|
2
|
+
|
3
|
+
#
|
4
|
+
require 'facets/hash/rekey'
|
5
|
+
require 'facets/string/tabs'
|
6
|
+
require 'facets/progressbar'
|
7
|
+
|
8
|
+
require 'test/unit/ui/testrunnermediator' #require 'test/unit'
|
9
|
+
::Test::Unit.run = true # Don't autorun tests!
|
10
|
+
|
11
|
+
main :isotestsolid do
|
12
|
+
run_isotests
|
13
|
+
end
|
14
|
+
|
15
|
+
# Run unit-tests. Each test is run in a separate interpretor
|
16
|
+
# to prevent script clash. This makes for a more robust test
|
17
|
+
# facility and prevents potential conflicts between test scripts.
|
18
|
+
#
|
19
|
+
# tests Test files (eg. test/tc_**/*.rb) [test/**/*]
|
20
|
+
# libs Directories to include in load path.
|
21
|
+
# ('./lib' is always included)
|
22
|
+
# live Deactive use of local libs and test against install.
|
23
|
+
# reqs List of files to require prior to running tests.
|
24
|
+
# extract Extract embedded tests first? [false]
|
25
|
+
#
|
26
|
+
# To isolate tests this tool marshals test results across a
|
27
|
+
# stdout->stdin shell pipe. This prevents interfence of one
|
28
|
+
# script's tests on another. But consequently it is not always
|
29
|
+
# possible to send debug info to stdout in the tests themselves
|
30
|
+
# (eg. #p and #puts).
|
31
|
+
|
32
|
+
def run_isotests
|
33
|
+
info = configuration['test']
|
34
|
+
|
35
|
+
tests = info['files'] || 'test/unit/**/test_*.rb'
|
36
|
+
libs = info['libpath']
|
37
|
+
reqs = info['require']
|
38
|
+
live = info['live']
|
39
|
+
#extract = info['extract']
|
40
|
+
|
41
|
+
tests = [ tests ].flatten
|
42
|
+
libs = [ libs ].flatten
|
43
|
+
|
44
|
+
#files = [ @files ].flatten
|
45
|
+
#extract_tests if extract
|
46
|
+
|
47
|
+
results = TestResults.new #(style)
|
48
|
+
|
49
|
+
# get test files
|
50
|
+
test_libs = libs.join(':')
|
51
|
+
test_files = Dir.multiglob( *tests )
|
52
|
+
if test_files.empty?
|
53
|
+
puts "Tests [NONE]"
|
54
|
+
return
|
55
|
+
end
|
56
|
+
|
57
|
+
# run tests
|
58
|
+
|
59
|
+
if trace?
|
60
|
+
pbar = nil
|
61
|
+
size = test_files.collect{|f| f.size}.max + 5
|
62
|
+
dots = '.' * size
|
63
|
+
else
|
64
|
+
pbar = Console::ProgressBar.new( 'Testing', test_files.size )
|
65
|
+
pbar.inc
|
66
|
+
end
|
67
|
+
|
68
|
+
test_files.each do |test_file|
|
69
|
+
pbar.inc if pbar
|
70
|
+
if ! File.file?(test_file)
|
71
|
+
next #r = nil
|
72
|
+
else
|
73
|
+
unless pbar
|
74
|
+
print test_file + dots[test_file.size..-1]
|
75
|
+
$stdout.flush
|
76
|
+
end
|
77
|
+
r = fork_test( test_file, :libs=>libs, :reqs=>reqs, :live=>live )
|
78
|
+
unless pbar
|
79
|
+
puts r.passed? ? "[PASS]" : "[FAIL]"
|
80
|
+
end
|
81
|
+
end
|
82
|
+
results << r
|
83
|
+
end
|
84
|
+
|
85
|
+
pbar.finish if pbar
|
86
|
+
|
87
|
+
# display results
|
88
|
+
puts results
|
89
|
+
|
90
|
+
fails, errrs = results.failure_count, results.error_count
|
91
|
+
#CHECKLIST << :test if fails > 0
|
92
|
+
#CHECKLIST << :test if errrs > 0
|
93
|
+
return (fails + errrs > 0)
|
94
|
+
end
|
95
|
+
|
96
|
+
# Run a test in a separate process.
|
97
|
+
#
|
98
|
+
# Currently send program output to null device.
|
99
|
+
# Could send to a logger in future version.
|
100
|
+
#
|
101
|
+
# Key parameters are libs, reqs, live.
|
102
|
+
|
103
|
+
def fork_test( file, keys )
|
104
|
+
keys = keys.rekey(:to_s)
|
105
|
+
|
106
|
+
libs = keys['lib'] || []
|
107
|
+
reqs = keys['req'] || []
|
108
|
+
live = keys['live']
|
109
|
+
|
110
|
+
src = ''
|
111
|
+
|
112
|
+
unless live
|
113
|
+
l = File.join( Dir.pwd, 'lib' )
|
114
|
+
if File.directory?( l )
|
115
|
+
src << %{$:.unshift('#{l}')\n}
|
116
|
+
end
|
117
|
+
libs.each { |r| src << %{$:.unshift('#{r}')\n} }
|
118
|
+
end
|
119
|
+
|
120
|
+
src << %{
|
121
|
+
#require 'test/unit'
|
122
|
+
require 'test/unit/collector'
|
123
|
+
require 'test/unit/collector/objectspace'
|
124
|
+
require 'test/unit/ui/testrunnermediator'
|
125
|
+
}
|
126
|
+
|
127
|
+
reqs.each do |fix|
|
128
|
+
src << %Q{
|
129
|
+
require '#{fix}'
|
130
|
+
}
|
131
|
+
end
|
132
|
+
|
133
|
+
src << %{
|
134
|
+
def warn(*null); end # silence warnings
|
135
|
+
|
136
|
+
output = STDOUT.dup
|
137
|
+
STDOUT.reopen( PLATFORM =~ /mswin/ ? "NUL" : "/dev/null" )
|
138
|
+
|
139
|
+
load('#{file}')
|
140
|
+
tests = Test::Unit::Collector::ObjectSpace.new.collect
|
141
|
+
runner = Test::Unit::UI::TestRunnerMediator.new( tests )
|
142
|
+
result = runner.run_suite
|
143
|
+
|
144
|
+
begin
|
145
|
+
marshalled = Marshal.dump(result)
|
146
|
+
rescue TypeError => e
|
147
|
+
$stderr << "MARSHAL ERROR\n"
|
148
|
+
$stderr << "TEST: #{file}\n"
|
149
|
+
$stderr << "DATA:" << result.inspect
|
150
|
+
exit -1
|
151
|
+
end
|
152
|
+
output << marshalled
|
153
|
+
|
154
|
+
STDOUT.reopen(output)
|
155
|
+
output.close
|
156
|
+
}
|
157
|
+
|
158
|
+
result = IO.popen("ruby","w+") do |ruby|
|
159
|
+
ruby.puts src
|
160
|
+
ruby.close_write
|
161
|
+
ruby.read
|
162
|
+
end
|
163
|
+
|
164
|
+
begin
|
165
|
+
marsh = Marshal.load(result)
|
166
|
+
rescue ArgumentError
|
167
|
+
$stderr << "\nCannot load marshalled test data.\n"
|
168
|
+
$stderr << result << "\n"
|
169
|
+
exit -1
|
170
|
+
end
|
171
|
+
|
172
|
+
return marsh
|
173
|
+
end
|
174
|
+
|
175
|
+
#
|
176
|
+
# Support class for collecting test results.
|
177
|
+
#
|
178
|
+
|
179
|
+
class TestResults
|
180
|
+
attr_reader :assertion_count,
|
181
|
+
:run_count,
|
182
|
+
:failure_count,
|
183
|
+
:error_count
|
184
|
+
|
185
|
+
attr_accessor :style
|
186
|
+
|
187
|
+
def initialize( style=nil )
|
188
|
+
@style = style
|
189
|
+
|
190
|
+
@results = []
|
191
|
+
|
192
|
+
@assertion_count = 0
|
193
|
+
@run_count = 0
|
194
|
+
@failure_count = 0
|
195
|
+
@error_count = 0
|
196
|
+
end
|
197
|
+
|
198
|
+
# Add a result to the results collection.
|
199
|
+
|
200
|
+
def <<( result )
|
201
|
+
@results << result
|
202
|
+
|
203
|
+
@assertion_count += result.assertion_count
|
204
|
+
@run_count += result.run_count
|
205
|
+
@failure_count += result.failure_count
|
206
|
+
@error_count += result.error_count
|
207
|
+
end
|
208
|
+
|
209
|
+
#
|
210
|
+
|
211
|
+
def errors
|
212
|
+
errors = []
|
213
|
+
@results.each do |r|
|
214
|
+
unless r.passed?
|
215
|
+
errors << r.instance_variable_get('@errors')
|
216
|
+
end
|
217
|
+
end
|
218
|
+
errors.reject! { |e| e == [] }
|
219
|
+
errors
|
220
|
+
end
|
221
|
+
|
222
|
+
#
|
223
|
+
|
224
|
+
def failures
|
225
|
+
failures = []
|
226
|
+
@results.each do |r|
|
227
|
+
unless r.passed?
|
228
|
+
failures << r.instance_variable_get('@failures')
|
229
|
+
end
|
230
|
+
end
|
231
|
+
failures.reject! { |e| e == [] }
|
232
|
+
failures
|
233
|
+
end
|
234
|
+
|
235
|
+
# Output format for test results.
|
236
|
+
|
237
|
+
def to_s
|
238
|
+
return @results.to_s if style == 'pease'
|
239
|
+
|
240
|
+
s = []
|
241
|
+
# Display failures
|
242
|
+
unless failures.empty?
|
243
|
+
s << ''
|
244
|
+
s << "FAILURES:"
|
245
|
+
failures.reverse.each do |fails|
|
246
|
+
fails.reverse.each do |failure|
|
247
|
+
#puts
|
248
|
+
s << %{ - test : #{failure.test_name}}
|
249
|
+
s << %{ location : #{failure.location}}
|
250
|
+
if failure.message.index("\n")
|
251
|
+
s << %{ message : >}
|
252
|
+
s << failure.message.tabto(6)
|
253
|
+
else
|
254
|
+
s << %{ message : #{failure.message}}
|
255
|
+
end
|
256
|
+
end
|
257
|
+
end
|
258
|
+
end
|
259
|
+
|
260
|
+
# Display errors
|
261
|
+
unless errors.empty?
|
262
|
+
s << ''
|
263
|
+
s << "ERRORS:"
|
264
|
+
errors.reverse.each do |errs|
|
265
|
+
errs.reverse.each do |err|
|
266
|
+
s << ''
|
267
|
+
s << %{ - test : #{err.test_name}}
|
268
|
+
s << %{ message : #{err.exception.message}}
|
269
|
+
s << %{ backtrace :}
|
270
|
+
err.exception.backtrace[0...-1].each { |bt| s << %Q{ - #{bt}} }
|
271
|
+
end
|
272
|
+
end
|
273
|
+
end
|
274
|
+
|
275
|
+
# Display final results
|
276
|
+
s << ''
|
277
|
+
s << "Summary:"
|
278
|
+
s << " Tests : #{@run_count}"
|
279
|
+
s << " Assertions : #{@assertion_count}"
|
280
|
+
s << " Failures : #{@failure_count}"
|
281
|
+
s << " Errors : #{@error_count}"
|
282
|
+
s << ''
|
283
|
+
s << ''
|
284
|
+
|
285
|
+
return s.join("\n")
|
286
|
+
end
|
287
|
+
|
288
|
+
# Delegate missing call to the results array.
|
289
|
+
|
290
|
+
def method_missing(*a,&b)
|
291
|
+
@results.send(*a,&b)
|
292
|
+
end
|
293
|
+
end
|
data/task/loadtest
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
#!/usr/bin/env ratch
|
2
|
+
|
3
|
+
main :syntax do
|
4
|
+
scripts = "lib/**/*.rb"
|
5
|
+
libpath = [ 'lib/methods', 'lib/core', 'lib/more' ].join(':')
|
6
|
+
|
7
|
+
checklist = []
|
8
|
+
cnt = 0
|
9
|
+
scripts = multiglob(*scripts) #- multiglob_r(ignore)
|
10
|
+
scripts.each do |s|
|
11
|
+
next unless File.file?(s)
|
12
|
+
#if not system "ruby -c -Ibin:lib:test #{s} &> /dev/null" then
|
13
|
+
if r = system "ruby -I#{libpath} #{s} > /dev/null"
|
14
|
+
puts "#{s} [PASS]" #if verbose?
|
15
|
+
else
|
16
|
+
puts "Load Issue: #{s}"
|
17
|
+
checklist << :load
|
18
|
+
cnt += 1
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
if cnt == 0
|
23
|
+
puts "Load dependencies check out."
|
24
|
+
else
|
25
|
+
puts "#{cnt} Load Failures:\n "
|
26
|
+
puts checklist.join("\n ")
|
27
|
+
end
|
28
|
+
end
|
data/task/methods
CHANGED
@@ -17,7 +17,7 @@ require 'facets/module/require'
|
|
17
17
|
config = configuration['methods']
|
18
18
|
|
19
19
|
source = config['source'] # from where
|
20
|
-
|
20
|
+
output = config['output'] # to where
|
21
21
|
ignore = config['ignore'] # classes/modules to ignore
|
22
22
|
|
23
23
|
REDIRECT_WRITE = []
|
@@ -29,7 +29,7 @@ main :methods => [ :generate_redirects, :remove_redirects ] do
|
|
29
29
|
REDIRECT_WRITE.each do |file, klass, meth|
|
30
30
|
meth = meth.chomp('!').chomp('=').chomp('?')
|
31
31
|
meth = op_esc(meth)
|
32
|
-
meth_file = "#{
|
32
|
+
meth_file = "#{output}/#{klass.to_s.downcase}/#{meth}.rb"
|
33
33
|
# if the the redirect has the same name as the original, don't botther.
|
34
34
|
next if file == "facets/#{klass.to_s.downcase}/#{meth}.rb"
|
35
35
|
# create redirection file
|
@@ -49,7 +49,7 @@ end
|
|
49
49
|
# Remove previous redirection directory.
|
50
50
|
|
51
51
|
task :remove_redirects do
|
52
|
-
dst = File.join('lib',
|
52
|
+
dst = File.join('lib', output)
|
53
53
|
rm_r(dst) if dir?(dst) #File.directory?(dst)
|
54
54
|
end
|
55
55
|
|
@@ -63,7 +63,7 @@ task :generate_redirects => [ :neuter_module ] do
|
|
63
63
|
redirect_libs.each do |file|
|
64
64
|
next if dir?(file) #File.directory?(file)
|
65
65
|
|
66
|
-
puts "#{file}
|
66
|
+
puts "#{file}"
|
67
67
|
|
68
68
|
mod = Module.new
|
69
69
|
mod.module_eval do
|
data/task/prepare
ADDED
data/task/publish
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# Publish website to rubyforge
|
4
4
|
#
|
5
|
-
# This task publishes the source dir (deafult 'doc
|
5
|
+
# This task publishes the source dir (deafult 'doc')
|
6
6
|
# to a rubyforge website.
|
7
7
|
|
8
8
|
main :publish do
|
@@ -10,7 +10,7 @@ main :publish do
|
|
10
10
|
|
11
11
|
project = config['project']
|
12
12
|
subdir = config['subdir']
|
13
|
-
source = config['source'] || "doc
|
13
|
+
source = config['source'] || "doc"
|
14
14
|
username = config['username']
|
15
15
|
protect = %w{usage statcvs statsvn robot.txt wiki}
|
16
16
|
exclude = %w{.svn}
|
data/task/rdoc
CHANGED
data/task/syntax
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
#!/usr/bin/env ratch
|
2
|
+
|
3
|
+
main :syntax do
|
4
|
+
scripts = "lib/**/*.rb"
|
5
|
+
libpath = [ 'lib/methods', 'lib/core', 'lib/more' ].join(':')
|
6
|
+
|
7
|
+
checklist = []
|
8
|
+
cnt = 0
|
9
|
+
scripts = multiglob(*scripts) #- multiglob_r(ignore)
|
10
|
+
scripts.each do |s|
|
11
|
+
next unless File.file?(s)
|
12
|
+
#if not system "ruby -c -Ibin:lib:test #{s} &> /dev/null" then
|
13
|
+
r = system "ruby -c -I#{libpath} #{s} > /dev/null"
|
14
|
+
if r
|
15
|
+
puts "#{s} [PASS]" #if verbose?
|
16
|
+
else
|
17
|
+
puts "Syntax Error: #{s}"
|
18
|
+
checklist << :syntax
|
19
|
+
cnt += 1
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
if cnt == 0
|
24
|
+
puts "Syntax checks out."
|
25
|
+
else
|
26
|
+
puts "#{cnt} Syntax Failures:\n "
|
27
|
+
puts checklist.join("\n ")
|
28
|
+
end
|
29
|
+
end
|
data/task/test
CHANGED
data/task/testeach
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
#!/usr/bin/env ratch
|
2
|
+
|
3
|
+
# cross-run unit tests
|
4
|
+
#
|
5
|
+
# This tool runs all tests against each other in pairs
|
6
|
+
# to ensure across the board compatibility.
|
7
|
+
|
8
|
+
require "./lib/more/facets/progressbar"
|
9
|
+
|
10
|
+
main :test do
|
11
|
+
output = 'doc/log/isotest.txt'
|
12
|
+
|
13
|
+
live = ARGV.delete('--live')
|
14
|
+
|
15
|
+
find = 'test/**/test_*.rb'
|
16
|
+
|
17
|
+
tests = Dir.glob(find).reject{ |f| dir?(f) }
|
18
|
+
tests = tests.sort{ |a,b| File.basename(a) <=> File.basename(b) }
|
19
|
+
|
20
|
+
File.open(output, 'w'){ |f|
|
21
|
+
f << "= ISO TESTING\n\n==#{Time.now}\n\n"
|
22
|
+
}
|
23
|
+
|
24
|
+
total = tests.size
|
25
|
+
|
26
|
+
pbar = Console::ProgressBar.new("IsoTest", total+1)
|
27
|
+
pbar.inc
|
28
|
+
|
29
|
+
tests.each do |file|
|
30
|
+
pbar.title = File.basename(file)
|
31
|
+
pbar.inc
|
32
|
+
pbar.flush
|
33
|
+
|
34
|
+
if live
|
35
|
+
sh %{ruby #{file} >> #{output}}
|
36
|
+
else
|
37
|
+
sh %{ruby -Ilib/more -Ilib/core -Ilib/methods #{file} >> #{output}}
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
pbar.finish
|
42
|
+
end
|