roda-component 0.1.53 → 0.1.54

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 41c126a7621dc0b571681e4ddd74ff0c35c13e89
4
- data.tar.gz: 1255952e2020d8b3d54b536cbc96f52280ac7b43
3
+ metadata.gz: ac93227aa38ca66d828975be429d53f4f49b4829
4
+ data.tar.gz: 89e584ade93b145089a3a881aa244eaf6a083707
5
5
  SHA512:
6
- metadata.gz: 6325870641c04381f926fee8a2153df4aebcc819aa2a75618866cba97e40a26c2ad8fd09abbf4d0a1f3487c78095e6bb120b8a8c419858f9eeabf91f310b32af
7
- data.tar.gz: 5740196694645b1365fd931074d86d5f7cac36f414c301d74764fa54987b215d3311354a985aa31f17e901e18416ce4beb469118418073b29006b903a360ae23
6
+ metadata.gz: f25e8aa49e8302ec65cee1f801d4bf85d4a5a345fa194738388c0893e8058fd2e7fa9bc7b6d415ed0685a29035618b7aaea7ee0be789ad8f71ab99df6b3cbed9
7
+ data.tar.gz: a5548d6a14d481a23bedc91c061427225b4504c60f4b4f0502e653e2e36b2d6f8af558e9a40934bfdb103c65d44584665e0cdf05261758fe762d83af683811ca
@@ -93,7 +93,7 @@ class Roda
93
93
  def _initialize(scope = false)
94
94
  @_scope = scope if scope
95
95
 
96
- if client? && !$component_opts[:faye][:"#{self.class._name}"]
96
+ if $faye && client? && !$component_opts[:faye][:"#{self.class._name}"]
97
97
  $component_opts[:faye][:"#{self.class._name}"] = true
98
98
 
99
99
  $faye.subscribe "/components/#{self.class._name}" do |msg|
@@ -125,7 +125,7 @@ class Roda
125
125
  event_type: 'call',
126
126
  event_method: name.to_s,
127
127
  data: options
128
- })
128
+ }) if $faye
129
129
  end
130
130
  end
131
131
 
@@ -19,6 +19,8 @@ if RUBY_ENGINE == 'opal'
19
19
  attr_accessor :disconnected, :online
20
20
 
21
21
  def initialize url
22
+ return false unless `(typeof Faye === 'function')`
23
+
22
24
  super `new Faye.Client(#{url})`
23
25
  set_header 'X-CSRF-TOKEN', Element.find('meta[name=_csrf]').attr('content')
24
26
  add_extension({
@@ -1,5 +1,5 @@
1
1
  class Roda
2
2
  class Component
3
- VERSION = "0.1.53"
3
+ VERSION = "0.1.54"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: roda-component
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.53
4
+ version: 0.1.54
5
5
  platform: ruby
6
6
  authors:
7
7
  - cj
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-09 00:00:00.000000000 Z
11
+ date: 2015-03-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: opal