builderator 2.0.1 → 2.0.2

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
  SHA1:
3
- metadata.gz: 13b532b123dc6f16f2ee5e0745fe8cce7b017796
4
- data.tar.gz: 8e9a775c7957c148d800722292a02e1d3522b93c
3
+ metadata.gz: 02fbe9845121a437bd25ac6a07905e979927f8a3
4
+ data.tar.gz: a6e86d96fa8681572a4f347bf3b47020abb23e94
5
5
  SHA512:
6
- metadata.gz: bd75b03cc02eb3ed839a6e296234a08a2cb6988f8e0a87435c273d6616197e01f2e67d606816170827eb994168add38d033de61f356b1b1df617c40bbe5384be
7
- data.tar.gz: 7743193cdbfbacd0b27abb7328c7ad433787dbf0ad2e9000f867d5c34c2a991ce7e07eca24f927690346c1e420ece1185de1a8100a00284e31c87ffcb9bcef7d
6
+ metadata.gz: d6dd4af87e88bbade40ca9e9654f9f2ccb0bd8fbee9acda392ab8f03bfbf39ba16e9e071092b69206f62389c7a09c7110ac6c1a051d0a9c1a821f0b0d19e0f17
7
+ data.tar.gz: f3001cb5890833c3bbef7d9bc468cf2a91fe757b078650415b763be4f736588d37fc522c2391dd04e3e68f423a4ccce1dcca4999f7ab57075fd498da4123e150
@@ -16,6 +16,8 @@ module Builderator
16
16
 
17
17
  ## Is there a .git repo in the project root?
18
18
  def self.supported?
19
+ return true if ENV['GIT_DIR'] && File.exist?(ENV['GIT_DIR'])
20
+
19
21
  Util.relative_path('.git').exist?
20
22
  end
21
23
 
@@ -16,8 +16,13 @@ module Builderator
16
16
  true
17
17
  end
18
18
 
19
+ class_option :git_dir, desc: 'The .git directory to use (default: .git)'
20
+
19
21
  desc 'current', 'Print the current version and write it to file'
20
22
  def current
23
+ # Workaround for singleton git provider not supporting alternate path.
24
+ ENV['GIT_DIR'] = options[:git_dir] if options[:git_dir]
25
+
21
26
  unless Config.autoversion.search_tags
22
27
  say_status :disabled, 'Automatically detecting version information '\
23
28
  'from SCM tags is disabled', :red
@@ -31,6 +36,9 @@ module Builderator
31
36
 
32
37
  desc 'bump TYPE [PRERELEASE_NAME]', 'Increment the package version, optionally with a named prerelease'
33
38
  def bump(type = :auto, prerelease_name = nil)
39
+ # Workaround for singleton git provider not supporting alternate path.
40
+ ENV['GIT_DIR'] = options[:git_dir] if options[:git_dir]
41
+
34
42
  ## Guard: Don't try to create a new version if `create_tags` is explicitly disabled
35
43
  ## or `search_tags` is disabled as we won't have a valid current version to increment
36
44
  unless Config.autoversion.create_tags && Config.autoversion.search_tags
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: builderator
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Manero
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-12-22 00:00:00.000000000 Z
11
+ date: 2018-01-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake