Skip to content

Commit 3ed6718

Browse files
committedNov 23, 2014
Cover case where sprockets does not have an active cache
1 parent 1558aed commit 3ed6718

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed
 

‎lib/opal/builder.rb

+3-4
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ def initialize(options = nil)
2828
@preload ||= []
2929
@prerequired ||= []
3030
@path_reader ||= PathReader.new
31-
@cache_store ||= CacheStore.new
3231

3332
@processed = Set.new
3433

@@ -98,9 +97,9 @@ def find_asset(path)
9897
end
9998

10099
def cached_asset(path)
101-
asset = cache_store[path]
102-
103-
if asset && asset.fresh?(self)
100+
if cache_store.nil?
101+
yield
102+
elsif (asset = cache_store[path]) && asset.fresh?(self)
104103
asset
105104
else
106105
asset = yield

0 commit comments

Comments
 (0)
Please sign in to comment.