Sha256: 2c6da597728941a2efb23e447b0fba353efa30ccfe5f260b10e51b26d1a1973d

Contents?: true

Size: 714 Bytes

Versions: 2

Compression:

Stored size: 714 Bytes

Contents

module CircleCI
  module CoverageReporter
    # Encapsulate a CircleCI build
    #
    # @attr vcs_revision [String] revision of git
    # @attr build_number [Integer] the ID of the CircleCI build
    Build = Struct.new(:vcs_revision, :build_number) do
      # @param revision [String]
      # @return [Boolean]
      def match?(revision)
        vcs_revision.start_with?(revision)
      end

      # @return [Array<Artifact>]
      def artifacts
        @artifacts ||= CoverageReporter.client.artifacts(build_number)
      end

      # @param string [String]
      # @return [Artifact, nil]
      def find_artifact(string)
        artifacts.find { |artifact| artifact.match?(string) }
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
circleci-coverage_reporter-0.7.0 lib/circleci/coverage_reporter/build.rb
circleci-coverage_reporter-0.6.0 lib/circleci/coverage_reporter/build.rb