spicycode-rcov 0.8.1.3.0 → 0.8.1.5.0

Sign up to get free protection for your applications and to get access to all the features.
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.3.0"
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
- if defined? Spec::DSL::Example
518
- Spec::DSL::Example.instance_eval(&override_run)
519
- elsif defined? Spec::Example::ExampleGroup
520
- Spec::Example::ExampleGroup.instance_eval(&override_run)
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
- options = DEFAULT_OPTS.clone.update(opts)
705
- super(options)
706
- @dest = options[:destdir]
707
- @color = options[:color]
708
- @fsr = options[:fsr]
709
- @do_callsites = options[:callsites]
710
- @do_cross_references = options[:cross_references]
711
- @span_class_index = 0
712
- @show_validator_links = options[:validator_links]
713
- @charset = options[:charset]
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
- return if @files.empty?
718
- FileUtils.mkdir_p @dest
719
- create_index(File.join(@dest, "index.html"))
720
- each_file_pair_sorted do |filename, fileinfo|
721
- create_file(File.join(@dest, mangle_filename(filename)), fileinfo)
722
- end
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
- true
742
+ true
741
743
  end
742
744
 
743
745
  def default_color
744
- "rgb(240, 240, 245)"
746
+ "rgb(240, 240, 245)"
745
747
  end
746
748
 
747
749
  def default_title
748
- "C0 code coverage information"
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
- def initialize(obj); @o = obj end
815
- %w[num_lines num_code_lines code_coverage total_coverage].each do |m|
816
- define_method(m){ @o.send(m) }
817
- end
818
- def name; "TOTAL" end
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.3"
8
- RELEASE_DATE = "2008-08-29"
7
+ VERSION = "0.8.1.5"
8
+ RELEASE_DATE = "2008-10-29"
9
9
  RCOVRT_ABI = [2,0,0]
10
- UPSTREAM_URL = "http://eigenclass.org/hiki/rcov"
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.3.0
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