Skip to content

Commit

Permalink
Merge pull request rails#141 from wlipa/more-relative
Browse files Browse the repository at this point in the history
prevent expanded paths from getting into the history cache
  • Loading branch information
jeremy committed Sep 24, 2015
2 parents 509e9cb + b843097 commit 35fc5a3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/sprockets/loader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -308,8 +308,10 @@ def fetch_asset_from_dependency_cache(unloaded, limit = 3)

history = cache.get(key) || []
history.each_with_index do |deps, index|
deps.map! { |path| path.start_with?("file-digest://") ? expand_from_root(path) : path }
if asset = yield(deps)
expanded_deps = deps.map do |path|
path.start_with?("file-digest://") ? expand_from_root(path) : path
end
if asset = yield(expanded_deps)
cache.set(key, history.rotate!(index)) if index > 0
return asset
end
Expand Down

0 comments on commit 35fc5a3

Please sign in to comment.