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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3e7d0227f0f470f7375b6a32a0e5b40cd613916a
4
- data.tar.gz: 48061a12cb2c80694c45c35f39ea9948c90df2ad
3
+ metadata.gz: 66c0acf7def09497bd9be0e9a071c68436d08db0
4
+ data.tar.gz: b33fb3acfbdce38c10ba9f06cc7e3206697275a5
5
5
  SHA512:
6
- metadata.gz: 538c96df8d6a69055389b27df327b3f6b10aa23e37aff0cd172ed041b2ba7aeaaf2c0d170a1bae6e6ba418c837d06e1a20bab0d9b024009f6adcf39cf2f39f98
7
- data.tar.gz: 9b07c8dcb8162ca3ddb12280b5c1e76892d58c107cca7dc9ca45b48a4a19d537b00c712e8e3d1a5aa2d9c6d11cb578d93a06258c7827a4c560bc1dee3b1b8a46
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
- bus_class = eval(config.bus_name);
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
 
@@ -0,0 +1,4 @@
1
+ var TestBus = Class.extend({
2
+ init: function(config) {},
3
+ subscribe: function(subscription){}
4
+ })
@@ -1,3 +1,3 @@
1
1
  module ForeignOffice
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  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.1.0
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-29 00:00:00.000000000 Z
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