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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 329f4a21f34dfda0663a97f4d74b691bba541491
4
- data.tar.gz: 7f3da88951d7fd2a1a7bd982cc324eb550a82e0d
3
+ metadata.gz: 900f5709de49334bd3cb12ed7f221746734d80ab
4
+ data.tar.gz: f229e6ce3555005f977162275bfa627ed6f4ed5e
5
5
  SHA512:
6
- metadata.gz: 0608f25926cd5646ea0665b86e53d1a5a1aa18079504a9d166dc99fb8ab85cd3c21e34f47566a8504bd6f8f598ef5569e67bea6112e901124ad6249735f20665
7
- data.tar.gz: 5d5e776f0f9115d2636f3f8095132d8da9316e4d33acb39b208a2fc6ebca5f8016d926fead214a012670e784a438b0dbb8652829d2aaeeb8d746613d749ab37f
6
+ metadata.gz: fa2d4cc73ebed8ba46a5162dd8f5587bc08c7959e43fdf064a5de3669fcd8385ceefce1f7dcb6749bf917ad67398d44d30677c26db8d2dc7202612ccb3ed08ae
7
+ data.tar.gz: 74603720ddb9efe8bd522282417db16e1a26fcb31f1ce05111fc0689e7472cca635836b24cff37ecb4d16fa6b0a89ccab4fe77a31acc96da42f79b545292dd2f
@@ -8,5 +8,5 @@ require 'build_buddy/server'
8
8
  require 'build_buddy/build_data'
9
9
 
10
10
  module BuildBuddy
11
- VERSION = "1.4.0"
11
+ VERSION = "1.4.1"
12
12
  end
@@ -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
- user_map = @rt_client.users.map {|user| [user['name'], user['id']]}.to_h
36
- @reverse_user_map = user_map.invert
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
- sending_user_name = @reverse_user_map[sending_user_id]
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.0
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-06 00:00:00.000000000 Z
11
+ date: 2016-02-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: timers