rackdis 0.13.pre.beta → 0.14.pre.beta

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: a9bd040fb693bdb802156db1b45b53441db94b83
4
- data.tar.gz: 57d16ec524fd6e457d10d8c5a65566611ba552b6
3
+ metadata.gz: ac6def437fb8a8d6ca1ba958cf36ce14840ab72f
4
+ data.tar.gz: fc9df32e8e210c6797aa01cb03d31cdf9a01ea4b
5
5
  SHA512:
6
- metadata.gz: a5bda607afe98869d81a1ce26af8770196eba8a7971ed4e711fdc94e88140c7f63055fe09338e1f31c5c1ea8d0b82387e2c3153e889deb16fc0a7fccd9063a7d
7
- data.tar.gz: 2828c0d819da0e2c2423eb6e87f17bc8ea360b295ea263ff42f044d1610fb080ede747546851f3b3a424e8b4e048db02c3c75db5a4650494bbf0c3cf7012c9a9
6
+ metadata.gz: 0112d42c1165b09053837ca82e9071157ce136832fa1540c07428723fed95644caf955dda6433e88a0c29137b7b749a15e9ebe8855dffbcef995d61039efc29f
7
+ data.tar.gz: 930c454e024fd2bbd20fc694631aefb591db57c1a3732d4fefb248608eb9b437f54ebcb2460e6ddb278ea11ba83d1fb16b5162a8d00639949297bb296f4d9916
@@ -19,18 +19,20 @@ module Rackdis
19
19
 
20
20
  def do_subscribe
21
21
  after_open do
22
- Rackdis.logger.debug "Someone subscribed to #{params[:channel]}"
23
- redis.redis.subscribe params[:channel] do |on|
22
+ channels = params[:channels].split("/")
23
+ Rackdis.logger.debug "Someone subscribed to #{channels}"
24
+ redis.redis.subscribe(channels) do |on|
24
25
  on.message do |channel, msg|
25
- Rackdis.logger.debug "Pushing: #{msg}"
26
- chunk msg
26
+ out = { channel: channel, message: msg }
27
+ Rackdis.logger.debug "Pushing: #{out}"
28
+ chunk out.to_json
27
29
  end
28
30
  end
29
31
  end
30
32
 
31
33
  status 200
32
34
  header 'Content-Type', 'application/json'
33
- ""
35
+ return ""
34
36
  end
35
37
 
36
38
  def args
@@ -39,11 +41,11 @@ module Rackdis
39
41
  end
40
42
 
41
43
  # Subscribe
42
- get 'subscribe/:channel' do
44
+ get 'subscribe/*channels' do
43
45
  do_subscribe
44
46
  end
45
47
 
46
- get 'SUBSCRIBE/:channel' do
48
+ get 'SUBSCRIBE/*channels' do
47
49
  do_subscribe
48
50
  end
49
51
 
@@ -1,3 +1,3 @@
1
1
  module Rackdis
2
- VERSION = "0.13-beta"
2
+ VERSION = "0.14-beta"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rackdis
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.pre.beta
4
+ version: 0.14.pre.beta
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert McLeod
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-18 00:00:00.000000000 Z
11
+ date: 2014-12-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack