Class: Dragnet::Verifiers::ReposVerifier
- Defined in:
- lib/dragnet/verifiers/repos_verifier.rb
Overview
Verifies the Repo
objects attached to a TestRecord
Instance Attribute Summary collapse
-
#multi_repository ⇒ Object
readonly
Returns the value of attribute multi_repository.
Attributes inherited from Verifier
Instance Method Summary collapse
-
#initialize(test_record:, multi_repository:) ⇒ ReposVerifier
constructor
A new instance of ReposVerifier.
-
#verify ⇒ Dragnet::VerificationResult?
Carries out the verification of the
Repo
objects.
Methods included from Helpers::RepositoryHelper
#relative_to_repo, #repo_base, #shorten_sha1
Constructor Details
#initialize(test_record:, multi_repository:) ⇒ ReposVerifier
Returns a new instance of ReposVerifier.
19 20 21 22 |
# File 'lib/dragnet/verifiers/repos_verifier.rb', line 19 def initialize(test_record:, multi_repository:) super(test_record: test_record) @multi_repository = multi_repository end |
Instance Attribute Details
#multi_repository ⇒ Object (readonly)
Returns the value of attribute multi_repository.
13 14 15 |
# File 'lib/dragnet/verifiers/repos_verifier.rb', line 13 def multi_repository @multi_repository end |
Instance Method Details
#verify ⇒ Dragnet::VerificationResult?
Carries out the verification of the Repo
objects.
28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/dragnet/verifiers/repos_verifier.rb', line 28 def verify return unless test_record.repos&.any? test_record.repos.each do |repo| repository = fetch_repository(repo.path, multi_repository) verification_result = verify_repo(repo, repository) return verification_result if verification_result end rescue Dragnet::Errors::NotARepositoryError => e Dragnet::VerificationResult.new(status: :failed, reason: e.) end |