Class: Evilution::Coverage::Digest Private
- Inherits:
-
Object
- Object
- Evilution::Coverage::Digest
- Defined in:
- lib/evilution/coverage/digest.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Stable, content-addressed digest of a source file, used by MapStore to detect when a cached coverage entry has gone stale. Path-independent: the digest depends only on the bytes, so moving a file does not invalidate it. Returns nil for a missing file so callers treat it as "not fresh".
Instance Method Summary collapse
- #for_file(path) ⇒ Object private
Instance Method Details
#for_file(path) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
11 12 13 14 15 |
# File 'lib/evilution/coverage/digest.rb', line 11 def for_file(path) return nil unless File.file?(path) ::Digest::SHA256.hexdigest(File.binread(path)) end |