hyper-resource 1.0.0.lap81 → 1.0.0.lap82
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 +4 -4
- data/README.md +4 -0
- data/docs/HyperRecord.html +1 -1
- data/docs/HyperRecord/ClassMethods.html +1 -1
- data/docs/HyperRecord/ClientInstanceMethods.html +5 -5
- data/docs/HyperRecord/Collection.html +1 -1
- data/docs/HyperRecord/DummyValue.html +1 -1
- data/docs/HyperRecord/PubSub.html +1 -1
- data/docs/HyperRecord/PubSub/ClassMethods.html +1 -1
- data/docs/HyperRecord/ServerClassMethods.html +1 -1
- data/docs/Hyperloop.html +1 -1
- data/docs/Hyperloop/Resource.html +1 -1
- data/docs/Hyperloop/Resource/ClientDrivers.html +1 -1
- data/docs/Hyperloop/Resource/HTTP.html +1 -1
- data/docs/Hyperloop/Resource/MethodsController.html +1 -1
- data/docs/Hyperloop/Resource/PropertiesController.html +1 -1
- data/docs/Hyperloop/Resource/PubSub.html +1 -1
- data/docs/Hyperloop/Resource/PubSub/ClassMethods.html +1 -1
- data/docs/Hyperloop/Resource/RelationsController.html +1 -1
- data/docs/Hyperloop/Resource/ScopesController.html +1 -1
- data/docs/Hyperloop/Resource/SecurityError.html +1 -1
- data/docs/Hyperloop/Resource/SecurityGuards.html +1 -1
- data/docs/Hyperloop/Resource/SecurityGuards/ClassMethods.html +1 -1
- data/docs/_index.html +1 -1
- data/docs/file.API.html +1 -1
- data/docs/file.JSON_format.html +1 -1
- data/docs/file.PubSub.html +1 -1
- data/docs/file.README.html +1 -1
- data/docs/index.html +1 -1
- data/docs/top-level-namespace.html +1 -1
- data/lib/hyper_record/client_instance_methods.rb +2 -2
- data/lib/hyper_record/pub_sub.rb +22 -1
- data/lib/hyperloop/resource/client_drivers.rb +7 -1
- data/lib/hyperloop/resource/pub_sub.rb +22 -1
- data/lib/hyperloop/resource/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b359653f34d6360e00c1c172495f780b22f80eb02f22968e985de4fc4266608d
|
4
|
+
data.tar.gz: d918dd83ae17af1ffeb00ecca28cc38025bbdddec180b817932d48418b1c8130
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9a1625252f2eebaf81453692117aafc443db45c983d6e69641246e8682e78600271ec5084ae41a7dbacec7fda7afe190bd2813a3a29794875e351a1b438dfe46
|
7
|
+
data.tar.gz: 1b953cff7595aeeeb4be32707cbd0169b0cc9c460d44fa8b2fd101e7d8551d1a43e4fcc09d0634c0cbfc7f890de3461938c16d530c0c62f44c20de92c0111f35
|
data/README.md
CHANGED
@@ -6,6 +6,10 @@ HyperResource is an affective way of moving data between your server and clients
|
|
6
6
|
|
7
7
|
[](http://www.youtube.com/watch?v=fPSpESBbeMQ "Reactivity Demo")
|
8
8
|
|
9
|
+
[Documentation](https://janbiedermann.github.io/hyper-resource "Github Repo")
|
10
|
+
|
11
|
+
Supports Pusher and ActionCable (thanks @gabrielrios)
|
12
|
+
|
9
13
|
## Motivation
|
10
14
|
|
11
15
|
+ To co-exist with a resource based REST API
|
data/docs/HyperRecord.html
CHANGED
@@ -109,7 +109,7 @@
|
|
109
109
|
</div>
|
110
110
|
|
111
111
|
<div id="footer">
|
112
|
-
Generated on Sun Jun 10 23:
|
112
|
+
Generated on Sun Jun 10 23:20:59 2018 by
|
113
113
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
114
114
|
0.9.13 (ruby-2.5.1).
|
115
115
|
</div>
|
@@ -2967,7 +2967,7 @@ client side options are ignored</p>
|
|
2967
2967
|
</div>
|
2968
2968
|
|
2969
2969
|
<div id="footer">
|
2970
|
-
Generated on Sun Jun 10 23:
|
2970
|
+
Generated on Sun Jun 10 23:20:59 2018 by
|
2971
2971
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
2972
2972
|
0.9.13 (ruby-2.5.1).
|
2973
2973
|
</div>
|
@@ -138,7 +138,7 @@
|
|
138
138
|
|
139
139
|
|
140
140
|
<span class="summary_desc"><div class='inline'>
|
141
|
-
<p>
|
141
|
+
<p>Check if record has been changed since last save.</p>
|
142
142
|
</div></span>
|
143
143
|
|
144
144
|
</li>
|
@@ -186,7 +186,7 @@
|
|
186
186
|
|
187
187
|
|
188
188
|
<span class="summary_desc"><div class='inline'>
|
189
|
-
<p>
|
189
|
+
<p>Check if record has been destroyed.</p>
|
190
190
|
</div></span>
|
191
191
|
|
192
192
|
</li>
|
@@ -719,7 +719,7 @@ returns value</p>
|
|
719
719
|
</h3><div class="docstring">
|
720
720
|
<div class="discussion">
|
721
721
|
|
722
|
-
<p>
|
722
|
+
<p>Check if record has been changed since last save.</p>
|
723
723
|
|
724
724
|
|
725
725
|
</div>
|
@@ -839,7 +839,7 @@ returns value</p>
|
|
839
839
|
</h3><div class="docstring">
|
840
840
|
<div class="discussion">
|
841
841
|
|
842
|
-
<p>
|
842
|
+
<p>Check if record has been destroyed.</p>
|
843
843
|
|
844
844
|
|
845
845
|
</div>
|
@@ -1906,7 +1906,7 @@ success is assumed</p>
|
|
1906
1906
|
</div>
|
1907
1907
|
|
1908
1908
|
<div id="footer">
|
1909
|
-
Generated on Sun Jun 10 23:
|
1909
|
+
Generated on Sun Jun 10 23:21:00 2018 by
|
1910
1910
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1911
1911
|
0.9.13 (ruby-2.5.1).
|
1912
1912
|
</div>
|
@@ -554,7 +554,7 @@
|
|
554
554
|
</div>
|
555
555
|
|
556
556
|
<div id="footer">
|
557
|
-
Generated on Sun Jun 10 23:
|
557
|
+
Generated on Sun Jun 10 23:21:00 2018 by
|
558
558
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
559
559
|
0.9.13 (ruby-2.5.1).
|
560
560
|
</div>
|
@@ -374,7 +374,7 @@
|
|
374
374
|
</div>
|
375
375
|
|
376
376
|
<div id="footer">
|
377
|
-
Generated on Sun Jun 10 23:
|
377
|
+
Generated on Sun Jun 10 23:21:00 2018 by
|
378
378
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
379
379
|
0.9.13 (ruby-2.5.1).
|
380
380
|
</div>
|
@@ -1669,7 +1669,7 @@ again</p>
|
|
1669
1669
|
</div>
|
1670
1670
|
|
1671
1671
|
<div id="footer">
|
1672
|
-
Generated on Sun Jun 10 23:
|
1672
|
+
Generated on Sun Jun 10 23:20:59 2018 by
|
1673
1673
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1674
1674
|
0.9.13 (ruby-2.5.1).
|
1675
1675
|
</div>
|
@@ -2037,7 +2037,7 @@ again</p>
|
|
2037
2037
|
</div>
|
2038
2038
|
|
2039
2039
|
<div id="footer">
|
2040
|
-
Generated on Sun Jun 10 23:
|
2040
|
+
Generated on Sun Jun 10 23:20:59 2018 by
|
2041
2041
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
2042
2042
|
0.9.13 (ruby-2.5.1).
|
2043
2043
|
</div>
|
@@ -687,7 +687,7 @@
|
|
687
687
|
</div>
|
688
688
|
|
689
689
|
<div id="footer">
|
690
|
-
Generated on Sun Jun 10 23:
|
690
|
+
Generated on Sun Jun 10 23:21:00 2018 by
|
691
691
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
692
692
|
0.9.13 (ruby-2.5.1).
|
693
693
|
</div>
|
data/docs/Hyperloop.html
CHANGED
@@ -176,7 +176,7 @@
|
|
176
176
|
</div>
|
177
177
|
|
178
178
|
<div id="footer">
|
179
|
-
Generated on Sun Jun 10 23:
|
179
|
+
Generated on Sun Jun 10 23:20:59 2018 by
|
180
180
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
181
181
|
0.9.13 (ruby-2.5.1).
|
182
182
|
</div>
|
@@ -125,7 +125,7 @@
|
|
125
125
|
</div>
|
126
126
|
|
127
127
|
<div id="footer">
|
128
|
-
Generated on Sun Jun 10 23:
|
128
|
+
Generated on Sun Jun 10 23:20:59 2018 by
|
129
129
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
130
130
|
0.9.13 (ruby-2.5.1).
|
131
131
|
</div>
|
@@ -342,7 +342,7 @@
|
|
342
342
|
</div>
|
343
343
|
|
344
344
|
<div id="footer">
|
345
|
-
Generated on Sun Jun 10 23:
|
345
|
+
Generated on Sun Jun 10 23:21:00 2018 by
|
346
346
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
347
347
|
0.9.13 (ruby-2.5.1).
|
348
348
|
</div>
|
@@ -1785,7 +1785,7 @@ JSON then an error will very likely be thrown.</p>
|
|
1785
1785
|
</div>
|
1786
1786
|
|
1787
1787
|
<div id="footer">
|
1788
|
-
Generated on Sun Jun 10 23:
|
1788
|
+
Generated on Sun Jun 10 23:21:00 2018 by
|
1789
1789
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1790
1790
|
0.9.13 (ruby-2.5.1).
|
1791
1791
|
</div>
|
@@ -469,7 +469,7 @@
|
|
469
469
|
</div>
|
470
470
|
|
471
471
|
<div id="footer">
|
472
|
-
Generated on Sun Jun 10 23:
|
472
|
+
Generated on Sun Jun 10 23:21:00 2018 by
|
473
473
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
474
474
|
0.9.13 (ruby-2.5.1).
|
475
475
|
</div>
|
@@ -215,7 +215,7 @@
|
|
215
215
|
</div>
|
216
216
|
|
217
217
|
<div id="footer">
|
218
|
-
Generated on Sun Jun 10 23:
|
218
|
+
Generated on Sun Jun 10 23:21:00 2018 by
|
219
219
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
220
220
|
0.9.13 (ruby-2.5.1).
|
221
221
|
</div>
|
@@ -1200,7 +1200,7 @@
|
|
1200
1200
|
</div>
|
1201
1201
|
|
1202
1202
|
<div id="footer">
|
1203
|
-
Generated on Sun Jun 10 23:
|
1203
|
+
Generated on Sun Jun 10 23:20:59 2018 by
|
1204
1204
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1205
1205
|
0.9.13 (ruby-2.5.1).
|
1206
1206
|
</div>
|
@@ -519,7 +519,7 @@
|
|
519
519
|
</div>
|
520
520
|
|
521
521
|
<div id="footer">
|
522
|
-
Generated on Sun Jun 10 23:
|
522
|
+
Generated on Sun Jun 10 23:21:00 2018 by
|
523
523
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
524
524
|
0.9.13 (ruby-2.5.1).
|
525
525
|
</div>
|
@@ -370,7 +370,7 @@
|
|
370
370
|
</div>
|
371
371
|
|
372
372
|
<div id="footer">
|
373
|
-
Generated on Sun Jun 10 23:
|
373
|
+
Generated on Sun Jun 10 23:21:00 2018 by
|
374
374
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
375
375
|
0.9.13 (ruby-2.5.1).
|
376
376
|
</div>
|
@@ -114,7 +114,7 @@
|
|
114
114
|
</div>
|
115
115
|
|
116
116
|
<div id="footer">
|
117
|
-
Generated on Sun Jun 10 23:
|
117
|
+
Generated on Sun Jun 10 23:21:00 2018 by
|
118
118
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
119
119
|
0.9.13 (ruby-2.5.1).
|
120
120
|
</div>
|
@@ -289,7 +289,7 @@
|
|
289
289
|
</div>
|
290
290
|
|
291
291
|
<div id="footer">
|
292
|
-
Generated on Sun Jun 10 23:
|
292
|
+
Generated on Sun Jun 10 23:21:00 2018 by
|
293
293
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
294
294
|
0.9.13 (ruby-2.5.1).
|
295
295
|
</div>
|
@@ -216,7 +216,7 @@
|
|
216
216
|
</div>
|
217
217
|
|
218
218
|
<div id="footer">
|
219
|
-
Generated on Sun Jun 10 23:
|
219
|
+
Generated on Sun Jun 10 23:21:00 2018 by
|
220
220
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
221
221
|
0.9.13 (ruby-2.5.1).
|
222
222
|
</div>
|
data/docs/_index.html
CHANGED
@@ -292,7 +292,7 @@
|
|
292
292
|
</div>
|
293
293
|
|
294
294
|
<div id="footer">
|
295
|
-
Generated on Sun Jun 10 23:
|
295
|
+
Generated on Sun Jun 10 23:20:59 2018 by
|
296
296
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
297
297
|
0.9.13 (ruby-2.5.1).
|
298
298
|
</div>
|
data/docs/file.API.html
CHANGED
@@ -128,7 +128,7 @@ end
|
|
128
128
|
</div></div>
|
129
129
|
|
130
130
|
<div id="footer">
|
131
|
-
Generated on Sun Jun 10 23:
|
131
|
+
Generated on Sun Jun 10 23:20:59 2018 by
|
132
132
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
133
133
|
0.9.13 (ruby-2.5.1).
|
134
134
|
</div>
|
data/docs/file.JSON_format.html
CHANGED
@@ -124,7 +124,7 @@
|
|
124
124
|
</div></div>
|
125
125
|
|
126
126
|
<div id="footer">
|
127
|
-
Generated on Sun Jun 10 23:
|
127
|
+
Generated on Sun Jun 10 23:20:59 2018 by
|
128
128
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
129
129
|
0.9.13 (ruby-2.5.1).
|
130
130
|
</div>
|
data/docs/file.PubSub.html
CHANGED
@@ -76,7 +76,7 @@ updated.</p>
|
|
76
76
|
</div></div>
|
77
77
|
|
78
78
|
<div id="footer">
|
79
|
-
Generated on Sun Jun 10 23:
|
79
|
+
Generated on Sun Jun 10 23:20:59 2018 by
|
80
80
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
81
81
|
0.9.13 (ruby-2.5.1).
|
82
82
|
</div>
|
data/docs/file.README.html
CHANGED
@@ -182,7 +182,7 @@ up your code and the client an server can share the same Models.</p>
|
|
182
182
|
</div></div>
|
183
183
|
|
184
184
|
<div id="footer">
|
185
|
-
Generated on Sun Jun 10 23:
|
185
|
+
Generated on Sun Jun 10 23:20:59 2018 by
|
186
186
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
187
187
|
0.9.13 (ruby-2.5.1).
|
188
188
|
</div>
|
data/docs/index.html
CHANGED
@@ -182,7 +182,7 @@ up your code and the client an server can share the same Models.</p>
|
|
182
182
|
</div></div>
|
183
183
|
|
184
184
|
<div id="footer">
|
185
|
-
Generated on Sun Jun 10 23:
|
185
|
+
Generated on Sun Jun 10 23:20:59 2018 by
|
186
186
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
187
187
|
0.9.13 (ruby-2.5.1).
|
188
188
|
</div>
|
@@ -100,7 +100,7 @@
|
|
100
100
|
</div>
|
101
101
|
|
102
102
|
<div id="footer">
|
103
|
-
Generated on Sun Jun 10 23:
|
103
|
+
Generated on Sun Jun 10 23:20:59 2018 by
|
104
104
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
105
105
|
0.9.13 (ruby-2.5.1).
|
106
106
|
</div>
|
@@ -62,7 +62,7 @@ module HyperRecord
|
|
62
62
|
|
63
63
|
### high level api
|
64
64
|
|
65
|
-
#
|
65
|
+
# Check if record has been changed since last save.
|
66
66
|
#
|
67
67
|
# @return boolean
|
68
68
|
def changed?
|
@@ -77,7 +77,7 @@ module HyperRecord
|
|
77
77
|
nil
|
78
78
|
end
|
79
79
|
|
80
|
-
#
|
80
|
+
# Check if record has been destroyed.
|
81
81
|
#
|
82
82
|
# @return [Boolean]
|
83
83
|
def destroyed?
|
data/lib/hyper_record/pub_sub.rb
CHANGED
@@ -44,8 +44,13 @@ module HyperRecord
|
|
44
44
|
end
|
45
45
|
channel_array << "hyper-record-update-channel-#{session_id}"
|
46
46
|
end
|
47
|
-
if
|
47
|
+
return if channel_array.size == 0
|
48
|
+
if Hyperloop.resource_transport == :pusher
|
48
49
|
_pusher_client.trigger_async(channel_array, 'update', message)
|
50
|
+
elsif Hyperloop.resource_transport == :action_cable
|
51
|
+
channel_array.each do |channel|
|
52
|
+
ActionCable.server.broadcast(channel, message)
|
53
|
+
end
|
49
54
|
end
|
50
55
|
end
|
51
56
|
Hyperloop.redis_instance.del("HRPS__#{record.class}__#{record.id}") if record.destroyed?
|
@@ -84,6 +89,10 @@ module HyperRecord
|
|
84
89
|
end
|
85
90
|
if Hyperloop.resource_transport == :pusher
|
86
91
|
_pusher_client.trigger_async(channel_array, 'update', message)
|
92
|
+
elsif Hyperloop.resource_transport == :action_cable
|
93
|
+
channel_array.each do |channel|
|
94
|
+
ActionCable.server.broadcast(channel, message)
|
95
|
+
end
|
87
96
|
end
|
88
97
|
end
|
89
98
|
end
|
@@ -111,6 +120,10 @@ module HyperRecord
|
|
111
120
|
end
|
112
121
|
if Hyperloop.resource_transport == :pusher
|
113
122
|
_pusher_client.trigger_async(channel_array, 'update', message)
|
123
|
+
elsif Hyperloop.resource_transport == :action_cable
|
124
|
+
channel_array.each do |channel|
|
125
|
+
ActionCable.server.broadcast(channel, message)
|
126
|
+
end
|
114
127
|
end
|
115
128
|
end
|
116
129
|
end
|
@@ -139,6 +152,10 @@ module HyperRecord
|
|
139
152
|
end
|
140
153
|
if Hyperloop.resource_transport == :pusher
|
141
154
|
_pusher_client.trigger_async(channel_array, 'update', message)
|
155
|
+
elsif Hyperloop.resource_transport == :action_cable
|
156
|
+
channel_array.each do |channel|
|
157
|
+
ActionCable.server.broadcast(channel, message)
|
158
|
+
end
|
142
159
|
end
|
143
160
|
end
|
144
161
|
end
|
@@ -166,6 +183,10 @@ module HyperRecord
|
|
166
183
|
end
|
167
184
|
if Hyperloop.resource_transport == :pusher
|
168
185
|
_pusher_client.trigger_async(channel_array, 'update', message)
|
186
|
+
elsif Hyperloop.resource_transport == :action_cable
|
187
|
+
channel_array.each do |channel|
|
188
|
+
ActionCable.server.broadcast(channel, message)
|
189
|
+
end
|
169
190
|
end
|
170
191
|
end
|
171
192
|
end
|
@@ -86,7 +86,13 @@ module Hyperloop
|
|
86
86
|
when :action_cable
|
87
87
|
opts[:action_cable_consumer] =
|
88
88
|
`ActionCable.createConsumer.apply(ActionCable, #{[*opts[:action_cable_consumer_url]]})`
|
89
|
-
|
89
|
+
%x{
|
90
|
+
#{opts[:action_cable_consumer]}.subscriptions.create({ channel: 'ResourceChannel', channel_id: #{@opts[:hyper_record_update_channel]} }, {
|
91
|
+
received: function(data) {
|
92
|
+
return Opal.Hyperloop.$const_get('Resource').$const_get('ClientDrivers').$process_notification(Opal.Hash.$new(data));
|
93
|
+
}
|
94
|
+
})
|
95
|
+
}
|
90
96
|
end
|
91
97
|
end
|
92
98
|
end
|
@@ -40,8 +40,13 @@ module Hyperloop
|
|
40
40
|
end
|
41
41
|
channel_array << "hyper-record-update-channel-#{session_id}"
|
42
42
|
end
|
43
|
-
if
|
43
|
+
return if channel_array.size == 0
|
44
|
+
if Hyperloop.resource_transport == :pusher
|
44
45
|
self.class._pusher_client.trigger_async(channel_array, 'update', message)
|
46
|
+
elsif Hyperloop.resource_transport == :action_cable
|
47
|
+
channel_array.each do |channel|
|
48
|
+
ActionCable.server.broadcast(channel, message)
|
49
|
+
end
|
45
50
|
end
|
46
51
|
end
|
47
52
|
Hyperloop.redis_instance.del("HRPS__#{record.class}__#{record.id}") if record.destroyed?
|
@@ -75,6 +80,10 @@ module Hyperloop
|
|
75
80
|
end
|
76
81
|
if Hyperloop.resource_transport == :pusher
|
77
82
|
self.class._pusher_client.trigger_async(channel_array, 'update', message)
|
83
|
+
elsif Hyperloop.resource_transport == :action_cable
|
84
|
+
channel_array.each do |channel|
|
85
|
+
ActionCable.server.broadcast(channel, message)
|
86
|
+
end
|
78
87
|
end
|
79
88
|
end
|
80
89
|
end
|
@@ -98,6 +107,10 @@ module Hyperloop
|
|
98
107
|
end
|
99
108
|
if Hyperloop.resource_transport == :pusher
|
100
109
|
self.class._pusher_client.trigger_async(channel_array, 'update', message)
|
110
|
+
elsif Hyperloop.resource_transport == :action_cable
|
111
|
+
channel_array.each do |channel|
|
112
|
+
ActionCable.server.broadcast(channel, message)
|
113
|
+
end
|
101
114
|
end
|
102
115
|
end
|
103
116
|
end
|
@@ -122,6 +135,10 @@ module Hyperloop
|
|
122
135
|
end
|
123
136
|
if Hyperloop.resource_transport == :pusher
|
124
137
|
self.class._pusher_client.trigger_async(channel_array, 'update', message)
|
138
|
+
elsif Hyperloop.resource_transport == :action_cable
|
139
|
+
channel_array.each do |channel|
|
140
|
+
ActionCable.server.broadcast(channel, message)
|
141
|
+
end
|
125
142
|
end
|
126
143
|
end
|
127
144
|
end
|
@@ -145,6 +162,10 @@ module Hyperloop
|
|
145
162
|
end
|
146
163
|
if Hyperloop.resource_transport == :pusher
|
147
164
|
self.class._pusher_client.trigger_async(channel_array, 'update', message)
|
165
|
+
elsif Hyperloop.resource_transport == :action_cable
|
166
|
+
channel_array.each do |channel|
|
167
|
+
ActionCable.server.broadcast(channel, message)
|
168
|
+
end
|
148
169
|
end
|
149
170
|
end
|
150
171
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hyper-resource
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.
|
4
|
+
version: 1.0.0.lap82
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan Biedermann
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-06-
|
11
|
+
date: 2018-06-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: opal
|