spring 4.1.0 → 4.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +6 -3
- 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 +3 -7
- data/lib/spring/watcher/polling.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1fb5e5ae37f6bcecf6171f7b6118522938b6e6a7d8fcf68f8484d73c7d4e33a0
|
4
|
+
data.tar.gz: 62a6410c2df8ca87c41d612d6470e9bf93dbbbab37ac1c717807173771fcb02c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
|
@@ -71,11 +71,14 @@ Rails directory.
|
|
71
71
|
Spring reloads application code, and therefore needs the application to have
|
72
72
|
reloading enabled.
|
73
73
|
|
74
|
-
|
74
|
+
Ensure that `config.enable_reloading` is `true` in the environments that
|
75
75
|
Spring manages. That setting is typically configured in
|
76
|
-
`config/environments/*.rb`. In particular, make sure it is `
|
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.1, the setting is called `cache_classes`,
|
80
|
+
and it needs to be `false` for Spring to work.
|
81
|
+
|
79
82
|
### Usage
|
80
83
|
|
81
84
|
For this walkthrough I've generated a new Rails application, and run
|
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 = {}
|
@@ -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?
|
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.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jon Leighton
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-11-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -99,7 +99,7 @@ licenses:
|
|
99
99
|
- MIT
|
100
100
|
metadata:
|
101
101
|
rubygems_mfa_required: 'true'
|
102
|
-
post_install_message:
|
102
|
+
post_install_message:
|
103
103
|
rdoc_options: []
|
104
104
|
require_paths:
|
105
105
|
- lib
|
@@ -115,7 +115,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
115
115
|
version: '0'
|
116
116
|
requirements: []
|
117
117
|
rubygems_version: 3.3.7
|
118
|
-
signing_key:
|
118
|
+
signing_key:
|
119
119
|
specification_version: 4
|
120
120
|
summary: Rails application preloader
|
121
121
|
test_files: []
|