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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 76dbc0667df96e4ee560e9613dba5fbdf1dd1733eb93b4cfa8e9b9abe0ce4b88
4
- data.tar.gz: 072b98f72493233f29ad64e034070ad4910807cd13d133772d29b1b1588e87ad
3
+ metadata.gz: 3e92617adaa3e6c31e4d466d76894c94ec17a46fd7206864501218795ac8998d
4
+ data.tar.gz: aee2d23a222df8747942652dda1d6a725f59bb68b395fbd37a9084c5ed75fe7b
5
5
  SHA512:
6
- metadata.gz: 631a222c8b71faf7f115576537d857bd5e0d4824a9bdcc09ffcb694ef737af0af6570dfb112178efec1bbde9a1d5582bcfabfb1cd2ef8ea94b1404558580bd6d
7
- data.tar.gz: c4d7ebbacf5c6b0a00263b96328e13160cfcea8033cb54ef4247d9aca3ee7f7c1f7d17a57865b10c24847c1653e99c61b37d2a8b130b45536aff994257944269
6
+ metadata.gz: 16e03232e4453b528812c925c4186360e1157b10aab0d663d1dc3d4a80a7d4bdf1da8f06d31c6ace1456fa4f6f5e20b2c62637ce0a23da6cae705b56baa6882b
7
+ data.tar.gz: 1a4c70a381783cc3f96372e28efc6b702b3b75a28c31a1a88eacace55c3a3cbd2aee3d3ff81236526366149a612754c22d9ec0861bc0a3dfb8669108f9bb0aba
@@ -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
- break if child.recv(1, Socket::MSG_PEEK).empty?
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
 
@@ -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 + BOOT_TIMEOUT
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 #{BOOT_TIMEOUT} seconds"
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], [], [], CONNECT_TIMEOUT)
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], [], [], CONNECT_TIMEOUT)
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"
@@ -1,8 +1,11 @@
1
1
  require "spring/errors"
2
2
 
3
3
  module Spring
4
+ @connect_timeout = 5
5
+ @boot_timeout = 20
6
+
4
7
  class << self
5
- attr_accessor :application_root
8
+ attr_accessor :application_root, :connect_timeout, :boot_timeout
6
9
  attr_writer :quiet
7
10
 
8
11
  def gemfile
data/lib/spring/json.rb CHANGED
@@ -1,4 +1,4 @@
1
- # encoding: UTF-8
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)
@@ -1,3 +1,3 @@
1
1
  module Spring
2
- VERSION = "4.2.0"
2
+ VERSION = "4.3.0"
3
3
  end
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.2.0
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: 2024-04-09 00:00:00.000000000 Z
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.3.7
76
- signing_key:
73
+ rubygems_version: 3.6.2
77
74
  specification_version: 4
78
75
  summary: Rails application preloader
79
76
  test_files: []