anycable-rails 0.6.4 → 1.0.0.rc2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (34) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +26 -102
  3. data/MIT-LICENSE +1 -1
  4. data/README.md +37 -36
  5. data/lib/action_cable/subscription_adapter/any_cable.rb +2 -1
  6. data/lib/anycable/rails.rb +37 -2
  7. data/lib/anycable/rails/actioncable/channel.rb +4 -0
  8. data/lib/anycable/rails/actioncable/connection.rb +70 -50
  9. data/lib/anycable/rails/actioncable/connection/persistent_session.rb +30 -0
  10. data/lib/anycable/rails/actioncable/connection/serializable_identification.rb +42 -0
  11. data/lib/anycable/rails/actioncable/remote_connections.rb +11 -0
  12. data/lib/anycable/rails/channel_state.rb +48 -0
  13. data/lib/anycable/rails/compatibility.rb +7 -10
  14. data/lib/anycable/rails/compatibility/rubocop.rb +0 -1
  15. data/lib/anycable/rails/compatibility/rubocop/config/default.yml +3 -1
  16. data/lib/anycable/rails/compatibility/rubocop/cops/anycable/instance_vars.rb +1 -1
  17. data/lib/anycable/rails/compatibility/rubocop/cops/anycable/stream_from.rb +4 -4
  18. data/lib/anycable/rails/config.rb +8 -4
  19. data/lib/anycable/rails/rack.rb +56 -0
  20. data/lib/anycable/rails/railtie.rb +17 -10
  21. data/lib/anycable/rails/refinements/subscriptions.rb +5 -0
  22. data/lib/anycable/rails/session_proxy.rb +79 -0
  23. data/lib/anycable/rails/version.rb +1 -1
  24. data/lib/generators/anycable/download/USAGE +14 -0
  25. data/lib/generators/anycable/download/download_generator.rb +77 -0
  26. data/lib/generators/anycable/setup/USAGE +2 -0
  27. data/lib/generators/anycable/setup/setup_generator.rb +258 -0
  28. data/lib/generators/anycable/setup/templates/Procfile.dev +3 -0
  29. data/lib/generators/anycable/setup/templates/config/anycable.yml.tt +43 -0
  30. data/lib/generators/anycable/setup/templates/config/cable.yml.tt +11 -0
  31. data/lib/generators/anycable/setup/templates/config/initializers/anycable.rb.tt +9 -0
  32. data/lib/generators/anycable/with_os_helpers.rb +55 -0
  33. metadata +42 -28
  34. 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.6.4
4
+ version: 1.0.0.rc2
5
5
  platform: ruby
6
6
  authors:
7
7
  - palkan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-06-27 00:00:00.000000000 Z
11
+ date: 2020-06-16 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.6.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.6.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: bundler
42
+ name: ammeter
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '1.10'
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.10'
54
+ version: '1.1'
55
55
  - !ruby/object:Gem::Dependency
56
- name: pry-byebug
56
+ name: bundler
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - ">="
60
60
  - !ruby/object:Gem::Version
61
- version: '0'
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: '0'
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: '10.0'
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: '10.0'
82
+ version: '13.0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: rspec
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -98,30 +98,30 @@ dependencies:
98
98
  name: rubocop
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - "~>"
101
+ - - ">="
102
102
  - !ruby/object:Gem::Version
103
- version: 0.67.0
103
+ version: '0.80'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - "~>"
108
+ - - ">="
109
109
  - !ruby/object:Gem::Version
110
- version: 0.67.0
110
+ version: '0.80'
111
111
  - !ruby/object:Gem::Dependency
112
- name: simplecov
112
+ name: warden
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
115
  - - ">="
116
116
  - !ruby/object:Gem::Version
117
- version: 0.3.8
117
+ version: '0'
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - ">="
123
123
  - !ruby/object:Gem::Version
124
- version: 0.3.8
124
+ version: '0'
125
125
  description: Rails adapter for AnyCable
126
126
  email:
127
127
  - dementiev.vm@gmail.com
@@ -138,19 +138,33 @@ files:
138
138
  - lib/anycable/rails.rb
139
139
  - lib/anycable/rails/actioncable/channel.rb
140
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
141
145
  - lib/anycable/rails/compatibility.rb
142
146
  - lib/anycable/rails/compatibility/rubocop.rb
143
147
  - lib/anycable/rails/compatibility/rubocop/config/default.yml
144
148
  - lib/anycable/rails/compatibility/rubocop/cops/anycable/instance_vars.rb
145
149
  - lib/anycable/rails/compatibility/rubocop/cops/anycable/periodical_timers.rb
146
- - lib/anycable/rails/compatibility/rubocop/cops/anycable/remote_disconnect.rb
147
150
  - lib/anycable/rails/compatibility/rubocop/cops/anycable/stream_from.rb
148
151
  - lib/anycable/rails/config.rb
149
152
  - lib/anycable/rails/middlewares/executor.rb
150
153
  - lib/anycable/rails/middlewares/log_tagging.rb
154
+ - lib/anycable/rails/rack.rb
151
155
  - lib/anycable/rails/railtie.rb
152
156
  - lib/anycable/rails/refinements/subscriptions.rb
157
+ - lib/anycable/rails/session_proxy.rb
153
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
154
168
  homepage: http://github.com/anycable/anycable-rails
155
169
  licenses:
156
170
  - MIT
@@ -168,14 +182,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
168
182
  requirements:
169
183
  - - ">="
170
184
  - !ruby/object:Gem::Version
171
- version: '0'
185
+ version: '2.5'
172
186
  required_rubygems_version: !ruby/object:Gem::Requirement
173
187
  requirements:
174
- - - ">="
188
+ - - ">"
175
189
  - !ruby/object:Gem::Version
176
- version: '0'
190
+ version: 1.3.1
177
191
  requirements: []
178
- rubygems_version: 3.0.3
192
+ rubygems_version: 3.0.6
179
193
  signing_key:
180
194
  specification_version: 4
181
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