anycable-rails 0.6.3 → 1.0.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +20 -100
- data/MIT-LICENSE +1 -1
- data/README.md +37 -36
- data/lib/action_cable/subscription_adapter/any_cable.rb +2 -1
- data/lib/anycable/rails.rb +37 -2
- data/lib/anycable/rails/actioncable/channel.rb +7 -0
- data/lib/anycable/rails/actioncable/connection.rb +70 -50
- data/lib/anycable/rails/actioncable/connection/persistent_session.rb +30 -0
- data/lib/anycable/rails/actioncable/connection/serializable_identification.rb +42 -0
- data/lib/anycable/rails/actioncable/remote_connections.rb +11 -0
- data/lib/anycable/rails/channel_state.rb +48 -0
- data/lib/anycable/rails/compatibility.rb +10 -11
- data/lib/anycable/rails/compatibility/rubocop.rb +0 -1
- data/lib/anycable/rails/compatibility/rubocop/config/default.yml +3 -1
- data/lib/anycable/rails/compatibility/rubocop/cops/anycable/instance_vars.rb +1 -1
- data/lib/anycable/rails/compatibility/rubocop/cops/anycable/stream_from.rb +4 -4
- data/lib/anycable/rails/config.rb +8 -4
- data/lib/anycable/rails/rack.rb +56 -0
- data/lib/anycable/rails/railtie.rb +17 -10
- data/lib/anycable/rails/refinements/subscriptions.rb +5 -0
- data/lib/anycable/rails/session_proxy.rb +79 -0
- data/lib/anycable/rails/version.rb +1 -1
- data/lib/generators/anycable/download/USAGE +14 -0
- data/lib/generators/anycable/download/download_generator.rb +77 -0
- data/lib/generators/anycable/setup/USAGE +2 -0
- data/lib/generators/anycable/setup/setup_generator.rb +246 -0
- data/lib/generators/anycable/setup/templates/Procfile.dev +3 -0
- data/lib/generators/anycable/setup/templates/config/anycable.yml.tt +43 -0
- data/lib/generators/anycable/setup/templates/config/cable.yml.tt +11 -0
- data/lib/generators/anycable/setup/templates/config/initializers/anycable.rb.tt +9 -0
- data/lib/generators/anycable/with_os_helpers.rb +55 -0
- metadata +48 -43
- data/lib/anycable/rails/compatibility/rubocop/cops/anycable/remote_disconnect.rb +0 -31
metadata
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: anycable-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0.rc1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- palkan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-06-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: anycable
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: 1.0.0.rc1
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.
|
26
|
+
version: 1.0.0.rc1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rails
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -39,47 +39,47 @@ dependencies:
|
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '5'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: ammeter
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '1.
|
47
|
+
version: '1.1'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '1.
|
54
|
+
version: '1.1'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: bundler
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
61
|
+
version: '1.10'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
68
|
+
version: '1.10'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rake
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
75
|
+
version: '13.0'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '
|
82
|
+
version: '13.0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: rspec
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -96,46 +96,32 @@ dependencies:
|
|
96
96
|
version: '3.4'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: rubocop
|
99
|
-
requirement: !ruby/object:Gem::Requirement
|
100
|
-
requirements:
|
101
|
-
- - "~>"
|
102
|
-
- !ruby/object:Gem::Version
|
103
|
-
version: 0.60.0
|
104
|
-
type: :development
|
105
|
-
prerelease: false
|
106
|
-
version_requirements: !ruby/object:Gem::Requirement
|
107
|
-
requirements:
|
108
|
-
- - "~>"
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
version: 0.60.0
|
111
|
-
- !ruby/object:Gem::Dependency
|
112
|
-
name: simplecov
|
113
99
|
requirement: !ruby/object:Gem::Requirement
|
114
100
|
requirements:
|
115
101
|
- - ">="
|
116
102
|
- !ruby/object:Gem::Version
|
117
|
-
version: 0.
|
103
|
+
version: '0.80'
|
118
104
|
type: :development
|
119
105
|
prerelease: false
|
120
106
|
version_requirements: !ruby/object:Gem::Requirement
|
121
107
|
requirements:
|
122
108
|
- - ">="
|
123
109
|
- !ruby/object:Gem::Version
|
124
|
-
version: 0.
|
110
|
+
version: '0.80'
|
125
111
|
- !ruby/object:Gem::Dependency
|
126
|
-
name:
|
112
|
+
name: warden
|
127
113
|
requirement: !ruby/object:Gem::Requirement
|
128
114
|
requirements:
|
129
|
-
- - "
|
115
|
+
- - ">="
|
130
116
|
- !ruby/object:Gem::Version
|
131
|
-
version:
|
117
|
+
version: '0'
|
132
118
|
type: :development
|
133
119
|
prerelease: false
|
134
120
|
version_requirements: !ruby/object:Gem::Requirement
|
135
121
|
requirements:
|
136
|
-
- - "
|
122
|
+
- - ">="
|
137
123
|
- !ruby/object:Gem::Version
|
138
|
-
version:
|
124
|
+
version: '0'
|
139
125
|
description: Rails adapter for AnyCable
|
140
126
|
email:
|
141
127
|
- dementiev.vm@gmail.com
|
@@ -152,23 +138,42 @@ files:
|
|
152
138
|
- lib/anycable/rails.rb
|
153
139
|
- lib/anycable/rails/actioncable/channel.rb
|
154
140
|
- lib/anycable/rails/actioncable/connection.rb
|
141
|
+
- lib/anycable/rails/actioncable/connection/persistent_session.rb
|
142
|
+
- lib/anycable/rails/actioncable/connection/serializable_identification.rb
|
143
|
+
- lib/anycable/rails/actioncable/remote_connections.rb
|
144
|
+
- lib/anycable/rails/channel_state.rb
|
155
145
|
- lib/anycable/rails/compatibility.rb
|
156
146
|
- lib/anycable/rails/compatibility/rubocop.rb
|
157
147
|
- lib/anycable/rails/compatibility/rubocop/config/default.yml
|
158
148
|
- lib/anycable/rails/compatibility/rubocop/cops/anycable/instance_vars.rb
|
159
149
|
- lib/anycable/rails/compatibility/rubocop/cops/anycable/periodical_timers.rb
|
160
|
-
- lib/anycable/rails/compatibility/rubocop/cops/anycable/remote_disconnect.rb
|
161
150
|
- lib/anycable/rails/compatibility/rubocop/cops/anycable/stream_from.rb
|
162
151
|
- lib/anycable/rails/config.rb
|
163
152
|
- lib/anycable/rails/middlewares/executor.rb
|
164
153
|
- lib/anycable/rails/middlewares/log_tagging.rb
|
154
|
+
- lib/anycable/rails/rack.rb
|
165
155
|
- lib/anycable/rails/railtie.rb
|
166
156
|
- lib/anycable/rails/refinements/subscriptions.rb
|
157
|
+
- lib/anycable/rails/session_proxy.rb
|
167
158
|
- lib/anycable/rails/version.rb
|
159
|
+
- lib/generators/anycable/download/USAGE
|
160
|
+
- lib/generators/anycable/download/download_generator.rb
|
161
|
+
- lib/generators/anycable/setup/USAGE
|
162
|
+
- lib/generators/anycable/setup/setup_generator.rb
|
163
|
+
- lib/generators/anycable/setup/templates/Procfile.dev
|
164
|
+
- lib/generators/anycable/setup/templates/config/anycable.yml.tt
|
165
|
+
- lib/generators/anycable/setup/templates/config/cable.yml.tt
|
166
|
+
- lib/generators/anycable/setup/templates/config/initializers/anycable.rb.tt
|
167
|
+
- lib/generators/anycable/with_os_helpers.rb
|
168
168
|
homepage: http://github.com/anycable/anycable-rails
|
169
169
|
licenses:
|
170
170
|
- MIT
|
171
|
-
metadata:
|
171
|
+
metadata:
|
172
|
+
bug_tracker_uri: http://github.com/anycable/anycable-rails/issues
|
173
|
+
changelog_uri: https://github.com/anycable/anycable-rails/blob/master/CHANGELOG.md
|
174
|
+
documentation_uri: https://docs.anycable.io/#/using_with_rails
|
175
|
+
homepage_uri: https://anycable.io/
|
176
|
+
source_code_uri: http://github.com/anycable/anycable-rails
|
172
177
|
post_install_message:
|
173
178
|
rdoc_options: []
|
174
179
|
require_paths:
|
@@ -177,14 +182,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
177
182
|
requirements:
|
178
183
|
- - ">="
|
179
184
|
- !ruby/object:Gem::Version
|
180
|
-
version: '
|
185
|
+
version: '2.5'
|
181
186
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
182
187
|
requirements:
|
183
|
-
- - "
|
188
|
+
- - ">"
|
184
189
|
- !ruby/object:Gem::Version
|
185
|
-
version:
|
190
|
+
version: 1.3.1
|
186
191
|
requirements: []
|
187
|
-
rubygems_version: 3.0.
|
192
|
+
rubygems_version: 3.0.6
|
188
193
|
signing_key:
|
189
194
|
specification_version: 4
|
190
195
|
summary: Rails adapter for AnyCable
|
@@ -1,31 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "rubocop"
|
4
|
-
|
5
|
-
module RuboCop
|
6
|
-
module Cop
|
7
|
-
module AnyCable
|
8
|
-
# Checks for remote disconnect usage.
|
9
|
-
#
|
10
|
-
# @example
|
11
|
-
# # bad
|
12
|
-
# class MyServive
|
13
|
-
# def call(user)
|
14
|
-
# ActionCable.server.remote_connections.where(current_user: user).disconnect
|
15
|
-
# end
|
16
|
-
# end
|
17
|
-
#
|
18
|
-
class RemoteDisconnect < RuboCop::Cop::Cop
|
19
|
-
MSG = "Disconnecting remote clients is not supported in AnyCable"
|
20
|
-
|
21
|
-
def_node_matcher :has_remote_disconnect?, <<-PATTERN
|
22
|
-
(send (send (send _ :remote_connections) ...) :disconnect)
|
23
|
-
PATTERN
|
24
|
-
|
25
|
-
def on_send(node)
|
26
|
-
add_offense(node) if has_remote_disconnect?(node)
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|