Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[close #90] Use relative path for cache keys #92

Merged
merged 1 commit into from
Aug 12, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions lib/sprockets/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
require 'sprockets/resolve'
require 'sprockets/server'
require 'sprockets/source_map_utils'
require 'sprockets/loader'

module Sprockets
# `Base` class for `Environment` and `Cached`.
Expand Down Expand Up @@ -49,9 +50,10 @@ def file_digest(path)
# Caveat: Digests are cached by the path's current mtime. Its possible
# for a files contents to have changed and its mtime to have been
# negligently reset thus appearing as if the file hasn't changed on
# disk. Also, the mtime is only read to the nearest second. Its
# disk. Also, the mtime is only read to the nearest second. It's
# also possible the file was updated more than once in a given second.
cache.fetch("file_digest:#{path}:#{stat.mtime.to_i}") do
key = UnloadedAsset.new(path, self).file_digest_key(stat.mtime.to_i)
cache.fetch(key) do
self.stat_digest(path, stat)
end
end
Expand Down
7 changes: 0 additions & 7 deletions lib/sprockets/dependencies.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,6 @@ def add_dependency(uri)
end
alias_method :depend_on, :add_dependency

# Internal: Resolve set of dependency URIs.
#
# Returns Array of resolved Objects.
def resolve_dependencies(uris)
uris.map { |uri| resolve_dependency(uri) }
end

# Internal: Resolve dependency URIs.
#
# Returns resolved Object.
Expand Down
Loading