foreign_office 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/foreign_office.js +11 -1
- data/app/assets/javascripts/test_bus.js +4 -0
- data/lib/foreign_office/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 66c0acf7def09497bd9be0e9a071c68436d08db0
|
4
|
+
data.tar.gz: b33fb3acfbdce38c10ba9f06cc7e3206697275a5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 03794deaa596219d2fd150ed9dea1fe497b87f01d206e1581fb2bcdc267a1d45c74d3ce1ec3f4b29863d0b7315f1c0f59ac47cfa13a04f64c6ec625d4b193fee
|
7
|
+
data.tar.gz: 75a019150860afecdd3c0e19cabe9eea880dfcacb4294141efd9a15e6d9f4a09618a44d42451d08136d74799d923688ab0edbab7f551e68aabb566078a54e99c
|
@@ -1,6 +1,7 @@
|
|
1
1
|
//= require debug_logger
|
2
2
|
//= require pubnub_bus
|
3
3
|
//= require pusher_bus
|
4
|
+
//= require test_bus
|
4
5
|
|
5
6
|
var ForeignOffice = Class.extend({
|
6
7
|
init: function(){
|
@@ -8,7 +9,12 @@ var ForeignOffice = Class.extend({
|
|
8
9
|
this.channels_by_name = [];
|
9
10
|
},
|
10
11
|
config: function(config){
|
11
|
-
|
12
|
+
third_party_busname = this.busMap(config.bus_name)
|
13
|
+
if (typeof(eval(third_party_busname)) != 'undefined') {
|
14
|
+
bus_class = eval(config.bus_name);
|
15
|
+
} else {
|
16
|
+
bus_class = TestBus
|
17
|
+
}
|
12
18
|
this.bus = new bus_class(config);
|
13
19
|
},
|
14
20
|
addListener: function($listener){
|
@@ -26,6 +32,10 @@ var ForeignOffice = Class.extend({
|
|
26
32
|
},
|
27
33
|
channelNames: function(){
|
28
34
|
return $.map(this.channels,function(channel){return channel.channel_name});
|
35
|
+
},
|
36
|
+
busMap: function(bus_name) {
|
37
|
+
var map = { PubnubBus: 'PUBNUB',
|
38
|
+
PusherBus: 'Pusher'}[bus_name]
|
29
39
|
}
|
30
40
|
});
|
31
41
|
|
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.1.
|
4
|
+
version: 0.1.1
|
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: 2014-08
|
12
|
+
date: 2014-10-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -80,6 +80,7 @@ files:
|
|
80
80
|
- app/assets/javascripts/foreign_office.js
|
81
81
|
- app/assets/javascripts/pubnub_bus.js
|
82
82
|
- app/assets/javascripts/pusher_bus.js
|
83
|
+
- app/assets/javascripts/test_bus.js
|
83
84
|
- lib/foreign_office.rb
|
84
85
|
- lib/foreign_office/busses/generic_bus.rb
|
85
86
|
- lib/foreign_office/busses/pubnub_bus.rb
|