agita 0.3.2 → 0.4.0
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/agita.rb +17 -9
- data/lib/agita/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 60724049a1918126f4d3706ce30ed8a6e36af1ac
|
4
|
+
data.tar.gz: 81327ff723def835ecd3a726a70d1fa1fc7ac27a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bf5d21e167d637068bfabfd096a041ff714c2090e999c26d2fc97cb2ef87499da24566222266f1fc787f084abf5e3d4ed20a92ec55582eb02a9cf774467eb63b
|
7
|
+
data.tar.gz: 12187fc1ed40d3dfa21555acac93fd7e8470f8f5c5116e3b60293d3dbef9e8b9d278a3082278717d1d468d0cb2082341a3d856e2c5f9ca035cfce8892a537015
|
data/lib/agita.rb
CHANGED
@@ -3,15 +3,6 @@ require 'shellwords'
|
|
3
3
|
# Git commands / workflow helper.
|
4
4
|
class Agita
|
5
5
|
|
6
|
-
# Raise RuntimeError unless
|
7
|
-
def ensure_master_updated_clean
|
8
|
-
ensure_status(
|
9
|
-
"On branch master",
|
10
|
-
"Your branch is up-to-date with 'origin/master'.",
|
11
|
-
"nothing to commit, working directory clean"
|
12
|
-
)
|
13
|
-
end
|
14
|
-
|
15
6
|
# Raise RuntimeError unless current #status is same as expected_status.
|
16
7
|
def ensure_status *expected_status
|
17
8
|
current_status = status
|
@@ -25,6 +16,23 @@ class Agita
|
|
25
16
|
end
|
26
17
|
end
|
27
18
|
|
19
|
+
# Raise RuntimeError unless at branch master, up to date with 'origin/master' and clean.
|
20
|
+
def ensure_master_updated_clean
|
21
|
+
ensure_status(
|
22
|
+
"On branch master",
|
23
|
+
"Your branch is up-to-date with 'origin/master'.",
|
24
|
+
"nothing to commit, working directory clean"
|
25
|
+
)
|
26
|
+
end
|
27
|
+
|
28
|
+
# Raises RuntimeError unless checked out at tagname
|
29
|
+
def ensure_checked_out tagname
|
30
|
+
ensure_status(
|
31
|
+
"HEAD detached at #{tagname}",
|
32
|
+
"nothing to commit, working directory clean",
|
33
|
+
)
|
34
|
+
end
|
35
|
+
|
28
36
|
# Return Git status (git status --branch --porcelain --long) as an array.
|
29
37
|
def status
|
30
38
|
run('git status --branch --porcelain --long').split(/\n+/)
|
data/lib/agita/version.rb
CHANGED