class Coverage::HTMLPrinter
Attributes
output_directory[RW]
project_name[RW]
Public Class Methods
new() { |self| ... }
click to toggle source
# File lib/coverage/html_printer.rb, line 63 def initialize yield self if block_given? output_directory ||= Pathname.pwd + "coverage" @path_settings = PathSettings.new(output_directory) FileUtils.mkdir_p(output_directory) @project_name ||= base_directory.basename end
Public Instance Methods
install_files()
click to toggle source
# File lib/coverage/html_printer.rb, line 87 def install_files stylesheets_directory.each_child do |path| FileUtils.install(path, output_directory) end javascripts_directory.each_child do |path| FileUtils.install(path, output_directory) end end
print(result)
click to toggle source
# File lib/coverage/html_printer.rb, line 71 def print(result) target_files = Dir.glob("#{base_directory}/**/*.rb") statistics_list = [] files = [] result.each do |path, counts| next unless target_files.include?(path) next if Regexp.new("#{base_directory}/(?:test|spec|vendor)") =~ path files << Detail.new(@path_settings, @project_name, path, counts) end files.sort_by!{|detail| detail.path } files.each(&:print) index = Index.new(@path_settings, @project_name, files) index.print install_files end