Class: Coverband::Utils::FileHasher

Inherits:
Object
  • Object
show all
Defined in:
lib/coverband/utils/file_hasher.rb

Class Method Summary collapse

Class Method Details

.hash_file(file, path_converter: AbsoluteFileConverter.instance) ⇒ Object



8
9
10
11
12
13
# File 'lib/coverband/utils/file_hasher.rb', line 8

def self.hash_file(file, path_converter: AbsoluteFileConverter.instance)
  @cache[file] ||= begin
    file = path_converter.convert(file)
    Digest::MD5.file(file).hexdigest if File.exist?(file)
  end
end