Module: Gitlab::Patch::SprocketsBaseFileDigestKey

Defined in:
lib/gitlab/patch/sprockets_base_file_digest_key.rb

Instance Method Summary collapse

Instance Method Details

#file_digest(path) ⇒ Object


9
10
11
12
13
14
15
16
17
18
19
# File 'lib/gitlab/patch/sprockets_base_file_digest_key.rb', line 9

def file_digest(path)
  if stat = self.stat(path)
    digest = self.stat_digest(path, stat)
    integrity_uri = self.integrity_uri(digest)

    key = Sprockets::UnloadedAsset.new(path, self).file_digest_key(integrity_uri)
    cache.fetch(key) do
      digest
    end
  end
end