lib/lookbook/engine.rb in lookbook-2.0.0.beta.3 vs lib/lookbook/engine.rb in lookbook-2.0.0.beta.4
- old
+ new
@@ -77,11 +77,14 @@
def reloading?
opts.reload_on_change
end
def auto_refresh?
- reloading? && runtime_context.web? && FileWatcher.evented?
+ opts.live_updates == true &&
+ reloading? &&
+ runtime_context.web? &&
+ FileWatcher.evented?
end
def preview_embeds_allowed?
opts.preview_embeds.enabled == true && opts.preview_embeds.policy != "DENY"
end
@@ -128,11 +131,11 @@
Rails.application.config
end
def view_paths
# handle view path registry changes in Rails 7.1
- paths = if defined?(ActionView::ViewPaths::Registry)
- ActionView::ViewPaths::Registry.all_file_system_resolvers.map(&:path)
+ paths = if defined?(ActionView::PathRegistry)
+ ActionView::PathRegistry.all_file_system_resolvers.map(&:path)
else
ActionView::ViewPaths.all_view_paths.flat_map(&paths)
end
paths.map { |path| Pathname(path.to_s) }
end