Class: CircleCI::CoverageReporter::Build
- Inherits:
-
Struct
- Object
- Struct
- CircleCI::CoverageReporter::Build
- Defined in:
- lib/circleci/coverage_reporter/build.rb
Overview
Encapsulate a CircleCI build
Instance Attribute Summary collapse
-
#build_number ⇒ Integer
the ID of the CircleCI build.
-
#vcs_revision ⇒ String
revision of git.
Instance Method Summary collapse
- #artifacts ⇒ Array<Artifact>
- #find_artifact(string, node_index: nil) ⇒ Artifact?
- #match?(revision) ⇒ Boolean
Instance Attribute Details
#build_number ⇒ Integer
the ID of the CircleCI build
7 8 9 |
# File 'lib/circleci/coverage_reporter/build.rb', line 7 def build_number @build_number end |
#vcs_revision ⇒ String
revision of git
7 8 9 |
# File 'lib/circleci/coverage_reporter/build.rb', line 7 def vcs_revision @vcs_revision end |
Instance Method Details
#artifacts ⇒ Array<Artifact>
15 16 17 |
# File 'lib/circleci/coverage_reporter/build.rb', line 15 def artifacts @artifacts ||= CoverageReporter.client.artifacts(build_number) end |
#find_artifact(string, node_index: nil) ⇒ Artifact?
22 23 24 |
# File 'lib/circleci/coverage_reporter/build.rb', line 22 def find_artifact(string, node_index: nil) artifacts.find { |artifact| artifact.match?(string, node_index: node_index) } end |
#match?(revision) ⇒ Boolean
10 11 12 |
# File 'lib/circleci/coverage_reporter/build.rb', line 10 def match?(revision) vcs_revision.start_with?(revision) end |