actioncable 7.1.0 → 7.1.2
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/CHANGELOG.md +10 -0
- data/lib/action_cable/channel/callbacks.rb +32 -11
- data/lib/action_cable/connection/callbacks.rb +7 -3
- data/lib/action_cable/gem_version.rb +1 -1
- metadata +9 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bd9e3483749dcd8fb23fb39f185a2db743ef1417e2da0d0f61d21fe6aa887715
|
4
|
+
data.tar.gz: ccbac9fd0928b0df9a8c5005452597a50d79a2a270568678a28cb82efdd63ab9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0b39c23ff01a71e9d341be6cfe4b9fc0fcee041581f983e330fa6cfdf66cedc66bc820d781091d4a2e5bb9d55025e9e5894eb4f51d40ad574daf43970a617cc0
|
7
|
+
data.tar.gz: bbd6e06b6719462e87a40aa71451720ed6e9b1fa1c47167bc01bff4f637469d6d7e3ea93d5bcbe5d79f823406f6006a02fb59edcc72f1bc24e17837ffff792f0
|
data/CHANGELOG.md
CHANGED
@@ -6,19 +6,31 @@ module ActionCable
|
|
6
6
|
module Channel
|
7
7
|
# = Action Cable \Channel \Callbacks
|
8
8
|
#
|
9
|
-
# Action Cable Channel provides hooks
|
10
|
-
#
|
9
|
+
# Action Cable Channel provides callback hooks that are invoked during the
|
10
|
+
# life cycle of a channel:
|
11
11
|
#
|
12
|
-
# *
|
13
|
-
# *
|
14
|
-
#
|
15
|
-
# *
|
12
|
+
# * {before_subscribe}[rdoc-ref:ClassMethods#before_subscribe]
|
13
|
+
# * {after_subscribe}[rdoc-ref:ClassMethods#after_subscribe] (aliased as
|
14
|
+
# {on_subscribe}[rdoc-ref:ClassMethods#on_subscribe])
|
15
|
+
# * {before_unsubscribe}[rdoc-ref:ClassMethods#before_unsubscribe]
|
16
|
+
# * {after_unsubscribe}[rdoc-ref:ClassMethods#after_unsubscribe] (aliased as
|
17
|
+
# {on_unsubscribe}[rdoc-ref:ClassMethods#on_unsubscribe])
|
16
18
|
#
|
17
|
-
#
|
18
|
-
#
|
19
|
-
#
|
20
|
-
#
|
21
|
-
#
|
19
|
+
# ==== Example
|
20
|
+
#
|
21
|
+
# class ChatChannel < ApplicationCable::Channel
|
22
|
+
# after_subscribe :send_welcome_message, unless: :subscription_rejected?
|
23
|
+
# after_subscribe :track_subscription
|
24
|
+
#
|
25
|
+
# private
|
26
|
+
# def send_welcome_message
|
27
|
+
# broadcast_to(...)
|
28
|
+
# end
|
29
|
+
#
|
30
|
+
# def track_subscription
|
31
|
+
# # ...
|
32
|
+
# end
|
33
|
+
# end
|
22
34
|
#
|
23
35
|
module Callbacks
|
24
36
|
extend ActiveSupport::Concern
|
@@ -34,6 +46,15 @@ module ActionCable
|
|
34
46
|
set_callback(:subscribe, :before, *methods, &block)
|
35
47
|
end
|
36
48
|
|
49
|
+
# This callback will be triggered after the Base#subscribed method is
|
50
|
+
# called, even if the subscription was rejected with the Base#reject
|
51
|
+
# method.
|
52
|
+
#
|
53
|
+
# To trigger the callback only on successful subscriptions, use the
|
54
|
+
# Base#subscription_rejected? method:
|
55
|
+
#
|
56
|
+
# after_subscribe :my_method, unless: :subscription_rejected?
|
57
|
+
#
|
37
58
|
def after_subscribe(*methods, &block)
|
38
59
|
set_callback(:subscribe, :after, *methods, &block)
|
39
60
|
end
|
@@ -6,9 +6,13 @@ module ActionCable
|
|
6
6
|
module Connection
|
7
7
|
# = Action Cable \Connection \Callbacks
|
8
8
|
#
|
9
|
-
#
|
10
|
-
#
|
11
|
-
#
|
9
|
+
# The {before_command}[rdoc-ref:ClassMethods#before_command],
|
10
|
+
# {after_command}[rdoc-ref:ClassMethods#after_command], and
|
11
|
+
# {around_command}[rdoc-ref:ClassMethods#around_command] callbacks are
|
12
|
+
# invoked when sending commands to the client, such as when subscribing,
|
13
|
+
# unsubscribing, or performing an action.
|
14
|
+
#
|
15
|
+
# ==== Example
|
12
16
|
#
|
13
17
|
# module ApplicationCable
|
14
18
|
# class Connection < ActionCable::Connection::Base
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: actioncable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 7.1.
|
4
|
+
version: 7.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pratik Naik
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2023-10
|
12
|
+
date: 2023-11-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -17,28 +17,28 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - '='
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: 7.1.
|
20
|
+
version: 7.1.2
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - '='
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: 7.1.
|
27
|
+
version: 7.1.2
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: actionpack
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
31
31
|
requirements:
|
32
32
|
- - '='
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version: 7.1.
|
34
|
+
version: 7.1.2
|
35
35
|
type: :runtime
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
39
|
- - '='
|
40
40
|
- !ruby/object:Gem::Version
|
41
|
-
version: 7.1.
|
41
|
+
version: 7.1.2
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: nio4r
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
@@ -154,10 +154,10 @@ licenses:
|
|
154
154
|
- MIT
|
155
155
|
metadata:
|
156
156
|
bug_tracker_uri: https://github.com/rails/rails/issues
|
157
|
-
changelog_uri: https://github.com/rails/rails/blob/v7.1.
|
158
|
-
documentation_uri: https://api.rubyonrails.org/v7.1.
|
157
|
+
changelog_uri: https://github.com/rails/rails/blob/v7.1.2/actioncable/CHANGELOG.md
|
158
|
+
documentation_uri: https://api.rubyonrails.org/v7.1.2/
|
159
159
|
mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
|
160
|
-
source_code_uri: https://github.com/rails/rails/tree/v7.1.
|
160
|
+
source_code_uri: https://github.com/rails/rails/tree/v7.1.2/actioncable
|
161
161
|
rubygems_mfa_required: 'true'
|
162
162
|
post_install_message:
|
163
163
|
rdoc_options: []
|