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 +4 -4
- data/lib/stash_cli/cli.rb +33 -8
- data/lib/stash_cli/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: db4f5c5620c404a3601a7fc23fb3ee0ec9f12c3c
|
4
|
+
data.tar.gz: 3bcaa008262b447e0bf50f08088e7f46424b4b78
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
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
|
data/lib/stash_cli/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2016-02-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: configatron
|