foreign_office 0.15.2 → 0.15.3
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 55303fba31a5fed680fcf1da22b7295bcfcb842b
|
4
|
+
data.tar.gz: 67eea7e5379017d3730e17ba1b6667e37bf5bbc6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e3a39fe3a33286a6600a9039c01f0638b8c7b20b22bc9eb2f318ca3519bf52f14acaf70f854bba4ffcf40c7cdc55d0fe35c5e88d10830c598861946944121897
|
7
|
+
data.tar.gz: fc8b37b30d72a95d50c8ca09fcd617253804cba4e3e81267557352f3e4b81ead87e0a0a295fffbb05c9b8026d2ad75708fbe59181a9448aac4022e55ac9e1c3a
|
@@ -6,10 +6,13 @@ var PusherBus = Class.extend({
|
|
6
6
|
this.pusher = new Pusher(key, config);
|
7
7
|
},
|
8
8
|
subscribe: function(subscription){
|
9
|
-
this.channel = this.pusher.subscribe(subscription.channel);
|
9
|
+
this.channel = this.pusher.subscribe(this.get_channel_name(subscription.channel));
|
10
10
|
this.channel.bind('publish', function(data){
|
11
11
|
subscription.callback(data);
|
12
12
|
})
|
13
|
+
},
|
14
|
+
get_channel_name: function(channel_name){
|
15
|
+
return channel_name.replace(/::/g, '.')
|
13
16
|
}
|
14
17
|
})
|
15
18
|
PusherBus.third_party_library = 'Pusher'
|
@@ -34,10 +34,15 @@ class ForeignOffice::Busses::PusherBus < ForeignOffice::Busses::GenericBus
|
|
34
34
|
|
35
35
|
def self.publish(message)
|
36
36
|
message.symbolize_keys!
|
37
|
+
channel = sanitize_channel(message[:channel])
|
37
38
|
self.connection.trigger(
|
38
|
-
|
39
|
+
channel,
|
39
40
|
'publish',
|
40
41
|
message
|
41
42
|
)
|
42
43
|
end
|
44
|
+
|
45
|
+
def self.sanitize_channel(channel)
|
46
|
+
channel.gsub(/::/,'.')
|
47
|
+
end
|
43
48
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foreign_office
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.15.
|
4
|
+
version: 0.15.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Draut
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2017-07-
|
12
|
+
date: 2017-07-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|