spring 4.4.0 → 4.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 98db88859d325bff2e76e6569e05eb10bf89baf2a07ab47f43eb6548e8ca8f1c
4
- data.tar.gz: 01e6ec88fa814c0bfe8f737a71164301b59681ea909de9bcf9fe5516eca1a2ee
3
+ metadata.gz: def7b2369b2bfd2e89227a11ab9fab2a336b10011ec8b51a82319828e73ecee4
4
+ data.tar.gz: 58e3868998fe06b76e2e6a86cd5274aabdd5f315395aae004e5cfd3d488708ca
5
5
  SHA512:
6
- metadata.gz: ebb7f95463b29f0e8c2995e19b101f0730cd0aa98ea51496fb6f8bd624253a3e4536dd5664ad2ea8ec5348cf074eb9b79f798b4b3b38adb6c717cc3ad73ca6b1
7
- data.tar.gz: e01d2b58bbace569bfdcacec81b852427a5bdf5efdf724be560598f13dbabbf32502aec90aa899d0fdf3b16e0255a1ada40d9b0ac7a4cb74a3d3f6f1352342c4
6
+ metadata.gz: 4e48694be64ae52918a2a82c61d5e0ba1bec2c826123b697e789abcf74c38d7d8d6162b32b64ccd8694855e2bb4cf29af5147a2ea34fd96163c95fd4405940c7
7
+ data.tar.gz: '054845db5469efb81a6fc0a9775dcbaa0518153e51a13807a2e340a470b5ac100cd01f51f99b9676ccae1b395fd2b57bb3306d65410f1587999481ed40052d80'
data/README.md CHANGED
@@ -17,7 +17,7 @@ boot it every time you run a test, rake task or migration.
17
17
  ## Compatibility
18
18
 
19
19
  * Ruby versions: MRI 3.1+
20
- * Rails versions: 6.0+
20
+ * Rails versions: 7.1+
21
21
  * Bundler v2.1+
22
22
 
23
23
  Spring makes extensive use of `Process.fork`, so won't be able to
@@ -129,8 +129,9 @@ module Spring
129
129
 
130
130
  if defined?(Rails) && Rails.application
131
131
  watcher.add Rails.application.paths["config/initializers"]
132
- Rails::Engine.descendants.each do |engine|
133
- if engine.root.to_s.start_with?(Rails.root.to_s)
132
+ rails_root = Rails.root.to_s
133
+ Rails::Engine.subclasses.each do |engine|
134
+ if engine.root.to_s.start_with?(rails_root)
134
135
  watcher.add engine.paths["config/initializers"].expanded
135
136
  end
136
137
  end
@@ -377,10 +378,10 @@ module Spring
377
378
  Spring.failsafe_thread {
378
379
  begin
379
380
  _, status = Process.wait2 pid
380
- log "#{pid} exited with #{status.exitstatus}"
381
+ log "#{pid} exited with #{status.exitstatus || status.inspect}"
381
382
 
382
383
  streams.each(&:close)
383
- client.puts(status.exitstatus)
384
+ client.puts(status.exitstatus || status.to_i)
384
385
  client.close
385
386
  ensure
386
387
  @mutex.synchronize { @waiting.delete pid }
@@ -102,7 +102,7 @@ module Spring
102
102
  "RACK_ENV" => app_env,
103
103
  "SPRING_ORIGINAL_ENV" => JSON.dump(Spring::ORIGINAL_ENV),
104
104
  "SPRING_PRELOAD" => preload ? "1" : "0",
105
- "SPRING_SPAWN_ENV" => JSON.dump(spawn_env),
105
+ "SPRING_SPAWN_ENV" => JSON.dump(spawn_env.compact),
106
106
  **spawn_env,
107
107
  },
108
108
  "ruby",
@@ -184,11 +184,16 @@ module Spring
184
184
  suspend_resume_on_tstp_cont(pid)
185
185
 
186
186
  forward_signals(application)
187
- status = application.read.to_i
187
+ status = application.read
188
+ log "got exit status #{status.inspect}"
188
189
 
189
- log "got exit status #{status}"
190
+ # Status should always be an integer. If it is empty, something unexpected must have happened to the server.
191
+ if status.to_s.strip.empty?
192
+ log "unexpected empty exit status, app crashed?"
193
+ exit 1
194
+ end
190
195
 
191
- exit status
196
+ exit status.to_i
192
197
  else
193
198
  log "got no pid"
194
199
  exit 1
@@ -249,7 +254,9 @@ module Spring
249
254
  end
250
255
 
251
256
  def spawn_env
252
- ENV.slice(*Spring.spawn_on_env)
257
+ Spring.spawn_on_env.to_h do |key|
258
+ [key, ENV[key]]
259
+ end
253
260
  end
254
261
  end
255
262
  end
@@ -1,3 +1,3 @@
1
1
  module Spring
2
- VERSION = "4.4.0"
2
+ VERSION = "4.4.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spring
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.4.0
4
+ version: 4.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jon Leighton