Sha256: 29b14a01358d05c34da404ef22a656448c47ebf888168d43e9f809e60b4393bb

Contents?: true

Size: 449 Bytes

Versions: 9

Compression:

Stored size: 449 Bytes

Contents

module Slather
  class CoverallsCoverageFile < CoverageFile

    def coverage_data
      first_line_start = gcov_data =~ /^\s+(-|#+|[0-9+]):\s+1:/

      gcov_data[first_line_start..-1].split("\n").map do |line|
        coverage_for_line(line)
      end
    end

    def as_json
      {
        :name => source_file_pathname_relative_to_project_root.to_s,
        :source => source_data,
        :coverage => coverage_data
      }
    end

  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
slather-0.0.234 lib/slather/coveralls_coverage_file.rb
slather-0.0.233 lib/slather/coveralls_coverage_file.rb
slather-0.0.232 lib/slather/coveralls_coverage_file.rb
slather-0.0.231 lib/slather/coveralls_coverage_file.rb
slather-0.0.23 lib/slather/coveralls_coverage_file.rb
slather-0.0.22 lib/slather/coveralls_coverage_file.rb
slather-0.0.21 lib/slather/coveralls_coverage_file.rb
slather-0.0.2 lib/slather/coveralls_coverage_file.rb
slather-0.0.1 lib/slather/coveralls_coverage_file.rb