actioncable 7.1.0.rc2 → 7.1.1
Sign up to get free protection for your applications and to get access to all the features.
- 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 +2 -2
- metadata +11 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aa223855ae2af9c70e27271ec03c83d04e21c180c062f471d7bc388636e7e90a
|
4
|
+
data.tar.gz: f0188f07302139302eafc4cb12f2e7dd79d9391cde0079f6192dbed309278f07
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1c2d900a7b3a882b196b3b4ae2b490d4ab2335add9f250b869201bcff68adebd0dbc5bd8e63d437be9db7844dd0b866ce803774ff2592b87282018dd9faedfe2
|
7
|
+
data.tar.gz: be12b84cff9a8e0b089e75a97071a8e030ca10cd00fbe7d5f77e22824a583109f3ccf9ec77474cbd81fe33b5ae2c91541185657ac810e041590eaef3e40cc5cc
|
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.1
|
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-10-11 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.1
|
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.1
|
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.1
|
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.1
|
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.1/actioncable/CHANGELOG.md
|
158
|
+
documentation_uri: https://api.rubyonrails.org/v7.1.1/
|
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.1/actioncable
|
161
161
|
rubygems_mfa_required: 'true'
|
162
162
|
post_install_message:
|
163
163
|
rdoc_options: []
|
@@ -170,9 +170,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
170
170
|
version: 2.7.0
|
171
171
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
172
172
|
requirements:
|
173
|
-
- - "
|
173
|
+
- - ">="
|
174
174
|
- !ruby/object:Gem::Version
|
175
|
-
version:
|
175
|
+
version: '0'
|
176
176
|
requirements: []
|
177
177
|
rubygems_version: 3.4.18
|
178
178
|
signing_key:
|