lib/propshaft/load_path.rb in propshaft-0.6.4 vs lib/propshaft/load_path.rb in propshaft-0.7.0
- old
+ new
@@ -26,11 +26,11 @@
manifest[asset.logical_path.to_s] = asset.digested_path.to_s
end
end
end
- # Returns a ActiveSupport::FileUpdateChecker object configured to clear the cache of the load_path
+ # Returns a file watcher object configured to clear the cache of the load_path
# when the directories passed during its initialization have changes. This is used in development
# and test to ensure the map caches are reset when javascript files are changed.
def cache_sweeper
@cache_sweeper ||= begin
exts_to_watch = Mime::EXTENSION_LOOKUP.map(&:first)
@@ -46,10 +46,11 @@
def assets_by_path
@cached_assets_by_path ||= Hash.new.tap do |mapped|
paths.each do |path|
without_dotfiles(all_files_from_tree(path)).each do |file|
logical_path = file.relative_path_from(path)
- mapped[logical_path.to_s] ||= Propshaft::Asset.new(file, logical_path: logical_path, version: version)
+ asset = Propshaft::Asset.new(file, logical_path: logical_path, version: version)
+ mapped[asset.logical_path.to_s] ||= asset
end if path.exist?
end
end
end