uncruft 0.3.1 → 0.3.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: a2cab324dae5f8b3fc23c4f99785900af558ab66cee8a908222b3e7793482a35
4
- data.tar.gz: 65ce169801afae62f4bd2b005b0ec901416c7f1372c2c5ca48a8ca3a9e9b79b0
3
+ metadata.gz: 8aa0bb937027030b9fc259a8601f437cb95d9e271a8080e9a8c33203f2518d5b
4
+ data.tar.gz: 1cf593d52f8a5da26a0641ae8ed89a15e1ff5ee5b50ff2a6543a4d3ddda6b648
5
5
  SHA512:
6
- metadata.gz: 4d8f03d9ae4074f0097facfa7f20895ef17ec72082ba4f2a2fa49ddc8dfef688a7574f2fab60d134a42e60fa0ef841ce9201a9226da3e0dc9bd239737d260a88
7
- data.tar.gz: 6f5857f50049b5016bb96d3e106de7c5a54818625c7922de2cb2b1971b857118af64bdf19a414694862b77d22b5a015c7f908ecc683899c8df5a4dc743ce14de
6
+ metadata.gz: df1f2ccd8624867f6bba5b87b71021d69b04e1edcaa4be2714639f436da13fead46d15cee272a8b38c32fd88d4d385411a5c20379aa97e39106854eee5d5dd82
7
+ data.tar.gz: 171847958d0cd67979abcb650dd5d6545c2d4fb7e6bc923d2c75c95265a90b0ff3296d1d6e78e0c71887e4a866e48414383179629ad898b72324a32b699745c3
@@ -44,6 +44,10 @@ module Uncruft
44
44
  message.gsub!(gem_home, '$GEM_PATH')
45
45
  end
46
46
 
47
+ if message.include?(bin_dir)
48
+ message.gsub!(bin_dir, '$BIN_PATH')
49
+ end
50
+
47
51
  if (absolute_path = absolute_path(message)).present?
48
52
  message.gsub!(absolute_path, relative_path(absolute_path))
49
53
  end
@@ -77,10 +81,15 @@ module Uncruft
77
81
  Pathname.new(absolute_path)
78
82
  .relative_path_from(Rails.root).to_s
79
83
  .gsub(%r{\A(../)*vendor/cache}, '$GEM_PATH')
84
+ .gsub(%r{\A(vendor/bundle/ruby/\d\.\d\.\d/bin)}, '$BIN_PATH')
80
85
  rescue ArgumentError # When `relative_path_from` cannot find a relative path.
81
86
  absolute_path
82
87
  end
83
88
 
89
+ def bin_dir
90
+ RbConfig::CONFIG['bindir']
91
+ end
92
+
84
93
  def error_message(message, line_number)
85
94
  <<~ERROR.strip
86
95
  #{message}:#{line_number}
@@ -1,3 +1,3 @@
1
1
  module Uncruft
2
- VERSION = '0.3.1'.freeze
2
+ VERSION = '0.3.3'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uncruft
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Griffith
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-04-26 00:00:00.000000000 Z
12
+ date: 2023-04-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: railties