cable_ready 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/cable_ready/channel.rb +7 -0
- data/lib/cable_ready/channels.rb +1 -5
- data/lib/cable_ready/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c8c64467099b8329108e645ffa5adfe5ec22b9bd
|
4
|
+
data.tar.gz: '00009233f2ea4e0036817aa75483c8e0770e0940'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 48efff7995c40f4d0101ad2384dbd06473986fa0f326f9324b71490ab072c29426fe7b865acf7433e9375c5f0faaf21590c69059f24f4a7e9339cde71f959557
|
7
|
+
data.tar.gz: b7f3b004feedf1872754f38e077acab826c2f5eda9582490ab877a97e09a21bc26b677fa5ee3bc29cd0e1cd4e4a2eeab21b1be717227801b5d8cd20ee6700951
|
data/Gemfile.lock
CHANGED
data/lib/cable_ready/channel.rb
CHANGED
@@ -97,6 +97,13 @@ module CableReady
|
|
97
97
|
@operations = stub
|
98
98
|
end
|
99
99
|
|
100
|
+
def broadcast
|
101
|
+
operations.select! { |_, list| list.present? }
|
102
|
+
operations.deep_transform_keys! { |key| key.to_s.camelize(:lower) }
|
103
|
+
ActionCable.server.broadcast name, "cableReady" => true, "operations" => operations
|
104
|
+
clear
|
105
|
+
end
|
106
|
+
|
100
107
|
def dispatch_event(options={})
|
101
108
|
operations[:dispatch_event] << options
|
102
109
|
end
|
data/lib/cable_ready/channels.rb
CHANGED
@@ -15,11 +15,7 @@ module CableReady
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def broadcast
|
18
|
-
@channels.
|
19
|
-
ActionCable.server.broadcast channel_name,
|
20
|
-
"cableReady" => true,
|
21
|
-
"operations" => channel.operations.deep_transform_keys { |key| key.to_s.camelize(:lower) }
|
22
|
-
end
|
18
|
+
@channels.values.map(&:broadcast)
|
23
19
|
clear
|
24
20
|
end
|
25
21
|
end
|
data/lib/cable_ready/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cable_ready
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan Hopkins
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-10-
|
11
|
+
date: 2017-10-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|