hotwire-livereload 1.2.1 → 1.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/hotwire/livereload/engine.rb +14 -5
- data/lib/hotwire/livereload/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ead6c1bc5d65a8ac7552b06b999aab683b57855681cbe562bb10c4b98d39c8ab
|
4
|
+
data.tar.gz: 83ccd5807f447452ceb19c37edc8edc38d98a83eed1c40b9792ff1458af03fb4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 45b04a4fc7d86601d100711a5abf35a2c0dbd3c8eacba88f40b1e1b9ec981ec732aa75b09a712ce32d29bafeb1d84d61b078527f06cb7bd9db6ee6d18d57b25f
|
7
|
+
data.tar.gz: dbd98fdd5fcc07dd7e76ad0a45e05c58c407955c900ed84ddb07ba1b5dfbc6b2bd1e74606c5cfe88916d14c39bbe572b921a0b197cd407e06e7ba6a6db8bc315
|
@@ -47,7 +47,7 @@ module Hotwire
|
|
47
47
|
end
|
48
48
|
|
49
49
|
config.after_initialize do |app|
|
50
|
-
if Rails.env.development? &&
|
50
|
+
if Rails.env.development? && Hotwire::Livereload.server_process?
|
51
51
|
options = app.config.hotwire_livereload
|
52
52
|
listen_paths = options.listen_paths.map(&:to_s).uniq
|
53
53
|
force_reload_paths = options.force_reload_paths.map(&:to_s).uniq.join("|")
|
@@ -81,14 +81,23 @@ module Hotwire
|
|
81
81
|
end
|
82
82
|
|
83
83
|
def self.turbo_stream(locals)
|
84
|
-
Turbo::StreamsChannel.broadcast_replace_to(
|
85
|
-
|
86
|
-
|
87
|
-
|
84
|
+
Turbo::StreamsChannel.broadcast_replace_to(
|
85
|
+
"hotwire-livereload",
|
86
|
+
target: "hotwire-livereload",
|
87
|
+
partial: "hotwire/livereload/turbo_stream",
|
88
|
+
locals: locals
|
89
|
+
)
|
88
90
|
end
|
89
91
|
|
90
92
|
def self.action_cable(opts)
|
91
93
|
ActionCable.server.broadcast("hotwire-reload", opts)
|
92
94
|
end
|
95
|
+
|
96
|
+
def self.server_process?
|
97
|
+
puma_process = defined?(::Puma) && File.basename($0) == "puma"
|
98
|
+
rails_server = defined?(Rails::Server)
|
99
|
+
|
100
|
+
puma_process || rails_server
|
101
|
+
end
|
93
102
|
end
|
94
103
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hotwire-livereload
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kirill Platonov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-08-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|