action_cable_client 1.3.1 → 1.3.2

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: ec388a88b11486df1dedb175bd4f6e76f0795372
4
- data.tar.gz: 7753ce008ad6468ffba1d5ad58fd477f6c0a58a0
3
+ metadata.gz: 3232e18c7d309778d36b6f995bbed9697dce12c4
4
+ data.tar.gz: 110d904797bde5c28476811cc1f22da9a9341487
5
5
  SHA512:
6
- metadata.gz: c1a05798952f845d7e2c40fed9f8e4260b0a5f36b9248dfddbfa9be36d1cd81b5a9b93a8458e9d03c11adf5d4c1bd3b4fe8fc1ab3abc2910101489c5c6a455e6
7
- data.tar.gz: 39c9e2d6fdb0e2404f2b92bbbff3717ae2255c2bc6dfe36909af03818d95ce4ceefd5ea9428ed95a5c2e0b84dae7f30ee9fbea009190005411acedbc5e76f916
6
+ metadata.gz: fb1256b8dec4be37e00352b727cb403b77505e5de26ca4a5eb6dd3f4b5cfc8851886b12c3050b26b6c9c13464170909693c6d692037efce481e4c0f316598f54
7
+ data.tar.gz: 7c578bd2a0c76025453d5b8f0e9e046a85c0eabf48bc9bb9b96ee127dd51f01aa77a2110b6bc4dc2f3703ff06b9d8084ffc786b058fbc06441a9c5967ff79711
@@ -1,3 +1,6 @@
1
+ ## 1.3.2
2
+ * Getting disconnected from the server will now set the result of subscribed? to false
3
+
1
4
  ## 1.3.0
2
5
  * subscribed now is a callback instead of a boolean
3
6
  * subscribed? tells whether or not the client is subscribed to the channel
@@ -23,7 +23,6 @@ class ActionCableClient
23
23
  # [ action, data ]
24
24
  attr_accessor :message_queue, :_subscribed, :_subscribed_callaback
25
25
 
26
- def_delegator :_websocket_client, :disconnect, :disconnected
27
26
  def_delegator :_websocket_client, :errback, :errored
28
27
  def_delegator :_websocket_client, :send_msg, :send_msg
29
28
 
@@ -114,6 +113,21 @@ class ActionCableClient
114
113
  _subscribed
115
114
  end
116
115
 
116
+ # callback when the server disconnects from the client.
117
+ #
118
+ # @example
119
+ # client = ActionCableClient.new(uri, 'RoomChannel')
120
+ # client.connected {}
121
+ # client.disconnected do
122
+ # # cleanup after the server disconnects from the client
123
+ # end
124
+ def disconnected
125
+ _websocket_client.disconnect do
126
+ self._subscribed = false
127
+ yield
128
+ end
129
+ end
130
+
117
131
  private
118
132
 
119
133
  # @param [WebSocket::Frame::Incoming::Client] message - the websockt message object
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  class ActionCableClient
3
- VERSION = '1.3.1'
3
+ VERSION = '1.3.2'
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: action_cable_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.1
4
+ version: 1.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - L. Preston Sego III
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-06 00:00:00.000000000 Z
11
+ date: 2016-05-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -129,6 +129,6 @@ rubyforge_project:
129
129
  rubygems_version: 2.5.1
130
130
  signing_key:
131
131
  specification_version: 4
132
- summary: ActionCableClient-1.3.1
132
+ summary: ActionCableClient-1.3.2
133
133
  test_files: []
134
134
  has_rdoc: