From b8430972691ef855260b69d72ba425ae3f2b3c86 Mon Sep 17 00:00:00 2001 From: wlipa Date: Wed, 23 Sep 2015 10:20:19 -0700 Subject: [PATCH] prevent expanded paths from getting into the history cache --- lib/sprockets/loader.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/sprockets/loader.rb b/lib/sprockets/loader.rb index 610f3e018..05612c7ec 100644 --- a/lib/sprockets/loader.rb +++ b/lib/sprockets/loader.rb @@ -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