Class: Rcov::RubyAnnotation
Overview
:nodoc:
Constant Summary collapse
- DEFAULT_OPTS =
{ :destdir => "coverage" }
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(opts = {}) ⇒ RubyAnnotation
constructor
A new instance of RubyAnnotation.
Methods inherited from Formatter
#add_file, #code_coverage, #each_file_pair_sorted, #mangle_filename, #normalize_filename, #num_code_lines, #num_lines, #sorted_file_pairs, #total_coverage
Constructor Details
#initialize(opts = {}) ⇒ RubyAnnotation
Returns a new instance of RubyAnnotation.
1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 |
# File 'lib/rcov/report.rb', line 1167 def initialize(opts = {}) = DEFAULT_OPTS.clone.update(opts) super() @dest = [:destdir] @do_callsites = true @do_cross_references = true @mangle_filename = Hash.new{|h,base| h[base] = Pathname.new(base).cleanpath.to_s.gsub(%r{^\w:[/\\]}, "").gsub(/\./, "_").gsub(/[\\\/]/, "-") + ".rb" } end |
Instance Method Details
#execute ⇒ Object
1179 1180 1181 1182 1183 1184 1185 |
# File 'lib/rcov/report.rb', line 1179 def execute return if @files.empty? FileUtils.mkdir_p @dest each_file_pair_sorted do |filename, fileinfo| create_file(File.join(@dest, mangle_filename(filename)), fileinfo) end end |