gh-events 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/gh/events/slack.rb +4 -3
- data/lib/gh/events/version.rb +1 -1
- data/res/slack.yml +17 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b774f605d292c79af1d4b7b38622df8360cd5ca934b62ee6bbdae1775f49db35
|
4
|
+
data.tar.gz: c7f193cce6c5ef1f92ca967754b7f324bcf3f545356abb986a13ef27800528f5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 37aaeaea6f87d2d3c4140d8ac77bd520c7f4189eced408c16386da9ddfef8dd6da22b0b9e9b088e8870ddfdecbe6cf5c8a5b19930fbd675f4826548e1d2824d2
|
7
|
+
data.tar.gz: 25ad209a0beebdfd89739b786fe04f80cd1bc84e5ac0a8118145f30ccff45cc3951e6a0956b058ca246285eef58663b6c2a16b1d2582abc59620d4adca8424d8
|
data/Gemfile.lock
CHANGED
data/lib/gh/events/slack.rb
CHANGED
@@ -11,9 +11,10 @@ module GH::Events::Slack
|
|
11
11
|
event = JSON.parse(payload, object_class: OpenStruct)
|
12
12
|
type = GH::Events.typeof(event).to_s
|
13
13
|
|
14
|
-
#
|
15
|
-
event.ref.
|
16
|
-
event.ref.
|
14
|
+
# unify
|
15
|
+
event.ref_type = 'branch' if event.ref.match(/^refs\/heads\//)
|
16
|
+
event.ref_type = 'tag' if event.ref.match(/^refs\/tags\//)
|
17
|
+
event.ref = event.ref.split('/').last
|
17
18
|
|
18
19
|
template = (templates[type] || "No template for type: #{type}.")
|
19
20
|
render(template, event)
|
data/lib/gh/events/version.rb
CHANGED
data/res/slack.yml
CHANGED
@@ -1,21 +1,33 @@
|
|
1
|
+
# refs are unified. So all events have `ref` and `ref_type`.
|
2
|
+
|
1
3
|
unknown: >-
|
2
4
|
An unknown event occurred.
|
5
|
+
|
3
6
|
push: >-
|
4
|
-
_<%= pusher.name %>_
|
5
|
-
|
7
|
+
_<%= pusher.name %>_ <%= forced ? 'force-' : '' %>pushed
|
8
|
+
<%= size %> commits
|
9
|
+
to <%= ref_type %> `<%= ref %>`
|
10
|
+
on <<%= repository.html_url %>|<%= repository.full_name %>>
|
6
11
|
:star: <%= repository.stargazers_count %>
|
7
12
|
:eye: <%= repository.watchers_count %>
|
8
13
|
(<<%= compare %>|compare>)
|
14
|
+
|
9
15
|
commit_comment: >-
|
10
16
|
_<%= comment.user.login %>_ commented the
|
11
17
|
<%= comment.url %>|commit `<%= comment.commit_id %>`> on
|
12
18
|
<<%= repository.html_url %>|<%= repository.full_name %>>: _<%= comment.body %>_
|
13
|
-
|
14
|
-
create:
|
19
|
+
|
20
|
+
create: >-
|
21
|
+
_<%= sender.login %>_ created
|
22
|
+
the <%= ref_type %> `<%= ref %>`
|
23
|
+
on <<%= repository.html_url %>|<%= repository.full_name %>>
|
24
|
+
|
15
25
|
delete: >-
|
16
|
-
_<%= sender.login %>_
|
26
|
+
_<%= sender.login %>_ deleted
|
17
27
|
the <%= ref_type %> `<%= ref %>`
|
18
28
|
on <<%= repository.html_url %>|<%= repository.full_name %>>
|
29
|
+
|
30
|
+
watch: An event of type `watch` occurred.
|
19
31
|
deployment: An event of type `deployment` occurred.
|
20
32
|
deployment_status: An event of type `deployment_status` occurred.
|
21
33
|
fork: An event of type `fork` occurred.
|