spring 4.1.1 → 4.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/spring/application.rb +20 -7
- data/lib/spring/client/binstub.rb +1 -1
- data/lib/spring/version.rb +1 -1
- data/lib/spring/watcher/abstract.rb +8 -7
- data/lib/spring/watcher/polling.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1aaab82742a464eba8cafc32761c1f8509c661d3eae8816c7ce37402b1e454ba
|
4
|
+
data.tar.gz: dca019edd6550c1ce7d514da586df59a3c3838d1f36d113e9870cdf44052a655
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 52b2c4a44be6f82f5c4877af16c52aacf98cf28641210dde453439e7e2d9ded480bc7ceb1e58465d30e8992b1bd88a8b591246bcfc66708c722fd5692c7c98a6
|
7
|
+
data.tar.gz: abb5569bb5d37f570003ba7784f181afd0598249cddc3c1519e2df63368b8db3a540119c8fedccb599c095a2b3c07dee5df0e0a09c09c30f551ccdf7e7f45f7b
|
data/README.md
CHANGED
@@ -16,7 +16,7 @@ boot it every time you run a test, rake task or migration.
|
|
16
16
|
|
17
17
|
## Compatibility
|
18
18
|
|
19
|
-
* Ruby versions: MRI 2.7, MRI 3.0, MRI 3.1
|
19
|
+
* Ruby versions: MRI 2.7, MRI 3.0, MRI 3.1, MRI 3.2
|
20
20
|
* Rails versions: 6.0, 6.1, 7.0
|
21
21
|
* Bundler v2.1+
|
22
22
|
|
@@ -76,7 +76,7 @@ Spring manages. That setting is typically configured in
|
|
76
76
|
`config/environments/*.rb`. In particular, make sure it is `true` for the
|
77
77
|
`test` environment.
|
78
78
|
|
79
|
-
Note: in versions of Rails before 7, the setting is called `cache_classes`,
|
79
|
+
Note: in versions of Rails before 7.1, the setting is called `cache_classes`,
|
80
80
|
and it needs to be `false` for Spring to work.
|
81
81
|
|
82
82
|
### Usage
|
data/lib/spring/application.rb
CHANGED
@@ -302,13 +302,26 @@ module Spring
|
|
302
302
|
Kernel.module_eval do
|
303
303
|
old_raise = Kernel.method(:raise)
|
304
304
|
remove_method :raise
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
305
|
+
if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.2.0')
|
306
|
+
define_method :raise do |*args, **kwargs|
|
307
|
+
begin
|
308
|
+
old_raise.call(*args, **kwargs)
|
309
|
+
ensure
|
310
|
+
if $!
|
311
|
+
lib = File.expand_path("..", __FILE__)
|
312
|
+
$!.backtrace.reject! { |line| line.start_with?(lib) } unless $!.backtrace.frozen?
|
313
|
+
end
|
314
|
+
end
|
315
|
+
end
|
316
|
+
else
|
317
|
+
define_method :raise do |*args|
|
318
|
+
begin
|
319
|
+
old_raise.call(*args)
|
320
|
+
ensure
|
321
|
+
if $!
|
322
|
+
lib = File.expand_path("..", __FILE__)
|
323
|
+
$!.backtrace.reject! { |line| line.start_with?(lib) } unless $!.backtrace.frozen?
|
324
|
+
end
|
312
325
|
end
|
313
326
|
end
|
314
327
|
end
|
@@ -20,7 +20,7 @@ module Spring
|
|
20
20
|
SPRING = <<~CODE
|
21
21
|
#!/usr/bin/env ruby
|
22
22
|
|
23
|
-
# This file loads Spring without
|
23
|
+
# This file loads Spring without loading other gems in the Gemfile in order to be fast.
|
24
24
|
# It gets overwritten when you run the `spring binstub` command.
|
25
25
|
|
26
26
|
if !defined?(Spring) && [nil, "development", "test"].include?(ENV["RAILS_ENV"])
|
data/lib/spring/version.rb
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
require "pathname"
|
2
|
-
require "mutex_m"
|
3
2
|
|
4
3
|
module Spring
|
5
4
|
module Watcher
|
@@ -9,13 +8,10 @@ module Spring
|
|
9
8
|
# IO.select([watcher]) # watcher is running in background
|
10
9
|
# watcher.stale? # => true
|
11
10
|
class Abstract
|
12
|
-
include Mutex_m
|
13
|
-
|
14
11
|
attr_reader :files, :directories, :root, :latency
|
15
12
|
|
16
13
|
def initialize(root, latency)
|
17
|
-
|
18
|
-
|
14
|
+
@mutex = Mutex.new
|
19
15
|
@root = File.realpath(root)
|
20
16
|
@latency = latency
|
21
17
|
@files = {}
|
@@ -26,6 +22,11 @@ module Spring
|
|
26
22
|
@on_debug = nil
|
27
23
|
end
|
28
24
|
|
25
|
+
def synchronize(&block)
|
26
|
+
# Used by some gems.
|
27
|
+
@mutex.synchronize(&block)
|
28
|
+
end
|
29
|
+
|
29
30
|
def on_debug(&block)
|
30
31
|
@on_debug = block
|
31
32
|
end
|
@@ -59,7 +60,7 @@ module Spring
|
|
59
60
|
end
|
60
61
|
end
|
61
62
|
|
62
|
-
synchronize
|
63
|
+
@mutex.synchronize do
|
63
64
|
items.each do |item|
|
64
65
|
if item.directory?
|
65
66
|
directories[item.realpath.to_s] = true
|
@@ -75,7 +76,7 @@ module Spring
|
|
75
76
|
end
|
76
77
|
|
77
78
|
subjects_changed
|
78
|
-
|
79
|
+
end
|
79
80
|
end
|
80
81
|
|
81
82
|
def stale?
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spring
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.1.
|
4
|
+
version: 4.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jon Leighton
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-11-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -114,7 +114,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
114
114
|
- !ruby/object:Gem::Version
|
115
115
|
version: '0'
|
116
116
|
requirements: []
|
117
|
-
rubygems_version: 3.
|
117
|
+
rubygems_version: 3.3.7
|
118
118
|
signing_key:
|
119
119
|
specification_version: 4
|
120
120
|
summary: Rails application preloader
|