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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5a549346a2a0e4f7ca92805c4a632cb3a7e1dab47ba77f2f33fc470f202f89ef
4
- data.tar.gz: 01de6b58b7d4a265714ca4ff668b8a579601517dc434279367d101fa058f7641
3
+ metadata.gz: ead6c1bc5d65a8ac7552b06b999aab683b57855681cbe562bb10c4b98d39c8ab
4
+ data.tar.gz: 83ccd5807f447452ceb19c37edc8edc38d98a83eed1c40b9792ff1458af03fb4
5
5
  SHA512:
6
- metadata.gz: f42175a8c4726873851f901aebce71b4df2b60550735ccca0252bb548b9c183c8be73e66b746fd64531bd86feef20e1798e38f144194a67832b92061d2ffc6c1
7
- data.tar.gz: 81ec91c72c4af89016f35034028ef83a745a225321567d0d866ff914bb8580c45743f678907b7a3b712129eef5b9fbff807767b8b5f46f1f7f24fbcf3845925d
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? && defined?(Rails::Server)
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('hotwire-livereload',
85
- target: 'hotwire-livereload',
86
- partial: 'hotwire/livereload/turbo_stream',
87
- locals: locals)
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
@@ -1,5 +1,5 @@
1
1
  module Hotwire
2
2
  module Livereload
3
- VERSION = "1.2.1"
3
+ VERSION = "1.2.2"
4
4
  end
5
5
  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.1
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-07-27 00:00:00.000000000 Z
11
+ date: 2022-08-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails