hubmerge 0.0.3 → 0.0.4

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
  SHA256:
3
- metadata.gz: fdf7016d54c5c811d00b0f9e028e931411b9f2519a0b99a99c9b6d283183a132
4
- data.tar.gz: eb4497f243c5f8ef881d91798fbf480dccacf0ccb08f60a480d1b7c7ec2be076
3
+ metadata.gz: 55737cf494265c5702e9643b8a61f5cdb263c3397e291c6e2a62b7928a075513
4
+ data.tar.gz: 1db2d7c3003a7fab2c590e5a6d1e664e0d588e144e99c9457ce5968f026e9dbd
5
5
  SHA512:
6
- metadata.gz: ddce8235cc5b18bf49781a915a601bd01a2ca6b280053d9ad243e3c49b02c30eb4c76c1a9f0ce702e4c5e48b749a4cca42b28379bf77a55c9f4cee1ea1806488
7
- data.tar.gz: 9aa18e625528e26e9986f5329aa3ed07ab4f1f70a2be1528a37a3a21baab551de5191e938950c0d4334bf971ca00fbbb928e0b42364e1e19ca0bac351777592b
6
+ metadata.gz: 421109e14a81bd8e10e531827c27cda86379308cc20e96ec9c99dd38eaf92e0d149b9dc8d764c713bfc21963a2bde0d4a193a3064ff59c32428f2a3d8d685b95
7
+ data.tar.gz: 6a82cbf9d4443a9baa5f4303f7a15ffb7134ec61de784debefc03bc29c82cc5686729001f7b6bfe9b74243632647fdcf5371b0f7f325aa69e816794047374dd9
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- hubmerge (0.0.3)
4
+ hubmerge (0.0.4)
5
5
  octokit (~> 4.0)
6
6
  tty-prompt (~> 0.18)
7
7
  tty-spinner (~> 0.9)
@@ -17,7 +17,7 @@ GEM
17
17
  minitest (5.11.3)
18
18
  multipart-post (2.0.0)
19
19
  necromancer (0.4.0)
20
- octokit (4.13.0)
20
+ octokit (4.14.0)
21
21
  sawyer (~> 0.8.0, >= 0.5.3)
22
22
  pastel (0.7.2)
23
23
  equatable (~> 0.5.0)
@@ -22,7 +22,13 @@ module HubMerge
22
22
  short_switch: "-y",
23
23
  long_switch: "--yes",
24
24
  type: :flag,
25
- description: "Merge without confirmation from user (default: false)",
25
+ description: "Merge without confirmation from user (default: false)"
26
+ },
27
+ approve_before_merge: {
28
+ short_switch: "-a",
29
+ long_switch: "--approve",
30
+ type: :flag,
31
+ description: "Approve PR before merge (default: false)"
26
32
  },
27
33
  }
28
34
  end
@@ -1,3 +1,3 @@
1
1
  module HubMerge
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
data/lib/hubmerge.rb CHANGED
@@ -40,14 +40,14 @@ module HubMerge
40
40
  @prompts.say("No pull requests selected, aborting")
41
41
  return 1
42
42
  else
43
- merge_pull_requests(prs_to_merge)
43
+ merge_pull_requests(prs_to_merge, opts)
44
44
  return 0
45
45
  end
46
46
  end
47
47
 
48
48
  private
49
49
 
50
- def merge_pull_requests(prs_to_merge)
50
+ def merge_pull_requests(prs_to_merge, opts)
51
51
  total = prs_to_merge.count
52
52
  prs_to_merge.each_with_index do |pr, index|
53
53
  mergeable = false
@@ -64,8 +64,10 @@ module HubMerge
64
64
 
65
65
  next unless mergeable
66
66
 
67
- @spinner.with_child("[:spinner] Approving") do
68
- @merger.approve_if_not_approved(github_client, pr)
67
+ if opts[:approve_before_merge]
68
+ @spinner.with_child("[:spinner] Approving") do
69
+ @merger.approve_if_not_approved(github_client, pr)
70
+ end
69
71
  end
70
72
 
71
73
  @spinner.with_child("[:spinner] Merging") do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hubmerge
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paul Kuruvilla
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-03-10 00:00:00.000000000 Z
11
+ date: 2019-04-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler