Sha256: 8b2e6cae4450afc7d901451b9ad0a5e5a27bd33d08607959a713576d617cd5da

Contents?: true

Size: 603 Bytes

Versions: 2

Compression:

Stored size: 603 Bytes

Contents

# frozen_string_literal: true

require "simplecov"

module CIHelper
  module Commands
    class CheckCoverage < BaseCommand
      def call
        require(path.join(setup_file_path)) unless setup_file_path.nil?

        ::SimpleCov.collate(files)
        0
      end

      private

      def files
        return path.glob("coverage/resultset.*.json") if split_resultset?

        [path.join("coverage/.resultset.json")]
      end

      def split_resultset?
        options[:split_resultset] == "true"
      end

      def setup_file_path
        options[:setup_file_path]
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ci-helper-0.4.0 lib/ci_helper/commands/check_coverage.rb
ci-helper-0.3.2 lib/ci_helper/commands/check_coverage.rb