isomorfeus-asset-manager 0.14.15 → 0.14.16

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: 2d12a6934f43c1c263059200fe3fae784c11235faeee871bd439e71ec4bd4e40
4
- data.tar.gz: e952047d1849071d3e46cb8f2a7b49039f8c60099d4e7f7877301ff9e3d2223a
3
+ metadata.gz: 7befddccb82a796903ddfebc8b93cfbff34b59358a33b80406b7a735a1d9e080
4
+ data.tar.gz: 8b27f42102ca6596338a15efc3f2c6c5779e92e4036b38b75b9aa8fe1aee7e49
5
5
  SHA512:
6
- metadata.gz: cc5328b6425a14068d993b276c67752e9a4658e37f036b7acc941022ea6be7136ed3c0a0f449e15af417c9c19810f60300a6c44b69fba458909e448d32aec605
7
- data.tar.gz: e68a2ad8c0b69756b37f656f39befc1b8acee6ac9d792a583c8923adfbdf77b510f39b5bf188372f75c850d51569a2c64cc71ff958448a26917ab5d4c76a9f8b
6
+ metadata.gz: 669c7fa2ec213c9b37f4f6f9a89a5efbc4a0992794ac7d039798aa84f944819b1b55d30e19fcbbfe1f2b0689f110a64f8f8122a2b3d4df099f9ed2093536bdee
7
+ data.tar.gz: b3dec9544fae51330b122b6f38687076bccace87c4bd7d0cd5c2f50e8ff260d46e58a704b9a38f03b65df4c2a54f76b0c213f56d058bd4dac4d0cc31087db6e2
@@ -61,6 +61,18 @@ module Isomorfeus
61
61
  def test?
62
62
  @test
63
63
  end
64
+
65
+ def server_requires_reload?
66
+ @server_requires_reload
67
+ end
68
+
69
+ def server_reloaded!
70
+ @server_requires_reload = false
71
+ end
72
+
73
+ def server_requires_reload!
74
+ @server_requires_reload = true
75
+ end
64
76
  end
65
77
  end
66
78
 
@@ -1,5 +1,5 @@
1
1
  module Isomorfeus
2
2
  class AssetManager
3
- VERSION = '0.14.15'
3
+ VERSION = '0.14.16'
4
4
  end
5
5
  end
@@ -125,22 +125,27 @@ module Isomorfeus
125
125
  am_class = self.class
126
126
  Isomorfeus.hmr_listener = Listen.to(*listen_dirs) do |modified, added, _|
127
127
  (modified + added).each do |file|
128
- next if file.start_with?(@server_path)
129
- begin
130
- if file.end_with?('.rb')
131
- Isomorfeus.assets.each_value { |asset| asset.unbundle! }
132
- update = compile_ruby(file)
133
- update_json = Oj.dump(update, mode: :strict)
134
- elsif file.end_with?('.yml') || file.end_with?('.mo') || file.end_with?('.po')
135
- update_json = Oj.dump({ locale: file }, mode: :strict)
136
- else
137
- update_json = Oj.dump({ error: "Don't know how to update #{file}!" }, mode: :strict)
128
+ if file.start_with?(@server_path)
129
+ Isomorfeus.server_requires_reload!
130
+ else
131
+ begin
132
+ if file.end_with?('.rb')
133
+ Isomorfeus.server_requires_reload!
134
+ Isomorfeus.assets.each_value { |asset| asset.unbundle! }
135
+ update = compile_ruby(file)
136
+ update_json = Oj.dump(update, mode: :strict)
137
+ elsif file.end_with?('.yml') || file.end_with?('.mo') || file.end_with?('.po')
138
+ Isomorfeus.server_requires_reload!
139
+ update_json = Oj.dump({ locale: file }, mode: :strict)
140
+ else
141
+ update_json = Oj.dump({ error: "Don't know how to update #{file}!" }, mode: :strict)
142
+ end
143
+ Iodine.publish(Isomorfeus.asset_manager_hmr_channel, update_json)
144
+ rescue Exception => e
145
+ message = "Isomorfeus Asset Manager during hot module update:\n#{e.class}\n#{e.message}\n#{e.backtrace.join("\n")}"
146
+ STDERR.puts message
147
+ Iodine.publish(Isomorfeus.asset_manager_hmr_channel, Oj.dump({ error: message }, mode: :strict))
138
148
  end
139
- Iodine.publish(Isomorfeus.asset_manager_hmr_channel, update_json)
140
- rescue Exception => e
141
- message = "Isomorfeus Asset Manager during hot module update:\n#{e.class}\n#{e.message}\n#{e.backtrace.join("\n")}"
142
- STDERR.puts message
143
- Iodine.publish(Isomorfeus.asset_manager_hmr_channel, Oj.dump({ error: message }, mode: :strict))
144
149
  end
145
150
  end
146
151
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: isomorfeus-asset-manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.15
4
+ version: 0.14.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Biedermann
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-02-19 00:00:00.000000000 Z
11
+ date: 2022-02-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: brotli