garufa 1.1.3 → 1.1.4.rc.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/garufa/connection.rb +17 -4
- data/lib/garufa/garufa_app.rb +3 -0
- data/lib/garufa/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c537042270fa7abbcd2be5811f5939c444deab3e
|
4
|
+
data.tar.gz: 6e720d0221a635101b71b2369a273f2ffe49d47e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a7632baa7076a9ff5d7034ef66901dd7882356ef57c3de8d2c4cad6badd80c405bd07a003d13e918ae585ff0f09ebaad7b0b6d77d8ae39a9beb547aea41be395
|
7
|
+
data.tar.gz: ad5f95c1b30a65651f6f17902bc268e305aab74c09ec86fe7c5e2e8352ece34077221a856f45c1aaee901ae5a5bcbd5736d3e9e6ac6840331b6b3281153b1d73
|
data/lib/garufa/connection.rb
CHANGED
@@ -35,7 +35,7 @@ module Garufa
|
|
35
35
|
when /^pusher:/
|
36
36
|
handle_pusher_event(event, data)
|
37
37
|
when /^client-/
|
38
|
-
handle_client_event(event, data)
|
38
|
+
handle_client_event(event, data, message.channel)
|
39
39
|
end
|
40
40
|
end
|
41
41
|
|
@@ -69,9 +69,14 @@ module Garufa
|
|
69
69
|
end
|
70
70
|
end
|
71
71
|
|
72
|
-
def handle_client_event(event, data)
|
73
|
-
|
74
|
-
|
72
|
+
def handle_client_event(event, data, channel)
|
73
|
+
return unless Config[:client_events_enabled]
|
74
|
+
|
75
|
+
subscription = @subscriptions[channel]
|
76
|
+
|
77
|
+
if subscription && (subscription.private_channel? || subscription.presence_channel?)
|
78
|
+
notify_clients(subscription, event, data)
|
79
|
+
end
|
75
80
|
end
|
76
81
|
|
77
82
|
def pusher_ping(data)
|
@@ -129,6 +134,14 @@ module Garufa
|
|
129
134
|
send_message Message.subscription_succeeded(channel, data)
|
130
135
|
end
|
131
136
|
|
137
|
+
def notify_clients(subscription, event, data)
|
138
|
+
options = {
|
139
|
+
data: data,
|
140
|
+
socket_id: subscription.socket_id
|
141
|
+
}
|
142
|
+
Subscriptions.notify [subscription.channel], event, options
|
143
|
+
end
|
144
|
+
|
132
145
|
def notify_member(event, subscription)
|
133
146
|
options = {
|
134
147
|
data: subscription.channel_data,
|
data/lib/garufa/garufa_app.rb
CHANGED
data/lib/garufa/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: garufa
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.4.rc.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Juan Manuel Cuello
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-10-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: goliath
|
@@ -204,9 +204,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
204
204
|
version: '1.9'
|
205
205
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
206
206
|
requirements:
|
207
|
-
- - "
|
207
|
+
- - ">"
|
208
208
|
- !ruby/object:Gem::Version
|
209
|
-
version:
|
209
|
+
version: 1.3.1
|
210
210
|
requirements: []
|
211
211
|
rubyforge_project:
|
212
212
|
rubygems_version: 2.2.2
|