git-version-bump 0.13.2 → 0.13.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/git-version-bump.rb +5 -4
- metadata +2 -2
data/lib/git-version-bump.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'tempfile'
|
2
2
|
require 'digest/sha1'
|
3
|
+
require 'pathname'
|
3
4
|
|
4
5
|
module GitVersionBump
|
5
6
|
class VersionUnobtainable < StandardError; end
|
@@ -22,11 +23,11 @@ module GitVersionBump
|
|
22
23
|
# within this file, we can't just look at Gem.location_of_caller, but
|
23
24
|
# instead we need to parse the caller stack ourselves to find which
|
24
25
|
# gem we're trying to version all over.
|
25
|
-
|
26
|
+
Pathname(
|
26
27
|
caller.
|
27
28
|
map { |l| l.split(':')[0] }.
|
28
29
|
find { |l| l != __FILE__ }
|
29
|
-
) rescue nil
|
30
|
+
).realpath.to_s rescue nil
|
30
31
|
end
|
31
32
|
|
32
33
|
def self.caller_gemspec
|
@@ -36,7 +37,7 @@ module GitVersionBump
|
|
36
37
|
# that contains the caller's file.
|
37
38
|
Gem.loaded_specs.values.each do |spec|
|
38
39
|
if (Dir.glob(spec.lib_dirs_glob) + Dir["#{spec.bin_dir}/*"]).
|
39
|
-
find { |d| cf.index(
|
40
|
+
find { |d| cf.index(Pathname(d).realpath.to_s) == 0 }
|
40
41
|
# The caller_file is in this
|
41
42
|
# gem! Woohoo!
|
42
43
|
return spec
|
@@ -92,7 +93,7 @@ module GitVersionBump
|
|
92
93
|
# If we got here, something went *badly* wrong -- presumably, we
|
93
94
|
# weren't called from within a loaded gem, and so we've got *no*
|
94
95
|
# idea what's going on. Time to bail!
|
95
|
-
if git_available
|
96
|
+
if git_available?
|
96
97
|
raise VersionUnobtainable,
|
97
98
|
"GVB.version(#{use_local_git.inspect}) failed, and I really don't know why."
|
98
99
|
else
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: git-version-bump
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.13.
|
4
|
+
version: 0.13.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-11-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: github-release
|