stash_cli 0.1.1 → 0.1.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b390333e969b2a1198a7d61a926460d4d3c72ec7
4
- data.tar.gz: cb9e9d93e24c393debf3f629a2c96cb7407104ec
3
+ metadata.gz: db4f5c5620c404a3601a7fc23fb3ee0ec9f12c3c
4
+ data.tar.gz: 3bcaa008262b447e0bf50f08088e7f46424b4b78
5
5
  SHA512:
6
- metadata.gz: 2b068f17770a53884f6ab8a6362f2c3029e0c9ebd7433b2b183a6a727afd4d6e64fadb36f0055fb0cef741ac79b5cf6d5521f3f28f3933f5c6271788aa22a730
7
- data.tar.gz: e442044a93ceacaa4e8777ad8e4ea2c960fb600acfdd59e716ad48ff7fc0bf4a07a0a14e5c1e731ba2b09589876d4308ea715272af6e17df78b9ee4097b92608
6
+ metadata.gz: 32ae74e1f9590b19d0248c806de849f80b3a6f3d92d94d58392b0428c902726ebdaef54d288902a4b287f5a09efd70d6db8b38289419edd1f1f6e1937e3cfc69
7
+ data.tar.gz: 17e7f79f159b3fa171d1a365f0581ce8ae0c62b5555c57ed77b2281357d02256065f72bda6852a8df3df9339cb4ec7c1d9822286e36cf82e35d366ab7e7ae4e5
data/lib/stash_cli/cli.rb CHANGED
@@ -70,7 +70,7 @@ module StashCLI
70
70
  def groups
71
71
  configure
72
72
 
73
- groups = []
73
+ groups = [['empty:', '(this special group has no users)']]
74
74
  configatron.reviewer_groups.each do |name, users|
75
75
  groups << ["#{name}:", users.join(', ')]
76
76
  end
@@ -100,7 +100,19 @@ module StashCLI
100
100
  aliases: '-g',
101
101
  type: :array,
102
102
  default: [],
103
- desc: 'the groups (union) of reviewers for this pull request'
103
+ desc: 'the groups (union) of reviewers for this pull request. There is a special group "empty" which means no reviewers'
104
+
105
+ option :additional_reviewers,
106
+ aliases: '-a',
107
+ type: :array,
108
+ default: [],
109
+ desc: 'additional users to include in this pull request (will append to groups)'
110
+
111
+ option :reviewers,
112
+ aliases: '-r',
113
+ type: :array,
114
+ default: [],
115
+ desc: 'the only users to include in this pull request (will ignore --groups and --additional-reviewers)'
104
116
 
105
117
  option :dry_run,
106
118
  type: :boolean,
@@ -138,14 +150,23 @@ module StashCLI
138
150
  protected
139
151
 
140
152
  def initial_reviewers
153
+ users = options[:reviewers]
154
+
155
+ # we stop here if there are users specified
156
+ return users if users.any?
157
+
141
158
  groups = options[:groups]
142
159
  if groups.any?
143
- reviewers = groups.map do |group|
144
- if configatron.reviewer_groups.has_key?(group)
145
- configatron.reviewer_groups[group]
146
- else
147
- say "unknown group: #{group}"
148
- nil
160
+ if groups.include?('empty')
161
+ reviewers = []
162
+ else
163
+ reviewers = groups.map do |group|
164
+ if configatron.reviewer_groups.has_key?(group)
165
+ configatron.reviewer_groups[group]
166
+ else
167
+ say "unknown group: #{group}"
168
+ nil
169
+ end
149
170
  end
150
171
  end
151
172
 
@@ -154,6 +175,10 @@ module StashCLI
154
175
  reviewers = configatron.reviewer_groups.default
155
176
  end
156
177
 
178
+ additional_reviewers = options[:additional_reviewers]
179
+
180
+ reviewers += additional_reviewers if additional_reviewers.any?
181
+
157
182
  say "computed reviewers: [#{reviewers.join(', ')}]"
158
183
  reviewers
159
184
  end
@@ -1,3 +1,3 @@
1
1
  module StashCli
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stash_cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Chun-Lum
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-02-23 00:00:00.000000000 Z
11
+ date: 2016-02-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: configatron