git-lite-version-bump 0.17.0 → 0.17.1

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/git-version-bump.rb +16 -3
  3. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 27079410bd5e17df87c9feb9cdc20c9d6e158bb6aa7b76c86c324f9a6cffe2a4
4
- data.tar.gz: 43757821844c2f9847d8c8601c51fa9e49b2f620a77d93caf54a1b4cec798dc6
3
+ metadata.gz: 245fa58c69c2530bf29a431acafb3d1c2072dd685322efe95f2e0a486f57a050
4
+ data.tar.gz: 9a2b6c6cab12d189fdf6e85ff769bffaa64a1ca0d301f5712e2cd124fb5e9528
5
5
  SHA512:
6
- metadata.gz: f13c494b1d02d9db46399671705dde89751cc753cad10f030c4b3251b9d331422fa843fde288374ec227143aea09866e1d60e562c767a4e26ba78ef3d6087837
7
- data.tar.gz: 5e7b928a415dbf37f7c619e04271ba79290c81f6b773da3f4f31c6c4b7fc7bce3640f171dae04f33098133c52833f24ffbadceb991ec31b4bbee87619add4a5a
6
+ metadata.gz: 55b0499ada73ff1ee43db28d8388235dde7c2ebe2e36aed80630d61ac1c59a12e942a8ba9461103e02759e093b54dfe10141b664cd52351a70c743c16bae9b6c
7
+ data.tar.gz: 5c939fe28ce4faba2fda3016b827b407fbeeb7c021dae79a41316825fae1e256ff0364a35c43dc00e9d6c232d9e2f52f49ef8580c5611d3f8196e0b11e711a85
@@ -252,9 +252,14 @@ module GitVersionBump
252
252
  # within this file, we can't just look at Gem.location_of_caller, but
253
253
  # instead we need to parse the caller stack ourselves to find which
254
254
  # gem we're trying to version all over.
255
+ #
256
+ # Caller returns paths of the form `/path/to/file:100:in method...` on *nix
257
+ # and `C:\path\to\file:in method...` on Windows. Splitting on colon isn't
258
+ # reliable since the Windows path has a colon at the beginning, split on :num:
259
+ # instead since that will always be there no matter the platform.
255
260
  Pathname(
256
261
  caller.
257
- map { |l| l.split(':')[0] }.
262
+ map { |l| l.split(/:\d+:/)[0] }.
258
263
  find { |l| l != __FILE__ }
259
264
  ).realpath.to_s rescue nil
260
265
  end
@@ -265,8 +270,16 @@ module GitVersionBump
265
270
  # Grovel through all the loaded gems to try and find the gem
266
271
  # that contains the caller's file.
267
272
  Gem.loaded_specs.values.each do |spec|
268
- search_dirs = spec.require_paths.map { |d| "#{spec.full_gem_path}/#{d}" } +
269
- [File.join(spec.full_gem_path, spec.bindir)]
273
+ # On Windows I have encountered gems that already have an absolute
274
+ # path, verify that the path is relative before appending to it
275
+ search_dirs = spec.require_paths.map do |path|
276
+ if Pathname(path).absolute?
277
+ path
278
+ else
279
+ File.join(spec.full_gem_path, path)
280
+ end
281
+ end
282
+ search_dirs << File.join(spec.full_gem_path, spec.bindir)
270
283
  search_dirs.map! do |d|
271
284
  begin
272
285
  Pathname(d).realpath.to_s
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git-lite-version-bump
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.17.0
4
+ version: 0.17.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Palmer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-03-31 00:00:00.000000000 Z
11
+ date: 2020-05-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: github-release
@@ -102,7 +102,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
102
102
  - !ruby/object:Gem::Version
103
103
  version: '0'
104
104
  requirements: []
105
- rubygems_version: 3.0.3
105
+ rubygems_version: 3.1.2
106
106
  signing_key:
107
107
  specification_version: 4
108
108
  summary: Manage your app version entirely via git tags (even lite tags)