anycable-rails 1.0.0.preview2 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +28 -122
- data/README.md +14 -34
- data/lib/anycable/rails.rb +36 -2
- data/lib/anycable/rails/actioncable/channel.rb +4 -0
- data/lib/anycable/rails/actioncable/connection.rb +39 -35
- data/lib/anycable/rails/actioncable/connection/persistent_session.rb +7 -3
- 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/actioncable/testing.rb +35 -0
- data/lib/anycable/rails/channel_state.rb +46 -0
- data/lib/anycable/rails/compatibility.rb +4 -7
- data/lib/anycable/rails/compatibility/rubocop.rb +0 -1
- data/lib/anycable/rails/compatibility/rubocop/config/default.yml +3 -0
- 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/railtie.rb +26 -18
- data/lib/anycable/rails/refinements/subscriptions.rb +5 -0
- data/lib/anycable/rails/session_proxy.rb +19 -2
- data/lib/anycable/rails/version.rb +1 -1
- data/lib/generators/anycable/download/USAGE +14 -0
- data/lib/generators/anycable/download/download_generator.rb +83 -0
- data/lib/generators/anycable/setup/USAGE +2 -0
- data/lib/{rails/generators → generators}/anycable/setup/setup_generator.rb +100 -88
- data/lib/generators/anycable/setup/templates/Procfile.dev.tt +6 -0
- data/lib/{rails/generators → generators}/anycable/setup/templates/config/anycable.yml.tt +22 -4
- data/lib/generators/anycable/setup/templates/config/cable.yml.tt +11 -0
- data/lib/{rails/generators/anycable/setup/templates/config/initializers/anycable.rb → generators/anycable/setup/templates/config/initializers/anycable.rb.tt} +1 -1
- data/lib/generators/anycable/with_os_helpers.rb +55 -0
- metadata +29 -52
- data/lib/anycable/rails/compatibility/rubocop/cops/anycable/remote_disconnect.rb +0 -31
- data/lib/rails/generators/anycable/setup/templates/Procfile +0 -2
- data/lib/rails/generators/anycable/setup/templates/Procfile.dev +0 -3
- data/lib/rails/generators/anycable/setup/templates/bin/heroku-web +0 -7
- data/lib/rails/generators/anycable/setup/templates/config/cable.yml.tt +0 -11
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: 1.0.0
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- palkan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-06-30 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: 1.0.0
|
19
|
+
version: 1.0.0
|
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: 1.0.0
|
26
|
+
version: 1.0.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rails
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -72,70 +72,42 @@ dependencies:
|
|
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
|
-
name: rspec
|
84
|
+
name: rspec-rails
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
87
|
- - ">="
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version:
|
89
|
+
version: 4.0.0
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version:
|
96
|
+
version: 4.0.0
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
|
-
name: rubocop
|
99
|
-
requirement: !ruby/object:Gem::Requirement
|
100
|
-
requirements:
|
101
|
-
- - "~>"
|
102
|
-
- !ruby/object:Gem::Version
|
103
|
-
version: '0.3'
|
104
|
-
type: :development
|
105
|
-
prerelease: false
|
106
|
-
version_requirements: !ruby/object:Gem::Requirement
|
107
|
-
requirements:
|
108
|
-
- - "~>"
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
version: '0.3'
|
111
|
-
- !ruby/object:Gem::Dependency
|
112
|
-
name: simplecov
|
98
|
+
name: rubocop
|
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.
|
125
|
-
- !ruby/object:Gem::Dependency
|
126
|
-
name: standard
|
127
|
-
requirement: !ruby/object:Gem::Requirement
|
128
|
-
requirements:
|
129
|
-
- - "~>"
|
130
|
-
- !ruby/object:Gem::Version
|
131
|
-
version: 0.1.7
|
132
|
-
type: :development
|
133
|
-
prerelease: false
|
134
|
-
version_requirements: !ruby/object:Gem::Requirement
|
135
|
-
requirements:
|
136
|
-
- - "~>"
|
137
|
-
- !ruby/object:Gem::Version
|
138
|
-
version: 0.1.7
|
110
|
+
version: '0.80'
|
139
111
|
- !ruby/object:Gem::Dependency
|
140
112
|
name: warden
|
141
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -167,12 +139,15 @@ files:
|
|
167
139
|
- lib/anycable/rails/actioncable/channel.rb
|
168
140
|
- lib/anycable/rails/actioncable/connection.rb
|
169
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/actioncable/testing.rb
|
145
|
+
- lib/anycable/rails/channel_state.rb
|
170
146
|
- lib/anycable/rails/compatibility.rb
|
171
147
|
- lib/anycable/rails/compatibility/rubocop.rb
|
172
148
|
- lib/anycable/rails/compatibility/rubocop/config/default.yml
|
173
149
|
- lib/anycable/rails/compatibility/rubocop/cops/anycable/instance_vars.rb
|
174
150
|
- lib/anycable/rails/compatibility/rubocop/cops/anycable/periodical_timers.rb
|
175
|
-
- lib/anycable/rails/compatibility/rubocop/cops/anycable/remote_disconnect.rb
|
176
151
|
- lib/anycable/rails/compatibility/rubocop/cops/anycable/stream_from.rb
|
177
152
|
- lib/anycable/rails/config.rb
|
178
153
|
- lib/anycable/rails/middlewares/executor.rb
|
@@ -182,13 +157,15 @@ files:
|
|
182
157
|
- lib/anycable/rails/refinements/subscriptions.rb
|
183
158
|
- lib/anycable/rails/session_proxy.rb
|
184
159
|
- lib/anycable/rails/version.rb
|
185
|
-
- lib/
|
186
|
-
- lib/
|
187
|
-
- lib/
|
188
|
-
- lib/
|
189
|
-
- lib/
|
190
|
-
- lib/
|
191
|
-
- lib/
|
160
|
+
- lib/generators/anycable/download/USAGE
|
161
|
+
- lib/generators/anycable/download/download_generator.rb
|
162
|
+
- lib/generators/anycable/setup/USAGE
|
163
|
+
- lib/generators/anycable/setup/setup_generator.rb
|
164
|
+
- lib/generators/anycable/setup/templates/Procfile.dev.tt
|
165
|
+
- lib/generators/anycable/setup/templates/config/anycable.yml.tt
|
166
|
+
- lib/generators/anycable/setup/templates/config/cable.yml.tt
|
167
|
+
- lib/generators/anycable/setup/templates/config/initializers/anycable.rb.tt
|
168
|
+
- lib/generators/anycable/with_os_helpers.rb
|
192
169
|
homepage: http://github.com/anycable/anycable-rails
|
193
170
|
licenses:
|
194
171
|
- MIT
|
@@ -209,9 +186,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
209
186
|
version: '2.5'
|
210
187
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
211
188
|
requirements:
|
212
|
-
- - "
|
189
|
+
- - ">="
|
213
190
|
- !ruby/object:Gem::Version
|
214
|
-
version:
|
191
|
+
version: '0'
|
215
192
|
requirements: []
|
216
193
|
rubygems_version: 3.0.6
|
217
194
|
signing_key:
|
@@ -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
|
@@ -1,11 +0,0 @@
|
|
1
|
-
# Make it possible to switch adapters by passing the CABLE_ADAPTER env variable.
|
2
|
-
# For example, you can use it fallback to the standard Action Cable in staging/review
|
3
|
-
# environments (by setting `CABLE_ADAPTER=redis`).
|
4
|
-
development:
|
5
|
-
adapter: <%%= ENV.fetch("CABLE_ADAPTER", "any_cable") %>
|
6
|
-
|
7
|
-
test:
|
8
|
-
adapter: test
|
9
|
-
|
10
|
-
production:
|
11
|
-
adapter: <%%= ENV.fetch("CABLE_ADAPTER", "any_cable") %>
|