build-buddy 1.4.0 → 1.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/build_buddy.rb +1 -1
- data/lib/build_buddy/slacker.rb +9 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 900f5709de49334bd3cb12ed7f221746734d80ab
|
4
|
+
data.tar.gz: f229e6ce3555005f977162275bfa627ed6f4ed5e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fa2d4cc73ebed8ba46a5162dd8f5587bc08c7959e43fdf064a5de3669fcd8385ceefce1f7dcb6749bf917ad67398d44d30677c26db8d2dc7202612ccb3ed08ae
|
7
|
+
data.tar.gz: 74603720ddb9efe8bd522282417db16e1a26fcb31f1ce05111fc0689e7472cca635836b24cff37ecb4d16fa6b0a89ccab4fe77a31acc96da42f79b545292dd2f
|
data/lib/build_buddy.rb
CHANGED
data/lib/build_buddy/slacker.rb
CHANGED
@@ -22,7 +22,6 @@ module BuildBuddy
|
|
22
22
|
end
|
23
23
|
@rt_client.start_async
|
24
24
|
@notify_slack_channel = nil
|
25
|
-
@reverse_user_map = nil
|
26
25
|
end
|
27
26
|
|
28
27
|
def on_slack_error(error)
|
@@ -32,9 +31,8 @@ module BuildBuddy
|
|
32
31
|
|
33
32
|
def on_slack_hello
|
34
33
|
user_id = @rt_client.self['id']
|
35
|
-
|
36
|
-
|
37
|
-
info "Connected to Slack as user id #{user_id} (@#{@reverse_user_map[user_id]})"
|
34
|
+
map_user_id_to_name = @rt_client.users.map {|user| [user['id'], user['name']]}.to_h
|
35
|
+
info "Connected to Slack as user id #{user_id} (@#{map_user_id_to_name[user_id]})"
|
38
36
|
|
39
37
|
channel_map = @rt_client.channels.map {|channel| [channel['name'], channel['id']]}.to_h
|
40
38
|
group_map = @rt_client.groups.map {|group| [group['name'], group['id']]}.to_h
|
@@ -66,7 +64,13 @@ module BuildBuddy
|
|
66
64
|
end
|
67
65
|
sending_user_name = data['username']
|
68
66
|
else
|
69
|
-
|
67
|
+
map_user_id_to_name = @rt_client.users.map {|user| [user['id'], user['name']]}.to_h
|
68
|
+
sending_user_name = map_user_id_to_name[sending_user_id]
|
69
|
+
|
70
|
+
if sending_user_name.nil?
|
71
|
+
error "User #{sending_user_id} is not known"
|
72
|
+
return
|
73
|
+
end
|
70
74
|
end
|
71
75
|
|
72
76
|
# Don't respond if _we_ sent the message!
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: build-buddy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Lyon-smith
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-02-
|
11
|
+
date: 2016-02-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: timers
|