uncruft 0.6.1 → 0.7.0
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 +4 -4
- data/lib/uncruft/deprecation_handler.rb +7 -14
- data/lib/uncruft/railtie.rb +4 -2
- data/lib/uncruft/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7268553c4497135263a268db1cab0869a74d6a6ca53598419f68890922690780
|
4
|
+
data.tar.gz: bb8807475bc2da7fce185fe23857b773bd3a8e23f4e67680e8917bfd74e44421
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 269f6f73bff75e390ee02bcea4e0961077f4195be0f9df397bc3750aecbfce598e76c62d48b446177f25a1441e8dadb129e3fba9133f921e994f4d704ab5b70f
|
7
|
+
data.tar.gz: ff2e3c840c0d2bbc4b2fc10aa8433606039f764a8f99719952ca1a3ce32a6c318eabf395914221b7932e93cc0ae8e4a0b91fabef173bc3b1d917c95188ab71b9
|
@@ -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
@@ -12,8 +12,10 @@ module Uncruft
|
|
12
12
|
config.active_support.deprecation = strategies
|
13
13
|
end
|
14
14
|
|
15
|
-
|
16
|
-
|
15
|
+
if Rails.gem_version >= Gem::Version.new('7.1')
|
16
|
+
initializer "uncruft.deprecator" do |app|
|
17
|
+
app.deprecators[:uncruft] = Uncruft.deprecator
|
18
|
+
end
|
17
19
|
end
|
18
20
|
end
|
19
21
|
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.0
|
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-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|