spring 4.2.0 → 4.3.0
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 +4 -4
- data/lib/spring/application.rb +5 -0
- data/lib/spring/application_manager.rb +2 -1
- data/lib/spring/client/run.rb +4 -6
- data/lib/spring/configuration.rb +4 -1
- data/lib/spring/json.rb +2 -3
- data/lib/spring/version.rb +1 -1
- metadata +3 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3e92617adaa3e6c31e4d466d76894c94ec17a46fd7206864501218795ac8998d
|
4
|
+
data.tar.gz: aee2d23a222df8747942652dda1d6a725f59bb68b395fbd37a9084c5ed75fe7b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 16e03232e4453b528812c925c4186360e1157b10aab0d663d1dc3d4a80a7d4bdf1da8f06d31c6ace1456fa4f6f5e20b2c62637ce0a23da6cae705b56baa6882b
|
7
|
+
data.tar.gz: 1a4c70a381783cc3f96372e28efc6b702b3b75a28c31a1a88eacace55c3a3cbd2aee3d3ff81236526366149a612754c22d9ec0861bc0a3dfb8669108f9bb0aba
|
data/lib/spring/application.rb
CHANGED
@@ -124,6 +124,11 @@ module Spring
|
|
124
124
|
|
125
125
|
if defined?(Rails) && Rails.application
|
126
126
|
watcher.add Rails.application.paths["config/initializers"]
|
127
|
+
Rails::Engine.descendants.each do |engine|
|
128
|
+
if engine.root.to_s.start_with?(Rails.root.to_s)
|
129
|
+
watcher.add engine.paths["config/initializers"].expanded
|
130
|
+
end
|
131
|
+
end
|
127
132
|
watcher.add Rails.application.paths["config/database"]
|
128
133
|
if secrets_path = Rails.application.paths["config/secrets"]
|
129
134
|
watcher.add secrets_path
|
@@ -126,7 +126,8 @@ module Spring
|
|
126
126
|
# as if it does we're no longer interested in the child
|
127
127
|
loop do
|
128
128
|
IO.select([child])
|
129
|
-
|
129
|
+
peek = child.recv(1, Socket::MSG_PEEK)
|
130
|
+
break if peek.nil? || peek.empty?
|
130
131
|
sleep 0.01
|
131
132
|
end
|
132
133
|
|
data/lib/spring/client/run.rb
CHANGED
@@ -6,8 +6,6 @@ module Spring
|
|
6
6
|
module Client
|
7
7
|
class Run < Command
|
8
8
|
FORWARDED_SIGNALS = %w(INT QUIT USR1 USR2 INFO WINCH) & Signal.list.keys
|
9
|
-
CONNECT_TIMEOUT = 1
|
10
|
-
BOOT_TIMEOUT = 20
|
11
9
|
|
12
10
|
attr_reader :server
|
13
11
|
|
@@ -74,7 +72,7 @@ module Spring
|
|
74
72
|
env.socket_path.unlink if env.socket_path.exist?
|
75
73
|
|
76
74
|
pid = Process.spawn(server_process_env, env.server_command, out: File::NULL)
|
77
|
-
timeout = Time.now +
|
75
|
+
timeout = Time.now + Spring.boot_timeout
|
78
76
|
|
79
77
|
@server_booted = true
|
80
78
|
|
@@ -85,7 +83,7 @@ module Spring
|
|
85
83
|
exit status.exitstatus
|
86
84
|
elsif Time.now > timeout
|
87
85
|
$stderr.puts "Starting Spring server with `#{env.server_command}` " \
|
88
|
-
"timed out after #{
|
86
|
+
"timed out after #{Spring.boot_timeout} seconds"
|
89
87
|
exit 1
|
90
88
|
end
|
91
89
|
|
@@ -122,7 +120,7 @@ module Spring
|
|
122
120
|
end
|
123
121
|
|
124
122
|
def verify_server_version
|
125
|
-
unless IO.select([server], [], [],
|
123
|
+
unless IO.select([server], [], [], Spring.connect_timeout)
|
126
124
|
raise "Error connecting to Spring server"
|
127
125
|
end
|
128
126
|
|
@@ -151,7 +149,7 @@ module Spring
|
|
151
149
|
server.send_io client
|
152
150
|
send_json server, "args" => args, "default_rails_env" => default_rails_env, "spawn_env" => spawn_env, "reset_env" => reset_env
|
153
151
|
|
154
|
-
if IO.select([server], [], [],
|
152
|
+
if IO.select([server], [], [], Spring.connect_timeout)
|
155
153
|
server.gets or raise CommandNotFound
|
156
154
|
else
|
157
155
|
raise "Error connecting to Spring server"
|
data/lib/spring/configuration.rb
CHANGED
data/lib/spring/json.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
3
|
# ### WHY SPRING VENDORS A JSON LIBRARY ###
|
4
4
|
#
|
@@ -13,7 +13,6 @@
|
|
13
13
|
module Spring
|
14
14
|
module JSON
|
15
15
|
def self.load(string)
|
16
|
-
string.force_encoding("utf-8")
|
17
16
|
OkJson.decode(string)
|
18
17
|
end
|
19
18
|
|
@@ -364,7 +363,7 @@ private
|
|
364
363
|
end
|
365
364
|
end
|
366
365
|
if rubydoesenc?
|
367
|
-
a[w] = '' << uchar
|
366
|
+
a[w] = +'' << uchar
|
368
367
|
w += 1
|
369
368
|
else
|
370
369
|
w += ucharenc(a, w, uchar)
|
data/lib/spring/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spring
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jon Leighton
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 2025-03-12 00:00:00.000000000 Z
|
12
11
|
dependencies: []
|
13
12
|
description: Preloads your application so things like console, rake and tests run
|
14
13
|
faster
|
@@ -57,7 +56,6 @@ licenses:
|
|
57
56
|
- MIT
|
58
57
|
metadata:
|
59
58
|
rubygems_mfa_required: 'true'
|
60
|
-
post_install_message:
|
61
59
|
rdoc_options: []
|
62
60
|
require_paths:
|
63
61
|
- lib
|
@@ -72,8 +70,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
72
70
|
- !ruby/object:Gem::Version
|
73
71
|
version: '0'
|
74
72
|
requirements: []
|
75
|
-
rubygems_version: 3.
|
76
|
-
signing_key:
|
73
|
+
rubygems_version: 3.6.2
|
77
74
|
specification_version: 4
|
78
75
|
summary: Rails application preloader
|
79
76
|
test_files: []
|