spring 4.1.1 → 4.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 557c3aebe1211983306061278ab800f1232e42d67a40bc4042c24560ff44409d
4
- data.tar.gz: 6c1cdb2f00e1f7893d0fbf60b49d76d8841dd9c931dfa79c45387ddbec1bea5b
3
+ metadata.gz: 1fb5e5ae37f6bcecf6171f7b6118522938b6e6a7d8fcf68f8484d73c7d4e33a0
4
+ data.tar.gz: 62a6410c2df8ca87c41d612d6470e9bf93dbbbab37ac1c717807173771fcb02c
5
5
  SHA512:
6
- metadata.gz: 1da8511a30a3802f6b96ce29b342e70bf136de411278624758a55b73140130902ad7e1afa488df1f48a06685b1980b0f5dd9b9185f27e36ec3d3ba43b9c27841
7
- data.tar.gz: c05785038b3a2a048c2b6e9f95f0979561c292714029ec58da934f1cd5e139b3e66b3da9d917082717e83891ac922292f636b53183de580672325b52c58665a9
6
+ metadata.gz: 738706552c86e5dc6689f333b0d06598ca28e2018eea91e02c32c519b30be46ec96fe688223cc436734d8cc4a4ae77cb3816d05951e7d0724a4c2de169c64b27
7
+ data.tar.gz: be3196dadc9ea13b0748f5fa17e66084a1c9a7c19a36cf2b588d643585d5493dde016605b45b3fade7e1e7de58cfe95122b0db1801bfe013b8f0964ea654e860
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.2"
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 = {}
@@ -59,7 +55,7 @@ module Spring
59
55
  end
60
56
  end
61
57
 
62
- synchronize {
58
+ @mutex.synchronize do
63
59
  items.each do |item|
64
60
  if item.directory?
65
61
  directories[item.realpath.to_s] = true
@@ -75,7 +71,7 @@ module Spring
75
71
  end
76
72
 
77
73
  subjects_changed
78
- }
74
+ end
79
75
  end
80
76
 
81
77
  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.2
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-14 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