class Longleaf::ManifestDigestProvider

Provides digests for files from a manifest

Public Class Methods

new(digests_mapping) click to toggle source

@param digests_mapping hash which maps file paths to hashs of digests

# File lib/longleaf/candidates/manifest_digest_provider.rb, line 5
def initialize(digests_mapping)
  @digests_mapping = digests_mapping
end

Public Instance Methods

get_digests(file_path) click to toggle source

@param file_path [String] path of file @return hash containing all the manifested digests for the given path, or nil

# File lib/longleaf/candidates/manifest_digest_provider.rb, line 11
def get_digests(file_path)
  # return nil if key not found, in case the hash has default values
  return nil unless @digests_mapping.key?(file_path)
  @digests_mapping[file_path]
end