uncruft 0.4.0 → 0.5.0

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: daf00cb55dbde2d67dd46ff78d173af307f9d8d18030dc195f8d11ea5481be93
4
- data.tar.gz: 1bf1d7d58d8c196ff4b4a83d15e01745873f154ba55224b46a9bd5f1e895ca23
3
+ metadata.gz: 76e0e442203874598e7fce6d800367777c98647019e75276a8d20d5017805d64
4
+ data.tar.gz: d3cd8b3ce1cba8d9dbb3bb4525fba94e8b640745f1664d27ddbf5d0c02ee2c03
5
5
  SHA512:
6
- metadata.gz: e7beb1904dc3ce85e47c79e7f925b57d3d7858395019ffb2e8868c39c838ab773515f93e0aa50dbd35d002288b8a2343a146d6a902415869db6e819d88ffd8f2
7
- data.tar.gz: 5f5a77e13579923808298d102df2c75abf3a6bbb2b9c65551f252837108daf3ddcbbf029cef3ba1d74b57718ac72b6bb1d14397b3f4c8958a58d668c5ae02bf1
6
+ metadata.gz: 1218997103d6c1afc41e00becd2b06fc7e66bfcfdb15894c75fa1a31d12e3297a35511aafe255dd9829ec110efd22afc9ae68bc6b0838a9e07f8d49a59fa4d0f
7
+ data.tar.gz: 0a0f6b0e69fbe655c4490342a53fa5a4af9c7358d0842c9d5ac762416ef601060acc8e85233bb97935fd9cca854ac511f7f4ace99a84db3ece549887381c3add
@@ -44,6 +44,10 @@ module Uncruft
44
44
  message.gsub!(gem_home, '$GEM_PATH')
45
45
  end
46
46
 
47
+ if (user_install = user_install(message)).present?
48
+ message.gsub!(user_install, '$GEM_PATH')
49
+ end
50
+
47
51
  if message.include?(bin_dir)
48
52
  message.gsub!(bin_dir, '$BIN_PATH')
49
53
  end
@@ -70,7 +74,11 @@ module Uncruft
70
74
  end
71
75
 
72
76
  def gem_home(message)
73
- message.match(%r{(?i:c)alled from( .+ at)? (#{ENV['GEM_HOME']}/(.+/)*gems)})&.[](2) # rubocop:disable Style/FetchEnvVar
77
+ message.match(%r{(?i:c)alled from( .+ at)? (#{ENV.fetch('GEM_HOME', nil)}/(.+/)*gems)})&.[](2).presence
78
+ end
79
+
80
+ def user_install(message)
81
+ message.match(%r{(?i:c)alled from( .+ at)? (#{Gem.user_dir}/(.+/)*gems)})&.[](2).presence
74
82
  end
75
83
 
76
84
  def absolute_path(message)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Uncruft
4
- VERSION = '0.4.0'
4
+ VERSION = '0.5.0'
5
5
  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.4.0
4
+ version: 0.5.0
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: 2024-01-02 00:00:00.000000000 Z
12
+ date: 2024-06-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: railties