Class: Dragnet::Verifiers::FilesVerifier
- Inherits:
-
RepositoryVerifier
- Object
- Verifier
- RepositoryVerifier
- Dragnet::Verifiers::FilesVerifier
- Defined in:
- lib/dragnet/verifiers/files_verifier.rb
Overview
Checks if any of the files listed in the MTR have changed since the MTR was created.
Instance Attribute Summary
Attributes inherited from RepositoryVerifier
Attributes inherited from Verifier
Instance Method Summary collapse
-
#verify ⇒ Dragnet::VerificationResult?
Executes the verification process.
Methods inherited from RepositoryVerifier
Methods inherited from Verifier
Methods included from Helpers::RepositoryHelper
#relative_to_repo, #repo_base, #shorten_sha1
Constructor Details
This class inherits a constructor from Dragnet::Verifiers::RepositoryVerifier
Instance Method Details
#verify ⇒ Dragnet::VerificationResult?
Executes the verification process. Checks the changes in the repository. If a change in one of the files is detected a :result
key is added to the MTR, including the detected change.
18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/dragnet/verifiers/files_verifier.rb', line 18 def verify changes = [] files.each do |file| diff = repository.diff(sha1, 'HEAD').path(file.to_s) next unless diff.size.positive? changes << file end result_from(changes) if changes.any? end |