spring 4.1.1 → 4.1.3

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: 557c3aebe1211983306061278ab800f1232e42d67a40bc4042c24560ff44409d
4
- data.tar.gz: 6c1cdb2f00e1f7893d0fbf60b49d76d8841dd9c931dfa79c45387ddbec1bea5b
3
+ metadata.gz: 1aaab82742a464eba8cafc32761c1f8509c661d3eae8816c7ce37402b1e454ba
4
+ data.tar.gz: dca019edd6550c1ce7d514da586df59a3c3838d1f36d113e9870cdf44052a655
5
5
  SHA512:
6
- metadata.gz: 1da8511a30a3802f6b96ce29b342e70bf136de411278624758a55b73140130902ad7e1afa488df1f48a06685b1980b0f5dd9b9185f27e36ec3d3ba43b9c27841
7
- data.tar.gz: c05785038b3a2a048c2b6e9f95f0979561c292714029ec58da934f1cd5e139b3e66b3da9d917082717e83891ac922292f636b53183de580672325b52c58665a9
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
@@ -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
- define_method :raise do |*args, **kwargs|
306
- begin
307
- old_raise.call(*args, **kwargs)
308
- ensure
309
- if $!
310
- lib = File.expand_path("..", __FILE__)
311
- $!.backtrace.reject! { |line| line.start_with?(lib) } unless $!.backtrace.frozen?
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 using loading other gems in the Gemfile, in order to be fast.
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"])
@@ -1,3 +1,3 @@
1
1
  module Spring
2
- VERSION = "4.1.1"
2
+ VERSION = "4.1.3"
3
3
  end
@@ -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
- super()
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?
@@ -12,7 +12,7 @@ module Spring
12
12
  end
13
13
 
14
14
  def check_stale
15
- synchronize do
15
+ @mutex.synchronize do
16
16
  computed = compute_mtime
17
17
  if mtime < computed
18
18
  debug { "check_stale: mtime=#{mtime.inspect} < computed=#{computed.inspect}" }
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.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-01-09 00:00:00.000000000 Z
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.1.2
117
+ rubygems_version: 3.3.7
118
118
  signing_key:
119
119
  specification_version: 4
120
120
  summary: Rails application preloader