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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e80daa28376d668cb49288182ab69de36a544c0367deab64359e99d1b1c5cb8e
4
- data.tar.gz: ba7057fa9ce97ea7801b5c993ff3172ff0fb0ba7820474fb0be467c01900d333
3
+ metadata.gz: 757248475a762e66a83a9fa3197d20d7a85d022d231777354452b484b3ce881a
4
+ data.tar.gz: ad896fa7edfe33574afe3b20640330b406d7c45473d3b20476e828489826dd4f
5
5
  SHA512:
6
- metadata.gz: 4eb10a968fa542b584bdd0184be9ecf6740b2633d2481f61df65681b7e476ae8273770d58b9a3a56d05baf6c2773d9fb9e9508263e179f3954d9fe86604b7d18
7
- data.tar.gz: 34a454aa9316357d37b89754394457b06ad5c3cf4b694bee5ce0e954d072b8f535341811c3d613a0f4f5114463e9e0239a6c2db98c3005eedb47db96af4ec803
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
- return unless Rails.env.development?
46
-
47
- @listener = Listen.to(*app.config.hotwire_livereload.listen_paths) do |modified, added, removed|
48
- if modified.any? || removed.any? || added.any?
49
- Hotwire::Livereload::Engine.websocket.broadcast(
50
- "reload",
51
- { modified: modified, removed: removed, added: added }
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
- return unless Rails.env.development?
60
-
61
- @listener&.stop
59
+ if Rails.env.development?
60
+ @listener&.stop
61
+ end
62
62
  end
63
63
 
64
64
  class << self
@@ -1,5 +1,5 @@
1
1
  module Hotwire
2
2
  module Livereload
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hotwire-livereload
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kirill Platonov