gempilot 0.3.4 → 0.3.5
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 +4 -4
- data/lib/gempilot/origin.rb +12 -15
- data/lib/gempilot/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ab55a4c336ff8612280f38c41b6c4471e9f7791ae9fd40998af6608c016f5031
|
|
4
|
+
data.tar.gz: 1d29b54f07c0c66a0a6781a394d29d0cb73c14ceba5c3cf8278601e5e1db4df9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 22f56e4d465bd05cfb95f4286599ae1c8242c56a63855aefad5878b74eb277dae5f0a497f11a43ccc2e4539cb9e4b18345907fe991ca8a4b93657fb9265138d7
|
|
7
|
+
data.tar.gz: 7edb37e82f9f3595bfe6d2002684c8dec2a40dbd7b7cd04440dad519a2e68d521793831fd717786cb53f6466385eb264e2196e4f8c67500feb3ac08bb2eb28d3
|
data/lib/gempilot/origin.rb
CHANGED
|
@@ -5,7 +5,9 @@ module Gempilot
|
|
|
5
5
|
## Backs the +release:source_control_push+ task. Idempotent: pushing an
|
|
6
6
|
## already-pushed branch or tag is a no-op, so re-running a release never
|
|
7
7
|
## fails on an existing tag (unlike bundler's +already_tagged?+ guard, which
|
|
8
|
-
## skips the push entirely once the tag exists locally).
|
|
8
|
+
## skips the push entirely once the tag exists locally). From a detached
|
|
9
|
+
## HEAD, such as a CI checkout of the tag, there is no branch to push, so
|
|
10
|
+
## only the tag goes to +origin+.
|
|
9
11
|
class Origin
|
|
10
12
|
include StrictShell
|
|
11
13
|
|
|
@@ -16,21 +18,21 @@ module Gempilot
|
|
|
16
18
|
end
|
|
17
19
|
|
|
18
20
|
def push
|
|
19
|
-
sh "git", "push", remote, "refs/heads/#{branch}"
|
|
21
|
+
sh "git", "push", remote, "refs/heads/#{branch}" if branch
|
|
20
22
|
sh "git", "push", remote, "refs/tags/#{tag}"
|
|
21
23
|
end
|
|
22
24
|
|
|
23
25
|
private
|
|
24
26
|
|
|
25
27
|
def branch
|
|
26
|
-
@branch
|
|
27
|
-
end
|
|
28
|
+
return @branch if defined?(@branch)
|
|
28
29
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
raise "Cannot push from a detached HEAD; check out a branch first" if name == "HEAD"
|
|
30
|
+
@branch = attached_branch
|
|
31
|
+
end
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
def attached_branch
|
|
34
|
+
out, status = Open3.capture2("git", "symbolic-ref", "--quiet", "--short", "HEAD")
|
|
35
|
+
out.strip if status.success?
|
|
34
36
|
end
|
|
35
37
|
|
|
36
38
|
def remote
|
|
@@ -38,15 +40,10 @@ module Gempilot
|
|
|
38
40
|
end
|
|
39
41
|
|
|
40
42
|
def configured_remote
|
|
43
|
+
return unless branch
|
|
44
|
+
|
|
41
45
|
out, status = Open3.capture2("git", "config", "--get", "branch.#{branch}.remote")
|
|
42
46
|
out.strip if status.success?
|
|
43
47
|
end
|
|
44
|
-
|
|
45
|
-
def capture(*args)
|
|
46
|
-
out, status = Open3.capture2(*args)
|
|
47
|
-
raise "Command #{args.join(" ").inspect} failed (exit #{status.exitstatus})" unless status.success?
|
|
48
|
-
|
|
49
|
-
out.strip
|
|
50
|
-
end
|
|
51
48
|
end
|
|
52
49
|
end
|
data/lib/gempilot/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: gempilot
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- David Gillis
|
|
@@ -165,7 +165,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
165
165
|
- !ruby/object:Gem::Version
|
|
166
166
|
version: '0'
|
|
167
167
|
requirements: []
|
|
168
|
-
rubygems_version: 4.0.
|
|
168
|
+
rubygems_version: 4.0.20
|
|
169
169
|
specification_version: 4
|
|
170
170
|
summary: A toolkit for creating, managing, and releasing your own rubygems
|
|
171
171
|
test_files: []
|