relevance-rcov 0.8.3.2 → 0.8.3.3

Sign up to get free protection for your applications and to get access to all the features.
data/BLURB CHANGED
@@ -1,10 +1,3 @@
1
-
2
- Source code, additional information, screenshots... available at
3
- http://eigenclass.org/hiki/rcov
4
-
5
- If you're on win32, you can also find a pre-built rcovrt.so (which makes
6
- code coverage analysis >100 times faster) in the above-mentioned pages.
7
-
8
1
  Overview
9
2
  ========
10
3
  rcov is a code coverage tool for Ruby. It is commonly used for viewing overall
@@ -48,8 +41,6 @@ description of the available options.
48
41
  Sample output
49
42
  =============
50
43
 
51
- See http://eigenclass.org/hiki.rb?rcov (once again) for screenshots.
52
-
53
44
  The text report (also used by default in RcovTasks) resembles
54
45
 
55
46
 
@@ -118,32 +109,3 @@ tests:
118
109
  License
119
110
  -------
120
111
  rcov is released under the terms of Ruby's license.
121
- rcov includes xx 0.1.0, which is subject to the following conditions:
122
-
123
- ePark Labs Public License version 1
124
- Copyright (c) 2005, ePark Labs, Inc. and contributors
125
- All rights reserved.
126
-
127
- Redistribution and use in source and binary forms, with or without modification,
128
- are permitted provided that the following conditions are met:
129
-
130
- 1. Redistributions of source code must retain the above copyright notice, this
131
- list of conditions and the following disclaimer.
132
- 2. Redistributions in binary form must reproduce the above copyright notice,
133
- this list of conditions and the following disclaimer in the documentation
134
- and/or other materials provided with the distribution.
135
- 3. Neither the name of ePark Labs nor the names of its contributors may be
136
- used to endorse or promote products derived from this software without
137
- specific prior written permission.
138
-
139
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
140
- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
141
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
142
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
143
- ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
144
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
145
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
146
- ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
147
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
148
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
149
-
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  rcov is copyrighted free software by Mauricio Fernandez <mfp@acm.org>.
2
- You can redistribute it and/or modify it under either the terms of the GPL
3
- (see the file GPL), or the conditions below:
2
+ You can redistribute it and/or modify it under either the terms of the GPL,
3
+ or the conditions below:
4
4
 
5
5
  1. You may make and give away verbatim copies of the source form of the
6
6
  software without restriction, provided that you duplicate all of the
@@ -41,9 +41,6 @@ You can redistribute it and/or modify it under either the terms of the GPL
41
41
  software (possibly commercial). But some files in the distribution
42
42
  are not written by the author, so that they are not under these terms.
43
43
 
44
- For the list of those files and their copying conditions, see the
45
- file LEGAL.
46
-
47
44
  5. The scripts and library files supplied as input to or produced as
48
45
  output from the software do not automatically fall under the
49
46
  copyright of the software, but belong to whomever generated them,
data/Rakefile CHANGED
@@ -10,6 +10,9 @@ require 'rake/rdoctask'
10
10
  require 'rake/gempackagetask'
11
11
  require 'rake/clean'
12
12
 
13
+ puts "************\n#{ENV["PATH"]}\n************\n"
14
+ puts "************\n#{RUBY_VERSION}\n************"
15
+
13
16
  # Use the specified rcov executable instead of the one in $PATH
14
17
  # (this way we get a sort of informal functional test).
15
18
  # This could also be specified from the command like, e.g.
data/bin/rcov CHANGED
@@ -65,6 +65,10 @@ $PROGRAM_NAME (aka. $0) will be set before each file is load()ed if
65
65
  --replace-progname is used.
66
66
  EOF
67
67
 
68
+ def deprecated(opt)
69
+ puts "#{opt} is now depricated. Please remove it from you Rakefile or scripts. It will be removed in the next release."
70
+ end
71
+
68
72
  #{{{ OptionParser
69
73
  opts = OptionParser.new do |opts|
70
74
  opts.banner = <<-EOF
@@ -73,29 +77,31 @@ Usage: rcov [options] <script1.rb> [script2.rb] [-- --extra-options]
73
77
  EOF
74
78
  opts.separator ""
75
79
  opts.separator "Options:"
80
+
76
81
  opts.on("-o", "--output PATH", "Destination directory.") do |dir|
77
- options.destdir = dir
82
+ options.destdir = dir
78
83
  end
79
- opts.on("-I", "--include PATHS",
80
- "Prepend PATHS to $: (colon separated list)") do |paths|
81
- options.loadpaths = paths.split(/:/)
82
- end
83
- opts.on("--[no-]comments",
84
- "Mark all comments by default.",
85
- "(default: --no-comments)") do |comments_run_p|
86
- options.comments_run_by_default = comments_run_p
84
+
85
+ opts.on("-I", "--include PATHS", "Prepend PATHS to $: (colon separated list)") do |paths|
86
+ options.loadpaths = paths.split(/:/)
87
87
  end
88
- opts.on("--test-unit-only",
89
- "Only trace code executed inside TestCases.") do
90
- options.test_unit_only = true
88
+
89
+ opts.on("--[no-]comments", "Mark all comments by default.", "(default: --no-comments)") do |comments_run_p|
90
+ options.comments_run_by_default = comments_run_p
91
91
  end
92
- opts.on("--spec-only",
93
- "Only trace code executed inside RSpec specs.") do
94
- options.spec_only = true
92
+
93
+ opts.on("--test-unit-only", "Only trace code executed inside TestCases.") do
94
+ deprecated("--test-unit-only")
95
95
  end
96
+
97
+ opts.on("--spec-only", "Only trace code executed inside RSpec specs.") do
98
+ deprecated("--spec-only")
99
+ end
100
+
96
101
  opts.on("-n", "--no-color", "Create colorblind-safe output.") do
97
- options.color = false
102
+ options.color = false
98
103
  end
104
+
99
105
  opts.on("-i", "--include-file PATTERNS",
100
106
  "Generate info for files matching a",
101
107
  "pattern (comma-separated regexp list)") do |list|
@@ -106,77 +112,81 @@ EOF
106
112
  raise OptionParser::InvalidArgument, e.message
107
113
  end
108
114
  end
109
- opts.on("-x", "--exclude PATTERNS",
110
- "Don't generate info for files matching a",
111
- "pattern (comma-separated regexp list)") do |list|
112
- begin
113
- regexps = list.split(/,/).map{|x| Regexp.new x}
114
- options.skip += regexps
115
- rescue RegexpError => e
116
- raise OptionParser::InvalidArgument, e.message
117
- end
118
- end
119
- opts.on("--exclude-only PATTERNS",
120
- "Skip info only for files matching the",
121
- "given patterns.") do |list|
122
- begin
123
- options.skip = list.split(/,/).map{|x| Regexp.new(x) }
124
- rescue RegexpError => e
125
- raise OptionParser::InvalidArgument, e.message
126
- end
127
- end
115
+
116
+ opts.on("-x", "--exclude PATTERNS", "Don't generate info for files matching a","pattern (comma-separated regexp list)") do |list|
117
+ begin
118
+ regexps = list.split(/,/).map{|x| Regexp.new x}
119
+ options.skip += regexps
120
+ rescue RegexpError => e
121
+ raise OptionParser::InvalidArgument, e.message
122
+ end
123
+ end
124
+
125
+ opts.on("--exclude-only PATTERNS", "Skip info only for files matching the", "given patterns.") do |list|
126
+ begin
127
+ options.skip = list.split(/,/).map{|x| Regexp.new(x) }
128
+ rescue RegexpError => e
129
+ raise OptionParser::InvalidArgument, e.message
130
+ end
131
+ end
132
+
128
133
  opts.on("--rails", "Skip config/, environment/ and vendor/.") do
129
- options.skip.concat [%r{\bvendor/},%r{\bconfig/},%r{\benvironment/}]
134
+ options.skip.concat [%r{\bvendor/},%r{\bconfig/},%r{\benvironment/}]
130
135
  end
131
- opts.on("--[no-]callsites", "Show callsites in generated XHTML report.",
132
- "(somewhat slower; disabled by default)") do |val|
133
- options.callsites = val
136
+
137
+ opts.on("--[no-]callsites", "Show callsites in generated XHTML report.", "(somewhat slower; disabled by default)") do |val|
138
+ options.callsites = val
134
139
  end
135
- opts.on("--[no-]xrefs", "Generate fully cross-referenced report.",
136
- "(includes --callsites)") do |val|
137
- options.crossrefs = val
138
- options.callsites ||= val
140
+
141
+ opts.on("--[no-]xrefs", "Generate fully cross-referenced report.", "(includes --callsites)") do |val|
142
+ options.crossrefs = val
143
+ options.callsites ||= val
139
144
  end
145
+
140
146
  opts.on("-p", "--profile", "Generate bogo-profiling info.") do
141
- options.profiling = true
142
- options.destdir ||= "profiling"
147
+ options.profiling = true
148
+ options.destdir ||= "profiling"
143
149
  end
144
- opts.on("-r", "--range RANGE", Float,
145
- "Color scale range for profiling info (dB).") do |val|
146
- options.range = val
150
+
151
+ opts.on("-r", "--range RANGE", Float, "Color scale range for profiling info (dB).") do |val|
152
+ options.range = val
147
153
  end
148
- opts.on("-a", "--annotate",
149
- "Generate annotated source code.") do
150
- options.html = false
151
- options.textmode = :annotate
152
- options.crossrefs = true
153
- options.callsites = true
154
- options.skip = [ %r!/test/unit/! ]
154
+
155
+ opts.on("-a", "--annotate", "Generate annotated source code.") do
156
+ options.html = false
157
+ options.textmode = :annotate
158
+ options.crossrefs = true
159
+ options.callsites = true
160
+ options.skip = [ %r!/test/unit/! ]
155
161
  end
156
162
 
157
- opts.on("-T", "--text-report", "Dump detailed plain-text report to stdout.",
158
- "(filename, LoC, total lines, coverage)") do
159
- options.textmode = :report
163
+ opts.on("-T", "--text-report", "Dump detailed plain-text report to stdout.", "(filename, LoC, total lines, coverage)") do
164
+ options.textmode = :report
160
165
  end
166
+
161
167
  opts.on("-t", "--text-summary", "Dump plain-text summary to stdout.") do
162
- options.textmode = :summary
168
+ options.textmode = :summary
163
169
  end
170
+
164
171
  opts.on("--text-counts", "Dump execution counts in plaintext.") do
165
- options.textmode = :counts
172
+ options.textmode = :counts
166
173
  end
167
- opts.on("--text-coverage", "Dump coverage info to stdout, using",
168
- "ANSI color sequences unless -n.") do
169
- options.textmode = :coverage
174
+
175
+ opts.on("--text-coverage", "Dump coverage info to stdout, using", "ANSI color sequences unless -n.") do
176
+ options.textmode = :coverage
170
177
  end
178
+
171
179
  opts.on("--gcc", "Dump uncovered line in GCC error format.") do
172
- options.gcc_output = true
180
+ options.gcc_output = true
173
181
  end
182
+
174
183
  opts.on("--aggregate FILE", "Aggregate data from previous runs",
175
184
  "in FILE. Overwrites FILE with the",
176
185
  "merged data. FILE is created if",
177
186
  "necessary.") do |file|
178
187
  options.aggregate_file = file
179
188
  end
189
+
180
190
  opts.on("-D [FILE]", "--text-coverage-diff [FILE]",
181
191
  "Compare code coverage with saved state",
182
192
  "in FILE, defaults to coverage.info.",
@@ -189,77 +199,79 @@ EOF
189
199
  options.coverage_diff_mode = :compare
190
200
  options.coverage_diff_file = file if file && !file.empty?
191
201
  end
192
- opts.on("--save [FILE]", "Save coverage data to FILE,",
193
- "for later use with rcov -D.",
194
- "(default: coverage.info)") do |file|
195
- options.coverage_diff_save = true
196
- options.coverage_diff_mode = :record
197
- if options.textmode == :coverage_diff
198
- raise "You shouldn't use --save and --text-coverage-diff at a time."
199
- end
200
- options.coverage_diff_file = file if file && !file.empty?
202
+
203
+ opts.on("--save [FILE]", "Save coverage data to FILE,", "for later use with rcov -D.", "(default: coverage.info)") do |file|
204
+ options.coverage_diff_save = true
205
+ options.coverage_diff_mode = :record
206
+ if options.textmode == :coverage_diff
207
+ raise "You shouldn't use --save and --text-coverage-diff at a time."
208
+ end
209
+ options.coverage_diff_file = file if file && !file.empty?
201
210
  end
202
- opts.on("--[no-]html", "Generate HTML output.",
203
- "(default: --html)") do |val|
204
- options.html = val
211
+
212
+ opts.on("--[no-]html", "Generate HTML output.", "(default: --html)") do |val|
213
+ options.html = val
205
214
  end
206
- opts.on("--sort CRITERION", [:name, :loc, :coverage],
207
- "Sort files in the output by the specified",
208
- "field (name, loc, coverage)") do |criterion|
209
- options.sort = criterion
215
+
216
+ opts.on("--sort CRITERION", [:name, :loc, :coverage], "Sort files in the output by the specified", "field (name, loc, coverage)") do |criterion|
217
+ options.sort = criterion
210
218
  end
219
+
211
220
  opts.on("--sort-reverse", "Reverse files in the output.") do
212
- options.sort_reverse = true
213
- end
214
- opts.on("--threshold INT", "Only list files with coverage < INT %.",
215
- "(default: 101)") do |threshold|
216
- begin
217
- threshold = Integer(threshold)
218
- raise if threshold <= 0 || threshold > 101
219
- rescue Exception
220
- raise OptionParser::InvalidArgument, threshold
221
- end
222
- options.output_threshold = threshold
221
+ options.sort_reverse = true
222
+ end
223
+
224
+ opts.on("--threshold INT", "Only list files with coverage < INT %.", "(default: 101)") do |threshold|
225
+ begin
226
+ threshold = Integer(threshold)
227
+ raise if threshold <= 0 || threshold > 101
228
+ rescue Exception
229
+ raise OptionParser::InvalidArgument, threshold
230
+ end
231
+ options.output_threshold = threshold
223
232
  end
224
233
 
225
- opts.on("--charset CHARSET",
226
- "Charset used in Content-Type declaration of HTML reports.") do |c|
234
+ opts.on("--charset CHARSET", "Charset used in Content-Type declaration of HTML reports.") do |c|
227
235
  options.charset = c
228
236
  end
229
237
 
230
238
  opts.on("--only-uncovered", "Same as --threshold 100") do
231
239
  options.output_threshold = 100
232
240
  end
241
+
233
242
  opts.on("--replace-progname", "Replace $0 when loading the .rb files.") do
234
243
  options.replace_prog_name = true
235
244
  end
245
+
236
246
  opts.on("-w", "Turn warnings on (like ruby).") do
237
247
  $VERBOSE = true
238
248
  end
239
- opts.on("--no-rcovrt", "Do not use the optimized C runtime.",
240
- "(will run 30-300 times slower)") do
249
+
250
+ opts.on("--no-rcovrt", "Do not use the optimized C runtime.", "(will run 30-300 times slower)") do
241
251
  $rcov_do_not_use_rcovrt = true
242
252
  end
253
+
243
254
  opts.on("--diff-cmd PROGNAME", "Use PROGNAME for --text-coverage-diff.",
244
255
  "(default: diff)") do |cmd|
245
256
  options.diff_cmd = cmd
246
257
  end
258
+
247
259
  opts.separator ""
260
+
248
261
  opts.on_tail("-h", "--help", "Show extended help message") do
249
- require 'pp'
250
- puts opts
262
+ require 'pp'
263
+ puts opts
251
264
  puts <<EOF
252
265
 
253
266
  Files matching any of the following regexps will be omitted in the report(s):
254
267
  #{PP.pp(options.skip, "").chomp}
255
268
  EOF
256
- puts EXTRA_HELP
257
- exit
269
+ puts EXTRA_HELP
270
+ exit
258
271
  end
259
- opts.on_tail("--report-cov-bug SELECTOR",
260
- "Report coverage analysis bug for the",
261
- "method specified by SELECTOR",
262
- "(format: Foo::Bar#method, A::B.method)") do |selector|
272
+
273
+ opts.on_tail("--report-cov-bug SELECTOR", "Report coverage analysis bug for the",
274
+ "method specified by SELECTOR", "(format: Foo::Bar#method, A::B.method)") do |selector|
263
275
  case selector
264
276
  when /([^.]+)(#|\.)(.*)/ then options.report_cov_bug_for = selector
265
277
  else
@@ -277,25 +289,25 @@ end
277
289
 
278
290
  $ORIGINAL_ARGV = ARGV.clone
279
291
  if (idx = ARGV.index("--"))
280
- extra_args = ARGV[idx+1..-1]
281
- ARGV.replace(ARGV[0,idx])
292
+ extra_args = ARGV[idx+1..-1]
293
+ ARGV.replace(ARGV[0,idx])
282
294
  else
283
- extra_args = []
295
+ extra_args = []
284
296
  end
285
297
 
286
298
  begin
287
- opts.parse! ARGV
288
- rescue OptionParser::InvalidOption, OptionParser::InvalidArgument,
289
- OptionParser::MissingArgument => e
290
- puts opts
291
- puts
292
- puts e.message
293
- exit(-1)
299
+ opts.parse! ARGV
300
+ rescue OptionParser::InvalidOption, OptionParser::InvalidArgument, OptionParser::MissingArgument => e
301
+ puts opts
302
+ puts
303
+ puts e.message
304
+ exit(-1)
294
305
  end
306
+
295
307
  options.destdir ||= "coverage"
296
308
  unless ARGV[0] or options.aggregate_file && File.file?(options.aggregate_file)
297
- puts opts
298
- exit
309
+ puts opts
310
+ exit
299
311
  end
300
312
 
301
313
  # {{{ set loadpath
@@ -310,14 +322,14 @@ options.callsites = true if options.report_cov_bug_for
310
322
  options.textmode = :gcc if !options.textmode and options.gcc_output
311
323
 
312
324
  def rcov_load_aggregate_data(file)
313
- require 'zlib'
314
- begin
315
- old_data = nil
316
- Zlib::GzipReader.open(file){|gz| old_data = Marshal.load(gz) }
317
- rescue
318
- old_data = {}
319
- end
320
- old_data || {}
325
+ require 'zlib'
326
+ begin
327
+ old_data = nil
328
+ Zlib::GzipReader.open(file){|gz| old_data = Marshal.load(gz) }
329
+ rescue
330
+ old_data = {}
331
+ end
332
+ old_data || {}
321
333
  end
322
334
 
323
335
  def rcov_save_aggregate_data(file)
@@ -328,16 +340,16 @@ def rcov_save_aggregate_data(file)
328
340
  end
329
341
 
330
342
  if options.callsites
331
- if options.aggregate_file
332
- saved_aggregate_data = rcov_load_aggregate_data(options.aggregate_file)
333
- if saved_aggregate_data[:callsites]
334
- $rcov_callsite_analyzer = saved_aggregate_data[:callsites]
335
- end
343
+ if options.aggregate_file
344
+ saved_aggregate_data = rcov_load_aggregate_data(options.aggregate_file)
345
+ if saved_aggregate_data[:callsites]
346
+ $rcov_callsite_analyzer = saved_aggregate_data[:callsites]
336
347
  end
337
- $rcov_callsite_analyzer ||= Rcov::CallSiteAnalyzer.new
338
- $rcov_callsite_analyzer.install_hook
348
+ end
349
+ $rcov_callsite_analyzer ||= Rcov::CallSiteAnalyzer.new
350
+ $rcov_callsite_analyzer.install_hook
339
351
  else
340
- $rcov_callsite_analyzer = nil
352
+ $rcov_callsite_analyzer = nil
341
353
  end
342
354
 
343
355
  # {{{ create formatters
@@ -362,31 +374,31 @@ make_formatter = lambda do |klass|
362
374
  end
363
375
 
364
376
  if options.html
365
- if options.profiling
366
- formatters << make_formatter[Rcov::HTMLProfiling]
367
- else
368
- formatters << make_formatter[Rcov::HTMLCoverage]
369
- end
377
+ if options.profiling
378
+ formatters << make_formatter[Rcov::HTMLProfiling]
379
+ else
380
+ formatters << make_formatter[Rcov::HTMLCoverage]
381
+ end
370
382
  end
371
- textual_formatters = {:counts => Rcov::FullTextReport,
372
- :coverage => Rcov::FullTextReport,
373
- :gcc => Rcov::FullTextReport,
374
- :annotate => Rcov::RubyAnnotation,
383
+
384
+ textual_formatters = { :counts => Rcov::FullTextReport, :coverage => Rcov::FullTextReport,
385
+ :gcc => Rcov::FullTextReport, :annotate => Rcov::RubyAnnotation,
375
386
  :summary => Rcov::TextSummary, :report => Rcov::TextReport,
376
- :coverage_diff => Rcov::TextCoverageDiff}
387
+ :coverage_diff => Rcov::TextCoverageDiff }
377
388
 
378
389
  if textual_formatters[options.textmode]
379
- formatters << make_formatter[textual_formatters[options.textmode]]
390
+ formatters << make_formatter[textual_formatters[options.textmode]]
380
391
  end
381
392
 
382
393
  formatters << make_formatter[Rcov::TextCoverageDiff] if options.coverage_diff_save
383
394
 
384
395
  if options.aggregate_file
385
- saved_aggregate_data ||= rcov_load_aggregate_data(options.aggregate_file)
386
- if saved_aggregate_data[:coverage]
387
- $rcov_code_coverage_analyzer = saved_aggregate_data[:coverage]
388
- end
396
+ saved_aggregate_data ||= rcov_load_aggregate_data(options.aggregate_file)
397
+ if saved_aggregate_data[:coverage]
398
+ $rcov_code_coverage_analyzer = saved_aggregate_data[:coverage]
399
+ end
389
400
  end
401
+
390
402
  $rcov_code_coverage_analyzer ||= Rcov::CodeCoverageAnalyzer.new
391
403
 
392
404
  # must be registered before test/unit puts its own
@@ -468,87 +480,21 @@ EOF
468
480
  raise $__rcov_exit_exception if $__rcov_exit_exception
469
481
  }
470
482
 
471
- if options.test_unit_only
472
- require 'test/unit'
473
- module Test::Unit
474
- class TestCase
475
- remove_method(:run) if instance_methods.include? "run"
476
- def run(result)
477
- yield(STARTED, name)
478
- @_result = result
479
- begin
480
- $rcov_code_coverage_analyzer.run_hooked do
481
- setup
482
- __send__(@method_name)
483
- end
484
- rescue AssertionFailedError => e
485
- add_failure(e.message, e.backtrace)
486
- rescue StandardError, ScriptError
487
- add_error($!)
488
- ensure
489
- begin
490
- $rcov_code_coverage_analyzer.run_hooked { teardown }
491
- rescue AssertionFailedError => e
492
- add_failure(e.message, e.backtrace)
493
- rescue StandardError, ScriptError
494
- add_error($!)
495
- end
496
- end
497
- result.add_run
498
- yield(FINISHED, name)
499
- end
500
- end
501
- end
502
- elsif options.spec_only
503
- require 'spec'
504
- override_run = lambda do
505
- oldrun = instance_method(:run)
506
- define_method(:run) do |*args|
507
- $rcov_code_coverage_analyzer.run_hooked { oldrun.bind(self).call(*args) }
508
- end
509
- end
510
-
511
- if defined?(Spec::DSL::Example)
512
- Spec::DSL::Example.instance_eval(&override_run)
513
- elsif defined?(Spec::Example::ExampleMethods)
514
- override_run = lambda do
515
- oldexecute = instance_method(:execute)
516
- define_method(:execute) do |*args|
517
- $rcov_code_coverage_analyzer.run_hooked { oldexecute.bind(self).call(*args) }
518
- end
519
- end
520
- Spec::Example::ExampleMethods.instance_eval(&override_run)
521
- elsif defined?(Spec::Example::ExampleGroup)
522
- Spec::Example::ExampleGroup.instance_eval(&override_run)
523
- else
524
- $stderr.puts <<-EOF
525
- Your RSpec version isn't supported. If it's a old one, consider upgrading;
526
- otherwise, please report the problem.
527
- EOF
528
- exit(-1)
529
- end
530
- else
531
- $rcov_code_coverage_analyzer.install_hook
532
- end
483
+ $rcov_code_coverage_analyzer.install_hook
533
484
 
534
485
  #{{{ Load scripts
535
486
  begin
536
- pending_scripts = ARGV.clone
537
- ARGV.replace extra_args
538
- until pending_scripts.empty?
487
+ pending_scripts = ARGV.clone
488
+ ARGV.replace extra_args
489
+ until pending_scripts.empty?
539
490
  prog = pending_scripts.shift
540
491
  if options.replace_prog_name
541
- $0 = File.basename(File.expand_path(prog))
492
+ $0 = File.basename(File.expand_path(prog))
542
493
  end
543
494
  load prog
544
- end
495
+ end
545
496
  rescue Object => err
546
497
  $__rcov_exit_exception = err
547
498
  end
548
499
 
549
500
  __END__
550
- # vi: set sw=4:
551
- # Here is Emacs setting. DO NOT REMOVE!
552
- # Local Variables:
553
- # ruby-indent-level: 4
554
- # End: