lita-github-pinger 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
  SHA1:
3
- metadata.gz: 381239aaeee49d2a030d4ac5eaf45e55cd66086f
4
- data.tar.gz: 4cdf03fa6c63bb5ea07825742e71f1e532b30450
3
+ metadata.gz: e0d0c43ce18fa74ef02ff02f9bc9aaae3abdc75b
4
+ data.tar.gz: 57d70755df2863c234c2c9a94f74f6f51a89be62
5
5
  SHA512:
6
- metadata.gz: 65a2331964e1fce30e9b0c37fcfd25aaa18096e733b3be5fee15a081cb677963c427b87413cd15c6b68c3ce6ad61d588902b4b3c9fda1ea297d58ecc121db1fd
7
- data.tar.gz: bcb6b9ddbbfed2e65b677ee6e5d6dbcc069abe568afdc54639979d64770d748734d9991c40192ff1278b9219d6588e88eb6bca7fdf51b016aa41dbdb8c2df716
6
+ metadata.gz: b139be3fe17a3f570a832db23cb43bb7dc8a904454da0ba08a739343fc6164a8cb020260dbd07f1a56ab6ea329b8bc21a93016cbd653e2970ac3b0120d11a770
7
+ data.tar.gz: b8f90a271e5ab566f30fee252f0e69fbe277c2476cbcdcf08463055501f1c9b26d835102651e3774877fcc215970a0d0c4b82be52df8d9476bfb3e50f92686bf
@@ -2,18 +2,19 @@ module Lita
2
2
  module Handlers
3
3
  class GithubPinger < Handler
4
4
 
5
- config :enginners, type: Array, required: true
5
+ config :engineers, type: Array, required: true
6
6
 
7
- route(/assigned to (.*)\)/, :detect_comment, command: false)
7
+ route(/@(\w*)/, :detect_comment, command: false)
8
8
 
9
9
  def detect_comment(message)
10
10
  log(message.user.metadata["name"] + " was detected as a github bot")
11
+
11
12
  return unless message.user.metadata["name"] == "github"
12
- pr_owner = message.matches[0][0]
13
+ mentioned_username = message.matches[0][0]
13
14
 
14
15
  # side effects intentional
15
16
  found = config.engineers.any? do |eng|
16
- message.reply("@" + eng[:slack]) if eng[:github] == pr_owner
17
+ message.reply("@" + eng[:slack]) if eng[:github] == mentioned_username
17
18
  end
18
19
 
19
20
  unless found
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "lita-github-pinger"
3
- spec.version = "0.1.1"
3
+ spec.version = "0.1.2"
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."
@@ -1,8 +1,49 @@
1
1
  require "spec_helper"
2
2
 
3
3
  describe Lita::Handlers::GithubPinger, lita_handler: true do
4
+ before do
5
+ registry.config.handlers.github_pinger.engineers = [
6
+ {
7
+ slack: "taylor",
8
+ github: "taylorlapeyre"
9
+ },
10
+ {
11
+ slack: "petergao",
12
+ github: "peteygao"
13
+ },
14
+ {
15
+ slack: "matt",
16
+ github: "mtthgn"
17
+ },
18
+ {
19
+ slack: "bigsean",
20
+ github: "telaviv"
21
+ },
22
+ {
23
+ slack: "urich",
24
+ github: "maalur"
25
+ },
26
+ {
27
+ slack: "evan",
28
+ github: "evantarrh"
29
+ },
30
+ {
31
+ slack: "bsturd",
32
+ github: "bsturdivan"
33
+ },
34
+ {
35
+ slack: "jeff",
36
+ github: "jeffmicklos"
37
+ },
38
+ {
39
+ slack: "nan",
40
+ github: "thenanyu"
41
+ }
42
+ ]
43
+ end
44
+
4
45
  it "will respond" do
5
- send_message("assigned to taylorlapeyre)")
46
+ send_message("comments up @taylorlapeyre)")
6
47
  expect(replies.count).to eq 0
7
48
  end
8
49
  end
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.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Taylor Lapeyre