hotwire-livereload 0.1.0 → 0.1.1
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 +12 -12
- data/lib/hotwire/livereload/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 757248475a762e66a83a9fa3197d20d7a85d022d231777354452b484b3ce881a
|
4
|
+
data.tar.gz: ad896fa7edfe33574afe3b20640330b406d7c45473d3b20476e828489826dd4f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cb6075bb64a45a75a6a284df02c058f40ce97d79aa88e02f442bf87e90e5f2441ed45e3b30efff27b5d765cd8987707a279717e0c37574e9738180da896e9d23
|
7
|
+
data.tar.gz: 0c2ffb6cbb134f97152e029877a4a010a7e366ea1462ffd4bc3eff9dada8c7dd5cfd2f8b916f9b74dafdd4ca0c9e650a45b345ebd73ce451e4f9aa602eedea74
|
@@ -42,23 +42,23 @@ module Hotwire
|
|
42
42
|
end
|
43
43
|
|
44
44
|
config.after_initialize do |app|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
45
|
+
if Rails.env.development?
|
46
|
+
@listener = Listen.to(*app.config.hotwire_livereload.listen_paths) do |modified, added, removed|
|
47
|
+
if modified.any? || removed.any? || added.any?
|
48
|
+
Hotwire::Livereload::Engine.websocket.broadcast(
|
49
|
+
"reload",
|
50
|
+
{ modified: modified, removed: removed, added: added }
|
51
|
+
)
|
52
|
+
end
|
53
53
|
end
|
54
|
+
@listener.start
|
54
55
|
end
|
55
|
-
@listener.start
|
56
56
|
end
|
57
57
|
|
58
58
|
at_exit do
|
59
|
-
|
60
|
-
|
61
|
-
|
59
|
+
if Rails.env.development?
|
60
|
+
@listener&.stop
|
61
|
+
end
|
62
62
|
end
|
63
63
|
|
64
64
|
class << self
|