uncruft 0.6.2 → 0.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/uncruft/deprecation_handler.rb +7 -14
- data/lib/uncruft/railtie.rb +8 -4
- data/lib/uncruft/version.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: 256094a00a05b46db9837a089a6e3616a080bedf9c1a4490f11ead3d6b0733f3
|
4
|
+
data.tar.gz: 68dacd30c473ff88afc14b5d15f060c74601e33c7144694ed7536b58f1139a45
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 76217512c4706492767404883a02a2901284e4cbf80c6dc011f8e4fded6f9259de55cb324e82a7a9f79c6fb02a324796559e96b3948a44f63f6e56017e191a1e
|
7
|
+
data.tar.gz: 85beda4fa922f7a9208820e3e99d016f9fb5858f4876b16b4387091d38e71cad16bb2a2c156b43f97dc75a0c198630be7eb9528ae4c9effe46cde9ddbe07e4b8
|
@@ -30,7 +30,7 @@ module Uncruft
|
|
30
30
|
end
|
31
31
|
|
32
32
|
def line_number(message)
|
33
|
-
message
|
33
|
+
message[/called from( .+ at)? .+:(\d+)/, 2]
|
34
34
|
end
|
35
35
|
|
36
36
|
# Rails deprecation message formats found here:
|
@@ -40,12 +40,8 @@ module Uncruft
|
|
40
40
|
end
|
41
41
|
|
42
42
|
def normalize_callstack_path(message)
|
43
|
-
if (
|
44
|
-
message.gsub!(
|
45
|
-
end
|
46
|
-
|
47
|
-
if (user_install = user_install(message)).present?
|
48
|
-
message.gsub!(user_install, '$GEM_PATH')
|
43
|
+
if (gem_path = gem_path(message)).present?
|
44
|
+
message.gsub!(gem_path, '$GEM_PATH')
|
49
45
|
end
|
50
46
|
|
51
47
|
if message.include?(bin_dir)
|
@@ -73,16 +69,13 @@ module Uncruft
|
|
73
69
|
message.sub(/(called from( .+ at)? .+):\d+/, '\1')
|
74
70
|
end
|
75
71
|
|
76
|
-
def
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
def user_install(message)
|
81
|
-
message.match(%r{(?i:c)alled from( .+ at)? (#{Gem.user_dir}/(.+/)*gems)})&.[](2).presence
|
72
|
+
def gem_path(message)
|
73
|
+
paths = [ENV.fetch('GEM_HOME', nil), Bundler.home.to_s, Gem.user_dir].compact
|
74
|
+
message[%r{(?i:c)alled from( .+ at)? (#{Regexp.union(paths)}/(.+/)*gems)}, 2].presence
|
82
75
|
end
|
83
76
|
|
84
77
|
def absolute_path(message)
|
85
|
-
message
|
78
|
+
message[/called from( .+ at)? (.+):\d/, 2]
|
86
79
|
end
|
87
80
|
|
88
81
|
def relative_path(absolute_path)
|
data/lib/uncruft/railtie.rb
CHANGED
@@ -11,12 +11,16 @@ module Uncruft
|
|
11
11
|
strategies.unshift(DeprecationHandler.new)
|
12
12
|
config.active_support.deprecation = strategies
|
13
13
|
end
|
14
|
+
end
|
14
15
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
end
|
16
|
+
if Rails.gem_version >= Gem::Version.new('7.1')
|
17
|
+
initializer "uncruft.deprecator" do |app|
|
18
|
+
app.deprecators[:uncruft] = Uncruft.deprecator
|
19
19
|
end
|
20
20
|
end
|
21
|
+
|
22
|
+
initializer 'uncruft.deprecator.behavior' do |app|
|
23
|
+
Uncruft.deprecator.behavior = app.config.active_support.deprecation
|
24
|
+
end
|
21
25
|
end
|
22
26
|
end
|
data/lib/uncruft/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: uncruft
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan Griffith
|
8
8
|
- Chris Zega
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-01-
|
11
|
+
date: 2025-01-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|
@@ -60,7 +60,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
62
|
requirements: []
|
63
|
-
rubygems_version: 3.6.
|
63
|
+
rubygems_version: 3.6.3
|
64
64
|
specification_version: 4
|
65
65
|
summary: A library to assist with Rails upgrades
|
66
66
|
test_files: []
|