spicycode-rcov 0.8.1.3.0 → 0.8.1.5.0
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/Rakefile +1 -1
- data/bin/rcov +13 -4
- data/lib/rcov/report.rb +49 -27
- data/lib/rcov/version.rb +3 -3
- metadata +1 -2
data/Rakefile
CHANGED
@@ -100,7 +100,7 @@ PKG_FILES = ["bin/rcov", "lib/rcov.rb", "lib/rcov/lowlevel.rb", "lib/rcov/xx.rb"
|
|
100
100
|
# this code can also be used to generate the MRI gem. But I left the gemspec file in too.
|
101
101
|
spec = Gem::Specification.new do |s|
|
102
102
|
s.name = %q{rcov}
|
103
|
-
s.version = "0.8.1.
|
103
|
+
s.version = "0.8.1.5.0"
|
104
104
|
|
105
105
|
s.required_rubygems_version = nil if s.respond_to? :required_rubygems_version=
|
106
106
|
s.authors = ["Mauricio Fernandez"]
|
data/bin/rcov
CHANGED
@@ -514,10 +514,19 @@ elsif options.spec_only
|
|
514
514
|
$rcov_code_coverage_analyzer.run_hooked { oldrun.bind(self).call(*args) }
|
515
515
|
end
|
516
516
|
end
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
517
|
+
|
518
|
+
if defined?(Spec::DSL::Example)
|
519
|
+
Spec::DSL::Example.instance_eval(&override_run)
|
520
|
+
elsif defined?(Spec::Example::ExampleMethods)
|
521
|
+
override_run = lambda do
|
522
|
+
oldexecute = instance_method(:execute)
|
523
|
+
define_method(:execute) do |*args|
|
524
|
+
$rcov_code_coverage_analyzer.run_hooked { oldexecute.bind(self).call(*args) }
|
525
|
+
end
|
526
|
+
end
|
527
|
+
Spec::Example::ExampleMethods.instance_eval(&override_run)
|
528
|
+
elsif defined?(Spec::Example::ExampleGroup)
|
529
|
+
Spec::Example::ExampleGroup.instance_eval(&override_run)
|
521
530
|
else
|
522
531
|
$stderr.puts <<-EOF
|
523
532
|
Your RSpec version isn't supported. If it's a old one, consider upgrading;
|
data/lib/rcov/report.rb
CHANGED
@@ -85,9 +85,11 @@ class Formatter # :nodoc:
|
|
85
85
|
/\btest\//,
|
86
86
|
/\bvendor\//,
|
87
87
|
/\A#{Regexp.escape(__FILE__)}\z/]
|
88
|
+
|
88
89
|
DEFAULT_OPTS = {:ignore => ignore_files, :sort => :name, :sort_reverse => false,
|
89
90
|
:output_threshold => 101, :dont_ignore => [],
|
90
91
|
:callsite_analyzer => nil, :comments_run_by_default => false}
|
92
|
+
|
91
93
|
def initialize(opts = {})
|
92
94
|
options = DEFAULT_OPTS.clone.update(opts)
|
93
95
|
@files = {}
|
@@ -527,7 +529,6 @@ EOF
|
|
527
529
|
end
|
528
530
|
end
|
529
531
|
|
530
|
-
|
531
532
|
class HTMLCoverage < Formatter # :nodoc:
|
532
533
|
include XX::XHTML
|
533
534
|
include XX::XMLish
|
@@ -701,25 +702,26 @@ EOS
|
|
701
702
|
:validator_links => true, :charset => nil
|
702
703
|
}
|
703
704
|
def initialize(opts = {})
|
704
|
-
|
705
|
-
|
706
|
-
|
707
|
-
|
708
|
-
|
709
|
-
|
710
|
-
|
711
|
-
|
712
|
-
|
713
|
-
|
705
|
+
options = DEFAULT_OPTS.clone.update(opts)
|
706
|
+
super(options)
|
707
|
+
@dest = options[:destdir]
|
708
|
+
@color = options[:color]
|
709
|
+
@fsr = options[:fsr]
|
710
|
+
@do_callsites = options[:callsites]
|
711
|
+
@do_cross_references = options[:cross_references]
|
712
|
+
@span_class_index = 0
|
713
|
+
@show_validator_links = options[:validator_links]
|
714
|
+
@charset = options[:charset]
|
714
715
|
end
|
715
716
|
|
716
717
|
def execute
|
717
|
-
|
718
|
-
|
719
|
-
|
720
|
-
|
721
|
-
|
722
|
-
|
718
|
+
return if @files.empty?
|
719
|
+
FileUtils.mkdir_p @dest
|
720
|
+
create_index(File.join(@dest, "index.html"))
|
721
|
+
|
722
|
+
each_file_pair_sorted do |filename, fileinfo|
|
723
|
+
create_file(File.join(@dest, mangle_filename(filename)), fileinfo)
|
724
|
+
end
|
723
725
|
end
|
724
726
|
|
725
727
|
private
|
@@ -737,15 +739,15 @@ EOS
|
|
737
739
|
end
|
738
740
|
|
739
741
|
def output_color_table?
|
740
|
-
|
742
|
+
true
|
741
743
|
end
|
742
744
|
|
743
745
|
def default_color
|
744
|
-
|
746
|
+
"rgb(240, 240, 245)"
|
745
747
|
end
|
746
748
|
|
747
749
|
def default_title
|
748
|
-
|
750
|
+
"C0 code coverage information"
|
749
751
|
end
|
750
752
|
|
751
753
|
def format_overview(*file_infos)
|
@@ -811,11 +813,31 @@ EOS
|
|
811
813
|
end
|
812
814
|
|
813
815
|
class SummaryFileInfo # :nodoc:
|
814
|
-
|
815
|
-
|
816
|
-
|
817
|
-
|
818
|
-
|
816
|
+
|
817
|
+
def initialize(obj)
|
818
|
+
@o = obj
|
819
|
+
end
|
820
|
+
|
821
|
+
def num_lines
|
822
|
+
@o.num_lines
|
823
|
+
end
|
824
|
+
|
825
|
+
def num_code_lines
|
826
|
+
@o.num_code_lines
|
827
|
+
end
|
828
|
+
|
829
|
+
def code_coverage
|
830
|
+
@o.code_coverage
|
831
|
+
end
|
832
|
+
|
833
|
+
def total_coverage
|
834
|
+
@o.total_coverage
|
835
|
+
end
|
836
|
+
|
837
|
+
def name
|
838
|
+
"TOTAL"
|
839
|
+
end
|
840
|
+
|
819
841
|
end
|
820
842
|
|
821
843
|
def create_index(destname)
|
@@ -1119,8 +1141,7 @@ class HTMLProfiling < HTMLCoverage # :nodoc:
|
|
1119
1141
|
max = 2 if max == 1
|
1120
1142
|
if marked == true
|
1121
1143
|
count = 1 if !count || count == 0
|
1122
|
-
idx = 50 + 1.0 * (500/full_scale_range) * Math.log(count/median) /
|
1123
|
-
Math.log(10)
|
1144
|
+
idx = 50 + 1.0 * (500/full_scale_range) * Math.log(count/median) / Math.log(10)
|
1124
1145
|
idx = idx.to_i
|
1125
1146
|
idx = 0 if idx < 0
|
1126
1147
|
idx = 100 if idx > 100
|
@@ -1129,6 +1150,7 @@ class HTMLProfiling < HTMLCoverage # :nodoc:
|
|
1129
1150
|
nil
|
1130
1151
|
end
|
1131
1152
|
end
|
1153
|
+
|
1132
1154
|
end
|
1133
1155
|
|
1134
1156
|
class RubyAnnotation < Formatter # :nodoc:
|
data/lib/rcov/version.rb
CHANGED
@@ -4,10 +4,10 @@
|
|
4
4
|
|
5
5
|
module Rcov
|
6
6
|
|
7
|
-
VERSION = "0.8.1.
|
8
|
-
RELEASE_DATE = "2008-
|
7
|
+
VERSION = "0.8.1.5"
|
8
|
+
RELEASE_DATE = "2008-10-29"
|
9
9
|
RCOVRT_ABI = [2,0,0]
|
10
|
-
UPSTREAM_URL = "http://
|
10
|
+
UPSTREAM_URL = "http://github.com/spicycode/rcov"
|
11
11
|
|
12
12
|
end
|
13
13
|
# vi: set sw=2:
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spicycode-rcov
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.1.
|
4
|
+
version: 0.8.1.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mauricio Fernandez
|
@@ -42,7 +42,6 @@ files:
|
|
42
42
|
- readme_for_rake
|
43
43
|
- readme_for_rant
|
44
44
|
- readme_for_vim
|
45
|
-
- readme_for_apien
|
46
45
|
- readme_for_api
|
47
46
|
- THANKS
|
48
47
|
- test/functional_test.rb
|