bb-flow 0.3.1 → 0.3.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/.ruby-version +1 -1
- data/Gemfile.lock +13 -15
- data/README.md +1 -1
- data/lib/bb_flow/github.rb +12 -0
- data/lib/bb_flow/pull_requester.rb +5 -3
- data/lib/bb_flow/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2332693efe5b0fd311969702d19bdc5620b16723
|
4
|
+
data.tar.gz: 23ced1b43534de1f31d63110b5e008babcec7b7c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5d605f8245b6430f12c840c7fdaa589f0f356a20753d50373d9716a5b95f14814c6a513b146fc971cc887bbf457b1a923fabaeb876598459e6ef292856d9f6ac
|
7
|
+
data.tar.gz: b541455d2c6b8b95fbd450809f78d7f00954e6de1a80164b7dff8a7ef9a4aeb0a4650547da9e5fc127e06d8ef75d6a52ae2353d182df35894267c6e7ba0d2649
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.1
|
1
|
+
2.3.1
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
bb-flow (0.3.
|
4
|
+
bb-flow (0.3.2)
|
5
5
|
ansi-select (= 0.3.4)
|
6
6
|
colorize (~> 0.7.7)
|
7
7
|
git (~> 1.2.9.1)
|
@@ -12,36 +12,34 @@ PATH
|
|
12
12
|
GEM
|
13
13
|
remote: https://rubygems.org/
|
14
14
|
specs:
|
15
|
-
activemodel (
|
16
|
-
activesupport (=
|
17
|
-
|
18
|
-
|
15
|
+
activemodel (5.0.0.1)
|
16
|
+
activesupport (= 5.0.0.1)
|
17
|
+
activesupport (5.0.0.1)
|
18
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
19
19
|
i18n (~> 0.7)
|
20
|
-
json (~> 1.7, >= 1.7.7)
|
21
20
|
minitest (~> 5.1)
|
22
|
-
thread_safe (~> 0.3, >= 0.3.4)
|
23
21
|
tzinfo (~> 1.1)
|
24
22
|
addressable (2.3.8)
|
25
23
|
ansi-select (0.3.4)
|
26
24
|
ast (2.1.0)
|
27
25
|
astrolabe (1.3.1)
|
28
26
|
parser (~> 2.2)
|
29
|
-
builder (3.2.2)
|
30
27
|
coderay (1.1.0)
|
31
28
|
colorize (0.7.7)
|
32
|
-
|
29
|
+
concurrent-ruby (1.0.2)
|
30
|
+
domain_name (0.5.20161129)
|
33
31
|
unf (>= 0.0.5, < 1.0.0)
|
34
32
|
faraday (0.9.2)
|
35
33
|
multipart-post (>= 1.2, < 3)
|
36
34
|
git (1.2.9.1)
|
37
|
-
http-cookie (1.0.
|
35
|
+
http-cookie (1.0.3)
|
38
36
|
domain_name (~> 0.5)
|
39
37
|
i18n (0.7.0)
|
40
|
-
json (
|
38
|
+
json (2.0.2)
|
41
39
|
memoist (0.12.0)
|
42
40
|
method_source (0.8.2)
|
43
|
-
mime-types (2.99)
|
44
|
-
minitest (5.
|
41
|
+
mime-types (2.99.3)
|
42
|
+
minitest (5.10.1)
|
45
43
|
multipart-post (2.0.0)
|
46
44
|
netrc (0.11.0)
|
47
45
|
oauth (0.4.7)
|
@@ -82,7 +80,7 @@ GEM
|
|
82
80
|
thread_safe (~> 0.1)
|
83
81
|
unf (0.1.4)
|
84
82
|
unf_ext
|
85
|
-
unf_ext (0.0.7.
|
83
|
+
unf_ext (0.0.7.2)
|
86
84
|
|
87
85
|
PLATFORMS
|
88
86
|
ruby
|
@@ -95,4 +93,4 @@ DEPENDENCIES
|
|
95
93
|
rubocop (~> 0.34.2)
|
96
94
|
|
97
95
|
BUNDLED WITH
|
98
|
-
1.
|
96
|
+
1.13.6
|
data/README.md
CHANGED
@@ -9,7 +9,7 @@ A command line utility, which was born to simplify routines required by the Brig
|
|
9
9
|
Currently we support two commands:
|
10
10
|
|
11
11
|
bb-flow commit -m 'Commit message' # Create a commit.
|
12
|
-
|
12
|
+
bb-flow pr # Create a pull request.
|
13
13
|
|
14
14
|
## Roadmap
|
15
15
|
[Roadmap google doc](https://docs.google.com/document/d/1voXHU5H-M3YEwKKp1bGeYxGALNc6GB91fJ7eBfOMZ4k/edit)
|
data/lib/bb_flow/github.rb
CHANGED
@@ -42,6 +42,18 @@ module BBFlow
|
|
42
42
|
octokit.create_pull_request(repository_name, Options.get(:base_branch), local_branch, title, body)
|
43
43
|
end
|
44
44
|
|
45
|
+
# @param [String] pull_request
|
46
|
+
# @param [String] reviewers
|
47
|
+
#
|
48
|
+
# @return [void]
|
49
|
+
def add_assignees_to_pull_request(pull_request, reviewers)
|
50
|
+
puts 'Adding assignees to pull request...'
|
51
|
+
|
52
|
+
url = "/repos/#{repository_name}/issues/#{pull_request}/assignees"
|
53
|
+
assignees = { 'assignees': reviewers.map(&:first) }
|
54
|
+
octokit.post url, assignees
|
55
|
+
end
|
56
|
+
|
45
57
|
# @return [Array<Array<String>>] Array<[login, name]>
|
46
58
|
persistent local def collaborators
|
47
59
|
puts 'Fetching project collaborators...'
|
@@ -19,6 +19,10 @@ module BBFlow
|
|
19
19
|
else
|
20
20
|
response = Github.create_pull_request(title, Misc.edit(body_template) + ADVERTISEMENT)
|
21
21
|
|
22
|
+
unless reviewers.empty?
|
23
|
+
Github.add_assignees_to_pull_request(response.number, reviewers)
|
24
|
+
end
|
25
|
+
|
22
26
|
unless labels.empty?
|
23
27
|
Github.add_labels_to_pull_request(response.number, labels)
|
24
28
|
end
|
@@ -96,11 +100,9 @@ module BBFlow
|
|
96
100
|
|
97
101
|
# @return [String]
|
98
102
|
def body_template
|
99
|
-
reviewers_md = reviewers.map { |login, _name| "- [ ] @#{login}" }
|
100
103
|
card_links = cards.map { |card| %Q(<a href="#{card.url}"><img src="https://github.trello.services/images/trello-icon.png" width="12" height="12"> #{card.name}</a>) }
|
101
104
|
|
102
105
|
body_parts = []
|
103
|
-
body_parts << reviewers_md.join("\n") unless reviewers_md.empty?
|
104
106
|
|
105
107
|
unless card_links.empty?
|
106
108
|
body_parts << card_links.join("\n")
|
@@ -118,7 +120,7 @@ module BBFlow
|
|
118
120
|
end
|
119
121
|
|
120
122
|
# @return [Array<String>] [login, name]
|
121
|
-
def reviewers
|
123
|
+
memoize def reviewers
|
122
124
|
previous_reviewers = Persistent::Store.get(:local).transaction(true) { |store| store['previous_reviewers'] } || []
|
123
125
|
|
124
126
|
reviewers = Printer.select_items(
|
data/lib/bb_flow/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bb-flow
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- gregolsen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-12-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ansi-select
|
@@ -201,7 +201,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
201
201
|
version: '0'
|
202
202
|
requirements: []
|
203
203
|
rubyforge_project:
|
204
|
-
rubygems_version: 2.
|
204
|
+
rubygems_version: 2.5.1
|
205
205
|
signing_key:
|
206
206
|
specification_version: 4
|
207
207
|
summary: Simplifies typical BrightBytes work flows
|