From 2a6e01d72f7268e04fc6233e77276ee829c95938 Mon Sep 17 00:00:00 2001 From: Jorge Manrubia Date: Fri, 20 Dec 2024 11:24:19 +0100 Subject: [PATCH] Bump version --- lib/hotwire-spark.rb | 2 +- lib/hotwire/spark/engine.rb | 2 +- test/test_helper.rb | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/hotwire-spark.rb b/lib/hotwire-spark.rb index 84405992..bb9df7a8 100644 --- a/lib/hotwire-spark.rb +++ b/lib/hotwire-spark.rb @@ -21,7 +21,7 @@ def install_into(application) end def enabled? - enabled + enabled && defined?(Rails::Server) end end end diff --git a/lib/hotwire/spark/engine.rb b/lib/hotwire/spark/engine.rb index ff308a2a..677c3a9e 100644 --- a/lib/hotwire/spark/engine.rb +++ b/lib/hotwire/spark/engine.rb @@ -7,7 +7,7 @@ class Engine < ::Rails::Engine config.hotwire = ActiveSupport::OrderedOptions.new unless config.respond_to?(:hotwire) config.hotwire.spark = ActiveSupport::OrderedOptions.new config.hotwire.spark.merge! \ - enabled: Rails.env.development? && defined?(Rails::Server), + enabled: Rails.env.development?, css_paths: File.directory?("app/assets/builds") ? %w[ app/assets/builds ] : %w[ app/assets/stylesheets ], html_paths: %w[ app/controllers app/helpers app/models app/views ], stimulus_paths: %w[ app/javascript/controllers ] diff --git a/test/test_helper.rb b/test/test_helper.rb index 7952c8e2..cafb8acc 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -16,6 +16,8 @@ require "helpers/files_helper" +::ActionCable::Server::Base.prepend(Hotwire::Spark::ActionCable::PersistentCableServer) + class ActiveSupport::TestCase include FilesHelper