lita-github-pinger 0.2.3 → 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3a7a8963fc1e132d23b423e867bec4ce1ba1de85
4
- data.tar.gz: 6b610f7318532b20c484532862b383f06444aa77
3
+ metadata.gz: aaae30f11bb2634fe7b5c72fcdeaa52505148523
4
+ data.tar.gz: cd5ef8a6284537282e8eb77ace744ecd6855a8b7
5
5
  SHA512:
6
- metadata.gz: 407f6aa43001fcd9871ab1dbbb8a43dffb425901d7246dcc27181ddf46a51ff78084de7b58a0a24801c59b80767c45a6895bc29a4ebce4f35a4d24de29e1c491
7
- data.tar.gz: cba4f864b8abd8e84beaa0db6379e977160dff5280774c68a5e3642e08c3edd86419d622d6bcb411a7f8a0455fecce7a8ba03b708bdffdc2770709ecacd407f5
6
+ metadata.gz: 9fb69d73e114072d171825202d3e35b87b8568e56eced5047e3ac438a5c592661b1652457e10c92cc17dc24cbcf40084d2e34d8d9144bd33f0b7de3e3b5cfcc0
7
+ data.tar.gz: 22f4cb87ac643648671797e76d6d8ee4648b78a72b136226d016ec03d0f1d253fc259b7b9b6468489b8ea597c0b2ce159b0e81642378503d75bf6a17af8aae49
@@ -6,13 +6,24 @@ module Lita
6
6
 
7
7
  route(/@(\w*)/, :detect_comment, command: false)
8
8
 
9
- http.get "/ghping", :ghping
9
+ http.post "/ghping", :ghping
10
10
 
11
11
  def ghping(request, response)
12
+ body = MultiJson.parse(request.body)
13
+
14
+ if body["events"].include?("pull_request_review_comment")
15
+ send_dm("taylor", "Pull Request Comment: ```#{body}```")
16
+ else
17
+ send_dm("taylor", "Pull Request Event: ```#{body}```")
18
+ end
19
+
20
+ response
21
+ end
22
+
23
+ def alert_eng_pr(message)
12
24
  room = Lita::Room.fuzzy_find("eng")
13
25
  source = Lita::Source.new(room: room)
14
- robot.send_message(source, "I just got pinged at /ghping!")
15
- response.body << "Hello, #{request.user_agent}!"
26
+ robot.send_message(source, message)
16
27
  end
17
28
 
18
29
  def send_dm(username, content)
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "lita-github-pinger"
3
- spec.version = "0.2.3"
3
+ spec.version = "0.2.4"
4
4
  spec.authors = ["Taylor Lapeyre"]
5
5
  spec.email = ["taylorlapeyre@gmail.com"]
6
6
  spec.description = "A Lita handler that detects github comment notifications and regurgitates a ping to the correct slack username."
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lita-github-pinger
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Taylor Lapeyre