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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/agita.rb +17 -9
  3. data/lib/agita/version.rb +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ba72df27275248c5ed439d5ec8964c400077df78
4
- data.tar.gz: 2cb5bdd7adf41c1e7393ba03b2c50017eac2e614
3
+ metadata.gz: 60724049a1918126f4d3706ce30ed8a6e36af1ac
4
+ data.tar.gz: 81327ff723def835ecd3a726a70d1fa1fc7ac27a
5
5
  SHA512:
6
- metadata.gz: c058b3392d2938ba87bf1e87268c5a079e656e8fed521719fcf42bf761ee0e5a94061f34061cd9abb1e659a28549391f6917e64af2d639bcb1812bf3251fba96
7
- data.tar.gz: bedd30feb4cb9a26fb689d3c090c6d3aa7922a1a662f7cc470355c854ecb002b21221874583854f593ad9d01768cadf4e73c6b8c543cc0e8f312d1b5eba77b18
6
+ metadata.gz: bf5d21e167d637068bfabfd096a041ff714c2090e999c26d2fc97cb2ef87499da24566222266f1fc787f084abf5e3d4ed20a92ec55582eb02a9cf774467eb63b
7
+ data.tar.gz: 12187fc1ed40d3dfa21555acac93fd7e8470f8f5c5116e3b60293d3dbef9e8b9d278a3082278717d1d468d0cb2082341a3d856e2c5f9ca035cfce8892a537015
@@ -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+/)
@@ -1,3 +1,3 @@
1
1
  class Agita
2
- VERSION = '0.3.2'
2
+ VERSION = '0.4.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: agita
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fabio Pugliese Ornellas