class SimpleCov::Formatter::RcovTextFormatter

Constants

UPSTREAM_URL
VERSION

Public Class Methods

file_name() click to toggle source
# File lib/simplecov-rcov-text.rb, line 40
def self.file_name
  "rcov.txt"
end
output_path() click to toggle source
# File lib/simplecov-rcov-text.rb, line 44
def self.output_path
  File.join( SimpleCov.coverage_path, "/rcov" )
end

Public Instance Methods

create_content(result) click to toggle source
# File lib/simplecov-rcov-text.rb, line 20
def create_content(result)
  content = "metric_fu shift the first line\n"
  result.source_files.each do |source_file|
    content << "=" * 80
    content << "\n #{simple_file_name(source_file)}\n"
    content << "=" * 80
    content << "\n"
    source_file.lines.each do |line|
      content << (line.missed? ? '!!'  : '  ')
      content << " #{line.src.chomp}\n"
    end
    content << "\n"
  end
  content
end
format( result ) click to toggle source
# File lib/simplecov-rcov-text.rb, line 12
def format( result )
  FileUtils.mkdir_p(SimpleCov::Formatter::RcovTextFormatter.output_path)

  File.open(File.join(SimpleCov::Formatter::RcovTextFormatter.output_path, SimpleCov::Formatter::RcovTextFormatter.file_name), "wb+") do |rcov|
    rcov << create_content(result)
  end
end
simple_file_name(source_file) click to toggle source
# File lib/simplecov-rcov-text.rb, line 36
def simple_file_name(source_file)
  source_file.filename.gsub(SimpleCov.root, '.')
end