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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: eb33a9f637a13e5bd1e3ba0f4c3e055374eca77c
4
- data.tar.gz: 3e0c94b32558dc2c2681a781ead7ce7981b9199b
3
+ metadata.gz: c8c64467099b8329108e645ffa5adfe5ec22b9bd
4
+ data.tar.gz: '00009233f2ea4e0036817aa75483c8e0770e0940'
5
5
  SHA512:
6
- metadata.gz: 65766bf66feb0e160540d56da5a959f29ce3a0da2105fa987ba665a0d14502ffc3a33cd88d9d4e63dccaff471f70686d6aeb0739fa8b99637453a3eba0a8828d
7
- data.tar.gz: aa229c109604d6b21cc64666ee8a13bcfe66157e49467e82f296fc3aedb5dc4f701560c49ce52404ef934437e06054c8e2aeeb3c12c07ecdf515e6c16d6cb343
6
+ metadata.gz: 48efff7995c40f4d0101ad2384dbd06473986fa0f326f9324b71490ab072c29426fe7b865acf7433e9375c5f0faaf21590c69059f24f4a7e9339cde71f959557
7
+ data.tar.gz: b7f3b004feedf1872754f38e077acab826c2f5eda9582490ab877a97e09a21bc26b677fa5ee3bc29cd0e1cd4e4a2eeab21b1be717227801b5d8cd20ee6700951
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cable_ready (2.0.0)
4
+ cable_ready (2.0.1)
5
5
  activesupport (>= 5.0.0)
6
6
 
7
7
  GEM
@@ -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
@@ -15,11 +15,7 @@ module CableReady
15
15
  end
16
16
 
17
17
  def broadcast
18
- @channels.each do |channel_name, channel|
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
@@ -1,3 +1,3 @@
1
1
  module CableReady
2
- VERSION = "2.0.0"
2
+ VERSION = "2.0.1"
3
3
  end
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.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-14 00:00:00.000000000 Z
11
+ date: 2017-10-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport