lib/lookbook/engine.rb in lookbook-0.8.2 vs lib/lookbook/engine.rb in lookbook-0.8.3
- old
+ new
@@ -51,11 +51,11 @@
options.listen = Rails.env.development? if options.listen.nil?
options.listen_paths = options.listen_paths.map(&:to_s)
options.listen_paths += options.preview_paths
options.listen_paths << (vc_options.view_component_path || Rails.root.join("app/components"))
- options.listen_paths.filter! { |path| Dir.exist? path }
+ options.listen_paths.select! { |path| Dir.exist? path }
options.cable_mount_path ||= "/lookbook-cable"
options.cable_logger ||= Rails.logger
options.runtime_parsing = !Rails.env.production? if options.runtime_parsing.nil?
@@ -93,10 +93,10 @@
})
end
@preview_listener.start
if Lookbook::Features.enabled?(:pages)
- @page_listener = Listen.to(*config.lookbook.page_paths.filter { |dir| Dir.exist? dir }, only: /\.(html.*|md.*)$/) do |modified, added, removed|
+ @page_listener = Listen.to(*config.lookbook.page_paths.select { |dir| Dir.exist? dir }, only: /\.(html.*|md.*)$/) do |modified, added, removed|
Lookbook::Engine.websocket&.broadcast("reload", {
modified: modified,
removed: removed,
added: added
})