solicit 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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3c92629f063199635ccde07aba4584aacc9106d53cd7e910add1939cfc30fba0
|
4
|
+
data.tar.gz: 125cf7b47c20534a717be5574c99625b0490844b1de48dc35c8a64bfe38b36c2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '034080a6aa99467cc4a200c87b8f6580917f6302b6e9d9ab328ebeae3c4d74548075e44205ed271116768d6bd23672bf5fdc2213406aca94d8b691590e2d3a76'
|
7
|
+
data.tar.gz: '0494515dfe1297ac1f658cd41f34020231da9016604ba81b8de7c18f084938aa737400798b1ff9326b785d71813239eeb7376fef8ee71e20b62e8f78d11a1521'
|
@@ -34,9 +34,11 @@ module Solicit
|
|
34
34
|
end
|
35
35
|
|
36
36
|
def ensure_can_notify
|
37
|
+
label = payload.dig(:label, :name).to_sym
|
37
38
|
head :ok unless request_is_from_github? &&
|
38
39
|
payload[:action] == 'labeled' &&
|
39
|
-
Solicit.labels_map.key?(
|
40
|
+
Solicit.labels_map.key?(label) &&
|
41
|
+
Solicit.needs_more_assignees.call(payload.dig(:pull_request, :assignees), label) &&
|
40
42
|
payload.dig(:pull_request, :number) &&
|
41
43
|
payload.dig(:repository, :url)
|
42
44
|
end
|
@@ -1,22 +1,19 @@
|
|
1
1
|
module Solicit
|
2
2
|
class PostToSlack
|
3
|
-
attr_reader :text
|
4
|
-
|
5
3
|
def initialize(url:, channel:, username:, payload:)
|
6
4
|
@url = url
|
7
5
|
@channel = channel
|
8
6
|
@username = username
|
9
7
|
@payload = payload
|
10
|
-
@text = I18n.t(:"engines.solicit.title", title_options)
|
11
8
|
end
|
12
9
|
|
13
10
|
def self.perform(*args)
|
14
|
-
new(*args).
|
11
|
+
new(*args).perform
|
15
12
|
end
|
16
13
|
|
17
14
|
def perform
|
18
15
|
Slack::Notifier.new(@url, channel: @channel, username: @username).ping(
|
19
|
-
text:
|
16
|
+
text: I18n.t(:"engines.solicit.title", title_options),
|
20
17
|
attachments: [{
|
21
18
|
title: I18n.t(:"engines.solicit.review"),
|
22
19
|
callback_id: callback_id,
|
@@ -30,10 +27,9 @@ module Solicit
|
|
30
27
|
|
31
28
|
def title_options
|
32
29
|
{
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
label: @payload.dig(:label, :name),
|
30
|
+
link: @payload.dig(:pull_request, :html_url),
|
31
|
+
title: @payload.dig(:pull_request, :title),
|
32
|
+
label: @payload.dig(:label, :name),
|
37
33
|
}
|
38
34
|
end
|
39
35
|
|
@@ -54,11 +50,5 @@ module Solicit
|
|
54
50
|
value: @payload.dig(:label, :name),
|
55
51
|
}
|
56
52
|
end
|
57
|
-
|
58
|
-
def author_name
|
59
|
-
Solicit.contributors_map.detect do |_, value|
|
60
|
-
value[:handle] == @payload.dig(:sender, :login)
|
61
|
-
end&.dig(1, 'name') || I18n.t(:"engines.solicit.someone")
|
62
|
-
end
|
63
53
|
end
|
64
54
|
end
|
data/config/locales/en.yml
CHANGED
data/lib/solicit/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: solicit
|
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
|
- Optimal Workshop
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-05-
|
11
|
+
date: 2019-05-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -162,7 +162,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
162
162
|
- !ruby/object:Gem::Version
|
163
163
|
version: '0'
|
164
164
|
requirements: []
|
165
|
-
|
165
|
+
rubyforge_project:
|
166
|
+
rubygems_version: 2.7.8
|
166
167
|
signing_key:
|
167
168
|
specification_version: 4
|
168
169
|
summary: Solicit reviewers for your github pull requests on Slack
|