relax-rb 0.1.3 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/relax/base.rb +3 -1
- data/lib/relax/bot.rb +5 -3
- data/lib/relax/event_listener.rb +1 -1
- data/lib/relax/version.rb +1 -1
- data/lib/relax.rb +1 -0
- data/relax-rb.gemspec +1 -0
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c6d51b5335245cac025f3922d4c94439249d746c
|
4
|
+
data.tar.gz: 3b8915bd4a40f0644efcd4d3dc12d6ded8ba6f84
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a347952b9f075c2b812de5427650e808c21ab11d489f56dcd898d3a4d9c18d0122c031e80118dc5433de36dbcf2db6d3b82ff9910c310573567b8eaddb761158
|
7
|
+
data.tar.gz: 7960faa70a9029b8fb7a9a14ee97e5ce933c14ec8f9f93b98416baa04db96422feade73e44f57b4d2a25febf2a962afb3733d32b106846e85f18501e4e8f840d
|
data/lib/relax/base.rb
CHANGED
data/lib/relax/bot.rb
CHANGED
@@ -12,9 +12,11 @@ module Relax
|
|
12
12
|
raise BotsPubsubNotSetError, "Environment Variable RELAX_BOTS_PUBSUB is not set"
|
13
13
|
end
|
14
14
|
|
15
|
-
redis.
|
16
|
-
|
17
|
-
|
15
|
+
redis.with do |conn|
|
16
|
+
conn.multi do
|
17
|
+
conn.hset(relax_bots_key, team_uid, {team_id: team_uid, token: token}.to_json)
|
18
|
+
conn.publish(relax_bots_pubsub, {type: 'team_added', team_id: team_uid}.to_json)
|
19
|
+
end
|
18
20
|
end
|
19
21
|
end
|
20
22
|
|
data/lib/relax/event_listener.rb
CHANGED
@@ -15,7 +15,7 @@ module Relax
|
|
15
15
|
self.log("Listening for Relax Events...")
|
16
16
|
|
17
17
|
while true do
|
18
|
-
queue_name, event_json = redis.blpop(relax_events_queue)
|
18
|
+
queue_name, event_json = redis.with { |c| c.blpop(relax_events_queue) }
|
19
19
|
|
20
20
|
if queue_name == relax_events_queue
|
21
21
|
event = Event.new(JSON.parse(event_json))
|
data/lib/relax/version.rb
CHANGED
data/lib/relax.rb
CHANGED
data/relax-rb.gemspec
CHANGED
@@ -29,6 +29,7 @@ Gem::Specification.new do |spec|
|
|
29
29
|
|
30
30
|
spec.add_dependency "redis", "~> 3.2.1"
|
31
31
|
spec.add_dependency "json", "~> 1.8.3"
|
32
|
+
spec.add_dependency "connection_pool", "~> 2.2.0"
|
32
33
|
|
33
34
|
spec.add_development_dependency "bundler", "~> 1.10"
|
34
35
|
spec.add_development_dependency "rake", "~> 10.0"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: relax-rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- arunthampi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-02-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: redis
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 1.8.3
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: connection_pool
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 2.2.0
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 2.2.0
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: bundler
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|