Sha256: 804a4492cbe72889f05c68d9968451a05791fcb5dfdbb1bc0ab8ea3a685ba179

Contents?: true

Size: 621 Bytes

Versions: 1

Compression:

Stored size: 621 Bytes

Contents

require_relative '../abstract_build_result'

module CircleCI
  module CoverageReporter
    module RubyCritic
      class BuildResult < AbstractBuildResult
        # @note Implement {AbstractResult#coverage}
        # @return [Float]
        def coverage
          last_run_json = find_artifact('report.json') or return Float::NAN
          JSON.parse(last_run_json.body)['score'].to_f
        end

        # @note Implement {AbstractResult#url}
        # @return [String]
        def url
          index_html = find_artifact('overview.html') or return '#'
          index_html.url
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
circleci-coverage_reporter-0.5.0 lib/circleci/coverage_reporter/rubycritic/build_result.rb