packwerk 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (153) hide show
  1. checksums.yaml +7 -0
  2. data/.github/ISSUE_TEMPLATE/bug_report.md +27 -0
  3. data/.github/probots.yml +2 -0
  4. data/.github/pull_request_template.md +27 -0
  5. data/.github/workflows/ci.yml +50 -0
  6. data/.gitignore +12 -0
  7. data/.rubocop.yml +46 -0
  8. data/.ruby-version +1 -0
  9. data/CODEOWNERS +1 -0
  10. data/CODE_OF_CONDUCT.md +76 -0
  11. data/CONTRIBUTING.md +17 -0
  12. data/Gemfile +22 -0
  13. data/Gemfile.lock +236 -0
  14. data/LICENSE.md +7 -0
  15. data/README.md +73 -0
  16. data/Rakefile +13 -0
  17. data/TROUBLESHOOT.md +67 -0
  18. data/USAGE.md +250 -0
  19. data/bin/console +15 -0
  20. data/bin/setup +8 -0
  21. data/dev.yml +32 -0
  22. data/docs/cohesion.png +0 -0
  23. data/exe/packwerk +6 -0
  24. data/lib/packwerk.rb +44 -0
  25. data/lib/packwerk/application_validator.rb +343 -0
  26. data/lib/packwerk/association_inspector.rb +44 -0
  27. data/lib/packwerk/checking_deprecated_references.rb +40 -0
  28. data/lib/packwerk/cli.rb +238 -0
  29. data/lib/packwerk/configuration.rb +82 -0
  30. data/lib/packwerk/const_node_inspector.rb +44 -0
  31. data/lib/packwerk/constant_discovery.rb +60 -0
  32. data/lib/packwerk/constant_name_inspector.rb +22 -0
  33. data/lib/packwerk/dependency_checker.rb +28 -0
  34. data/lib/packwerk/deprecated_references.rb +92 -0
  35. data/lib/packwerk/file_processor.rb +43 -0
  36. data/lib/packwerk/files_for_processing.rb +67 -0
  37. data/lib/packwerk/formatters/progress_formatter.rb +46 -0
  38. data/lib/packwerk/generators/application_validation.rb +62 -0
  39. data/lib/packwerk/generators/configuration_file.rb +69 -0
  40. data/lib/packwerk/generators/inflections_file.rb +43 -0
  41. data/lib/packwerk/generators/root_package.rb +37 -0
  42. data/lib/packwerk/generators/templates/inflections.yml +6 -0
  43. data/lib/packwerk/generators/templates/package.yml +17 -0
  44. data/lib/packwerk/generators/templates/packwerk +23 -0
  45. data/lib/packwerk/generators/templates/packwerk.yml.erb +23 -0
  46. data/lib/packwerk/generators/templates/packwerk_validator_test.rb +11 -0
  47. data/lib/packwerk/graph.rb +74 -0
  48. data/lib/packwerk/inflections/custom.rb +33 -0
  49. data/lib/packwerk/inflections/default.rb +73 -0
  50. data/lib/packwerk/inflector.rb +41 -0
  51. data/lib/packwerk/node.rb +259 -0
  52. data/lib/packwerk/node_processor.rb +49 -0
  53. data/lib/packwerk/node_visitor.rb +22 -0
  54. data/lib/packwerk/offense.rb +44 -0
  55. data/lib/packwerk/output_styles.rb +41 -0
  56. data/lib/packwerk/package.rb +56 -0
  57. data/lib/packwerk/package_set.rb +59 -0
  58. data/lib/packwerk/parsed_constant_definitions.rb +62 -0
  59. data/lib/packwerk/parsers.rb +23 -0
  60. data/lib/packwerk/parsers/erb.rb +66 -0
  61. data/lib/packwerk/parsers/factory.rb +34 -0
  62. data/lib/packwerk/parsers/ruby.rb +42 -0
  63. data/lib/packwerk/privacy_checker.rb +45 -0
  64. data/lib/packwerk/reference.rb +6 -0
  65. data/lib/packwerk/reference_extractor.rb +81 -0
  66. data/lib/packwerk/reference_lister.rb +23 -0
  67. data/lib/packwerk/run_context.rb +103 -0
  68. data/lib/packwerk/sanity_checker.rb +10 -0
  69. data/lib/packwerk/spring_command.rb +28 -0
  70. data/lib/packwerk/updating_deprecated_references.rb +51 -0
  71. data/lib/packwerk/version.rb +6 -0
  72. data/lib/packwerk/violation_type.rb +13 -0
  73. data/library.yml +6 -0
  74. data/packwerk.gemspec +58 -0
  75. data/service.yml +6 -0
  76. data/shipit.rubygems.yml +1 -0
  77. data/sorbet/config +2 -0
  78. data/sorbet/rbi/gems/actioncable@6.1.0.alpha-d80c18a391e33552ae2d943e68af56946f883f65.rbi +840 -0
  79. data/sorbet/rbi/gems/actionmailbox@6.1.0.alpha-d80c18a391e33552ae2d943e68af56946f883f65.rbi +571 -0
  80. data/sorbet/rbi/gems/actionmailer@6.1.0.alpha-d80c18a391e33552ae2d943e68af56946f883f65.rbi +568 -0
  81. data/sorbet/rbi/gems/actionpack@6.1.0.alpha-d80c18a391e33552ae2d943e68af56946f883f65.rbi +5216 -0
  82. data/sorbet/rbi/gems/actiontext@6.1.0.alpha-d80c18a391e33552ae2d943e68af56946f883f65.rbi +663 -0
  83. data/sorbet/rbi/gems/actionview@6.1.0.alpha-d80c18a391e33552ae2d943e68af56946f883f65.rbi +2504 -0
  84. data/sorbet/rbi/gems/activejob@6.1.0.alpha-d80c18a391e33552ae2d943e68af56946f883f65.rbi +635 -0
  85. data/sorbet/rbi/gems/activemodel@6.1.0.alpha-d80c18a391e33552ae2d943e68af56946f883f65.rbi +1201 -0
  86. data/sorbet/rbi/gems/activerecord@6.1.0.alpha-d80c18a391e33552ae2d943e68af56946f883f65.rbi +8011 -0
  87. data/sorbet/rbi/gems/activestorage@6.1.0.alpha-d80c18a391e33552ae2d943e68af56946f883f65.rbi +904 -0
  88. data/sorbet/rbi/gems/activesupport@6.1.0.alpha-d80c18a391e33552ae2d943e68af56946f883f65.rbi +3888 -0
  89. data/sorbet/rbi/gems/ast@2.4.1.rbi +54 -0
  90. data/sorbet/rbi/gems/better_html@1.0.15.rbi +317 -0
  91. data/sorbet/rbi/gems/builder@3.2.4.rbi +8 -0
  92. data/sorbet/rbi/gems/byebug@11.1.3.rbi +8 -0
  93. data/sorbet/rbi/gems/coderay@1.1.3.rbi +8 -0
  94. data/sorbet/rbi/gems/colorize@0.8.1.rbi +40 -0
  95. data/sorbet/rbi/gems/commander@4.5.2.rbi +8 -0
  96. data/sorbet/rbi/gems/concurrent-ruby@1.1.6.rbi +1966 -0
  97. data/sorbet/rbi/gems/constant_resolver@0.1.5.rbi +26 -0
  98. data/sorbet/rbi/gems/crass@1.0.6.rbi +138 -0
  99. data/sorbet/rbi/gems/erubi@1.9.0.rbi +39 -0
  100. data/sorbet/rbi/gems/globalid@0.4.2.rbi +178 -0
  101. data/sorbet/rbi/gems/highline@2.0.3.rbi +8 -0
  102. data/sorbet/rbi/gems/html_tokenizer@0.0.7.rbi +46 -0
  103. data/sorbet/rbi/gems/i18n@1.8.2.rbi +633 -0
  104. data/sorbet/rbi/gems/jaro_winkler@1.5.4.rbi +8 -0
  105. data/sorbet/rbi/gems/loofah@2.5.0.rbi +272 -0
  106. data/sorbet/rbi/gems/m@1.5.1.rbi +108 -0
  107. data/sorbet/rbi/gems/mail@2.7.1.rbi +2490 -0
  108. data/sorbet/rbi/gems/marcel@0.3.3.rbi +30 -0
  109. data/sorbet/rbi/gems/method_source@1.0.0.rbi +76 -0
  110. data/sorbet/rbi/gems/mimemagic@0.3.5.rbi +47 -0
  111. data/sorbet/rbi/gems/mini_mime@1.0.2.rbi +71 -0
  112. data/sorbet/rbi/gems/mini_portile2@2.4.0.rbi +8 -0
  113. data/sorbet/rbi/gems/minitest@5.14.0.rbi +542 -0
  114. data/sorbet/rbi/gems/mocha@1.11.2.rbi +964 -0
  115. data/sorbet/rbi/gems/nio4r@2.5.2.rbi +89 -0
  116. data/sorbet/rbi/gems/nokogiri@1.10.9.rbi +1608 -0
  117. data/sorbet/rbi/gems/parallel@1.19.1.rbi +8 -0
  118. data/sorbet/rbi/gems/parlour@4.0.1.rbi +561 -0
  119. data/sorbet/rbi/gems/parser@2.7.1.4.rbi +1632 -0
  120. data/sorbet/rbi/gems/pry@0.13.1.rbi +8 -0
  121. data/sorbet/rbi/gems/rack-test@1.1.0.rbi +335 -0
  122. data/sorbet/rbi/gems/rack@2.2.2.rbi +1730 -0
  123. data/sorbet/rbi/gems/rails-dom-testing@2.0.3.rbi +123 -0
  124. data/sorbet/rbi/gems/rails-html-sanitizer@1.3.0.rbi +213 -0
  125. data/sorbet/rbi/gems/rails@6.1.0.alpha-d80c18a391e33552ae2d943e68af56946f883f65.rbi +8 -0
  126. data/sorbet/rbi/gems/railties@6.1.0.alpha-d80c18a391e33552ae2d943e68af56946f883f65.rbi +869 -0
  127. data/sorbet/rbi/gems/rainbow@3.0.0.rbi +155 -0
  128. data/sorbet/rbi/gems/rake@13.0.1.rbi +841 -0
  129. data/sorbet/rbi/gems/rexml@3.2.4.rbi +8 -0
  130. data/sorbet/rbi/gems/rubocop-performance@1.5.2.rbi +8 -0
  131. data/sorbet/rbi/gems/rubocop-shopify@1.0.2.rbi +8 -0
  132. data/sorbet/rbi/gems/rubocop-sorbet@0.3.7.rbi +8 -0
  133. data/sorbet/rbi/gems/rubocop@0.82.0.rbi +8 -0
  134. data/sorbet/rbi/gems/ruby-progressbar@1.10.1.rbi +8 -0
  135. data/sorbet/rbi/gems/smart_properties@1.15.0.rbi +168 -0
  136. data/sorbet/rbi/gems/spoom@1.0.4.rbi +418 -0
  137. data/sorbet/rbi/gems/spring@2.1.0.rbi +160 -0
  138. data/sorbet/rbi/gems/sprockets-rails@3.2.1.rbi +431 -0
  139. data/sorbet/rbi/gems/sprockets@4.0.0.rbi +1132 -0
  140. data/sorbet/rbi/gems/tapioca@0.4.5.rbi +518 -0
  141. data/sorbet/rbi/gems/thor@1.0.1.rbi +892 -0
  142. data/sorbet/rbi/gems/tzinfo@2.0.2.rbi +547 -0
  143. data/sorbet/rbi/gems/unicode-display_width@1.7.0.rbi +8 -0
  144. data/sorbet/rbi/gems/websocket-driver@0.7.1.rbi +438 -0
  145. data/sorbet/rbi/gems/websocket-extensions@0.1.4.rbi +71 -0
  146. data/sorbet/rbi/gems/zeitwerk@2.3.0.rbi +8 -0
  147. data/sorbet/tapioca/require.rb +25 -0
  148. data/static/packwerk-check-demo.png +0 -0
  149. data/static/packwerk_check.gif +0 -0
  150. data/static/packwerk_check_violation.gif +0 -0
  151. data/static/packwerk_update.gif +0 -0
  152. data/static/packwerk_validate.gif +0 -0
  153. metadata +341 -0
@@ -0,0 +1,6 @@
1
+ # https://services.shopify.io/services/packwerk/production
2
+ org_line: Kernel
3
+ owners: Shopify/kernel-architecture-patterns
4
+ classification: library
5
+ slack_channels:
6
+ - architecture-patterns
@@ -0,0 +1 @@
1
+ # default configs
@@ -0,0 +1,2 @@
1
+ --dir
2
+ .
@@ -0,0 +1,840 @@
1
+ # DO NOT EDIT MANUALLY
2
+ # This is an autogenerated file for types exported from the `actioncable` gem.
3
+ # Please instead update this file by running `dev typecheck update`.
4
+
5
+ # typed: true
6
+
7
+ module ActionCable
8
+ extend(::ActiveSupport::Autoload)
9
+
10
+
11
+ private
12
+
13
+ def server; end
14
+
15
+ class << self
16
+ def gem_version; end
17
+ def server; end
18
+ def version; end
19
+ end
20
+ end
21
+
22
+ module ActionCable::Channel
23
+ extend(::ActiveSupport::Autoload)
24
+ end
25
+
26
+ class ActionCable::Channel::Base
27
+ include(::ActiveSupport::Callbacks)
28
+ include(::ActionCable::Channel::Callbacks)
29
+ include(::ActionCable::Channel::PeriodicTimers)
30
+ include(::ActionCable::Channel::Streams)
31
+ include(::ActionCable::Channel::Naming)
32
+ include(::ActionCable::Channel::Broadcasting)
33
+ include(::ActiveSupport::Rescuable)
34
+ extend(::ActiveSupport::Callbacks::ClassMethods)
35
+ extend(::ActiveSupport::DescendantsTracker)
36
+ extend(::ActionCable::Channel::Callbacks::ClassMethods)
37
+ extend(::ActionCable::Channel::PeriodicTimers::ClassMethods)
38
+ extend(::ActionCable::Channel::Naming::ClassMethods)
39
+ extend(::ActionCable::Channel::Broadcasting::ClassMethods)
40
+ extend(::ActiveSupport::Rescuable::ClassMethods)
41
+
42
+ def initialize(connection, identifier, params = T.unsafe(nil)); end
43
+
44
+ def __callbacks; end
45
+ def __callbacks?; end
46
+ def _run_subscribe_callbacks(&block); end
47
+ def _run_unsubscribe_callbacks(&block); end
48
+ def _subscribe_callbacks; end
49
+ def _unsubscribe_callbacks; end
50
+ def connection; end
51
+ def identifier; end
52
+ def logger(*args, &block); end
53
+ def params; end
54
+ def perform_action(data); end
55
+ def periodic_timers=(_); end
56
+ def rescue_handlers; end
57
+ def rescue_handlers=(_); end
58
+ def rescue_handlers?; end
59
+ def subscribe_to_channel; end
60
+ def unsubscribe_from_channel; end
61
+
62
+ private
63
+
64
+ def action_signature(action, data); end
65
+ def defer_subscription_confirmation!; end
66
+ def defer_subscription_confirmation?; end
67
+ def delegate_connection_identifiers; end
68
+ def dispatch_action(action, data); end
69
+ def ensure_confirmation_sent; end
70
+ def extract_action(data); end
71
+ def processable_action?(action); end
72
+ def reject; end
73
+ def reject_subscription; end
74
+ def subscribed; end
75
+ def subscription_confirmation_sent?; end
76
+ def subscription_rejected?; end
77
+ def transmit(data, via: T.unsafe(nil)); end
78
+ def transmit_subscription_confirmation; end
79
+ def transmit_subscription_rejection; end
80
+ def unsubscribed; end
81
+
82
+ class << self
83
+ def __callbacks; end
84
+ def __callbacks=(value); end
85
+ def __callbacks?; end
86
+ def _subscribe_callbacks; end
87
+ def _subscribe_callbacks=(value); end
88
+ def _unsubscribe_callbacks; end
89
+ def _unsubscribe_callbacks=(value); end
90
+ def action_methods; end
91
+ def periodic_timers; end
92
+ def periodic_timers=(value); end
93
+ def periodic_timers?; end
94
+ def rescue_handlers; end
95
+ def rescue_handlers=(value); end
96
+ def rescue_handlers?; end
97
+
98
+ private
99
+
100
+ def clear_action_methods!; end
101
+ def method_added(name); end
102
+ end
103
+ end
104
+
105
+ module ActionCable::Channel::Broadcasting
106
+ extend(::ActiveSupport::Concern)
107
+
108
+ mixes_in_class_methods(::ActionCable::Channel::Broadcasting::ClassMethods)
109
+
110
+ def broadcast_to(*args, &block); end
111
+ def broadcasting_for(*args, &block); end
112
+ end
113
+
114
+ module ActionCable::Channel::Broadcasting::ClassMethods
115
+ def broadcast_to(model, message); end
116
+ def broadcasting_for(model); end
117
+ def serialize_broadcasting(object); end
118
+ end
119
+
120
+ module ActionCable::Channel::Callbacks
121
+ extend(::ActiveSupport::Concern)
122
+
123
+ include(::ActiveSupport::Callbacks)
124
+
125
+ mixes_in_class_methods(::ActionCable::Channel::Callbacks::ClassMethods)
126
+ end
127
+
128
+ module ActionCable::Channel::Callbacks::ClassMethods
129
+ def after_subscribe(*methods, &block); end
130
+ def after_unsubscribe(*methods, &block); end
131
+ def before_subscribe(*methods, &block); end
132
+ def before_unsubscribe(*methods, &block); end
133
+ def on_subscribe(*methods, &block); end
134
+ def on_unsubscribe(*methods, &block); end
135
+ end
136
+
137
+ module ActionCable::Channel::Naming
138
+ extend(::ActiveSupport::Concern)
139
+
140
+ mixes_in_class_methods(::ActionCable::Channel::Naming::ClassMethods)
141
+
142
+ def channel_name(*args, &block); end
143
+ end
144
+
145
+ module ActionCable::Channel::Naming::ClassMethods
146
+ def channel_name; end
147
+ end
148
+
149
+ module ActionCable::Channel::PeriodicTimers
150
+ extend(::ActiveSupport::Concern)
151
+
152
+ mixes_in_class_methods(::ActionCable::Channel::PeriodicTimers::ClassMethods)
153
+
154
+
155
+ private
156
+
157
+ def active_periodic_timers; end
158
+ def start_periodic_timer(callback, every:); end
159
+ def start_periodic_timers; end
160
+ def stop_periodic_timers; end
161
+ end
162
+
163
+ module ActionCable::Channel::PeriodicTimers::ClassMethods
164
+ def periodically(callback_or_method_name = T.unsafe(nil), every:, &block); end
165
+ end
166
+
167
+ module ActionCable::Channel::Streams
168
+ extend(::ActiveSupport::Concern)
169
+
170
+ def pubsub(*args, &block); end
171
+ def stop_all_streams; end
172
+ def stop_stream_for(model); end
173
+ def stop_stream_from(broadcasting); end
174
+ def stream_for(model, callback = T.unsafe(nil), coder: T.unsafe(nil), &block); end
175
+ def stream_from(broadcasting, callback = T.unsafe(nil), coder: T.unsafe(nil), &block); end
176
+ def stream_or_reject_for(record); end
177
+
178
+ private
179
+
180
+ def default_stream_handler(broadcasting, coder:); end
181
+ def identity_handler; end
182
+ def stream_decoder(handler = T.unsafe(nil), coder:); end
183
+ def stream_handler(broadcasting, user_handler, coder: T.unsafe(nil)); end
184
+ def stream_transmitter(handler = T.unsafe(nil), broadcasting:); end
185
+ def streams; end
186
+ def worker_pool_stream_handler(broadcasting, user_handler, coder: T.unsafe(nil)); end
187
+ end
188
+
189
+ class ActionCable::Channel::TestCase < ::ActiveSupport::TestCase
190
+ include(::ActiveSupport::Testing::ConstantLookup)
191
+ include(::ActionCable::TestHelper)
192
+ include(::ActionCable::Channel::TestCase::Behavior)
193
+ extend(::ActiveSupport::Testing::ConstantLookup::ClassMethods)
194
+ extend(::ActionCable::Channel::TestCase::Behavior::ClassMethods)
195
+
196
+ def _channel_class; end
197
+ def _channel_class=(_); end
198
+ def _channel_class?; end
199
+ def connection; end
200
+ def subscription; end
201
+
202
+ class << self
203
+ def _channel_class; end
204
+ def _channel_class=(value); end
205
+ def _channel_class?; end
206
+ end
207
+ end
208
+
209
+ module ActionCable::Channel::TestCase::Behavior
210
+ include(::ActionCable::TestHelper)
211
+ extend(::ActiveSupport::Concern)
212
+
213
+ include(::ActiveSupport::Testing::ConstantLookup)
214
+
215
+ mixes_in_class_methods(::ActionCable::Channel::TestCase::Behavior::ClassMethods)
216
+
217
+ def assert_broadcast_on(stream_or_object, *args); end
218
+ def assert_broadcasts(stream_or_object, *args); end
219
+ def assert_has_stream(stream); end
220
+ def assert_has_stream_for(object); end
221
+ def assert_no_streams; end
222
+ def perform(action, data = T.unsafe(nil)); end
223
+ def stub_connection(identifiers = T.unsafe(nil)); end
224
+ def subscribe(params = T.unsafe(nil)); end
225
+ def transmissions; end
226
+ def unsubscribe; end
227
+
228
+ private
229
+
230
+ def broadcasting_for(stream_or_object); end
231
+ def check_subscribed!; end
232
+ end
233
+
234
+ ActionCable::Channel::TestCase::Behavior::CHANNEL_IDENTIFIER = T.let(T.unsafe(nil), String)
235
+
236
+ module ActionCable::Channel::TestCase::Behavior::ClassMethods
237
+ def channel_class; end
238
+ def determine_default_channel(name); end
239
+ def tests(channel); end
240
+ end
241
+
242
+ module ActionCable::Connection
243
+ extend(::ActiveSupport::Autoload)
244
+ end
245
+
246
+ module ActionCable::Connection::Authorization
247
+ def reject_unauthorized_connection; end
248
+ end
249
+
250
+ class ActionCable::Connection::Authorization::UnauthorizedError < ::StandardError
251
+ end
252
+
253
+ class ActionCable::Connection::Base
254
+ include(::ActionCable::Connection::Identification)
255
+ include(::ActionCable::Connection::InternalChannel)
256
+ include(::ActionCable::Connection::Authorization)
257
+ include(::ActiveSupport::Rescuable)
258
+ extend(::ActionCable::Connection::Identification::ClassMethods)
259
+ extend(::ActiveSupport::Rescuable::ClassMethods)
260
+
261
+ def initialize(server, env, coder: T.unsafe(nil)); end
262
+
263
+ def beat; end
264
+ def close(reason: T.unsafe(nil), reconnect: T.unsafe(nil)); end
265
+ def dispatch_websocket_message(websocket_message); end
266
+ def env; end
267
+ def event_loop(*args, &block); end
268
+ def identifiers; end
269
+ def identifiers=(_); end
270
+ def identifiers?; end
271
+ def logger; end
272
+ def on_close(reason, code); end
273
+ def on_error(message); end
274
+ def on_message(message); end
275
+ def on_open; end
276
+ def process; end
277
+ def protocol; end
278
+ def pubsub(*args, &block); end
279
+ def receive(websocket_message); end
280
+ def rescue_handlers; end
281
+ def rescue_handlers=(_); end
282
+ def rescue_handlers?; end
283
+ def send_async(method, *arguments); end
284
+ def server; end
285
+ def statistics; end
286
+ def subscriptions; end
287
+ def transmit(cable_message); end
288
+ def worker_pool; end
289
+
290
+ private
291
+
292
+ def allow_request_origin?; end
293
+ def cookies; end
294
+ def decode(websocket_message); end
295
+ def encode(cable_message); end
296
+ def finished_request_message; end
297
+ def handle_close; end
298
+ def handle_open; end
299
+ def invalid_request_message; end
300
+ def message_buffer; end
301
+ def new_tagged_logger; end
302
+ def request; end
303
+ def respond_to_invalid_request; end
304
+ def respond_to_successful_request; end
305
+ def send_welcome_message; end
306
+ def started_request_message; end
307
+ def successful_request_message; end
308
+ def websocket; end
309
+
310
+ class << self
311
+ def identifiers; end
312
+ def identifiers=(value); end
313
+ def identifiers?; end
314
+ def rescue_handlers; end
315
+ def rescue_handlers=(value); end
316
+ def rescue_handlers?; end
317
+ end
318
+ end
319
+
320
+ class ActionCable::Connection::ClientSocket
321
+ def initialize(env, event_target, event_loop, protocols); end
322
+
323
+ def alive?; end
324
+ def client_gone; end
325
+ def close(code = T.unsafe(nil), reason = T.unsafe(nil)); end
326
+ def env; end
327
+ def parse(data); end
328
+ def protocol; end
329
+ def rack_response; end
330
+ def start_driver; end
331
+ def transmit(message); end
332
+ def url; end
333
+ def write(data); end
334
+
335
+ private
336
+
337
+ def begin_close(reason, code); end
338
+ def emit_error(message); end
339
+ def finalize_close; end
340
+ def open; end
341
+ def receive_message(data); end
342
+
343
+ class << self
344
+ def determine_url(env); end
345
+ def secure_request?(env); end
346
+ end
347
+ end
348
+
349
+ ActionCable::Connection::ClientSocket::CLOSED = T.let(T.unsafe(nil), Integer)
350
+
351
+ ActionCable::Connection::ClientSocket::CLOSING = T.let(T.unsafe(nil), Integer)
352
+
353
+ ActionCable::Connection::ClientSocket::CONNECTING = T.let(T.unsafe(nil), Integer)
354
+
355
+ ActionCable::Connection::ClientSocket::OPEN = T.let(T.unsafe(nil), Integer)
356
+
357
+ module ActionCable::Connection::Identification
358
+ extend(::ActiveSupport::Concern)
359
+
360
+ mixes_in_class_methods(::ActionCable::Connection::Identification::ClassMethods)
361
+
362
+ def connection_identifier; end
363
+
364
+ private
365
+
366
+ def connection_gid(ids); end
367
+ end
368
+
369
+ module ActionCable::Connection::Identification::ClassMethods
370
+ def identified_by(*identifiers); end
371
+ end
372
+
373
+ module ActionCable::Connection::InternalChannel
374
+ extend(::ActiveSupport::Concern)
375
+
376
+
377
+ private
378
+
379
+ def internal_channel; end
380
+ def process_internal_message(message); end
381
+ def subscribe_to_internal_channel; end
382
+ def unsubscribe_from_internal_channel; end
383
+ end
384
+
385
+ class ActionCable::Connection::MessageBuffer
386
+ def initialize(connection); end
387
+
388
+ def append(message); end
389
+ def process!; end
390
+ def processing?; end
391
+
392
+ private
393
+
394
+ def buffer(message); end
395
+ def buffered_messages; end
396
+ def connection; end
397
+ def receive(message); end
398
+ def receive_buffered_messages; end
399
+ def valid?(message); end
400
+ end
401
+
402
+ class ActionCable::Connection::Stream
403
+ def initialize(event_loop, socket); end
404
+
405
+ def close; end
406
+ def each(&callback); end
407
+ def flush_write_buffer; end
408
+ def hijack_rack_socket; end
409
+ def receive(data); end
410
+ def shutdown; end
411
+ def write(data); end
412
+
413
+ private
414
+
415
+ def clean_rack_hijack; end
416
+ end
417
+
418
+ class ActionCable::Connection::StreamEventLoop
419
+ def initialize; end
420
+
421
+ def attach(io, stream); end
422
+ def detach(io, stream); end
423
+ def post(task = T.unsafe(nil), &block); end
424
+ def stop; end
425
+ def timer(interval, &block); end
426
+ def writes_pending(io); end
427
+
428
+ private
429
+
430
+ def run; end
431
+ def spawn; end
432
+ def wakeup; end
433
+ end
434
+
435
+ class ActionCable::Connection::Subscriptions
436
+ def initialize(connection); end
437
+
438
+ def add(data); end
439
+ def execute_command(data); end
440
+ def identifiers; end
441
+ def logger(*args, &block); end
442
+ def perform_action(data); end
443
+ def remove(data); end
444
+ def remove_subscription(subscription); end
445
+ def unsubscribe_from_all; end
446
+
447
+ private
448
+
449
+ def connection; end
450
+ def find(data); end
451
+ def subscriptions; end
452
+ end
453
+
454
+ class ActionCable::Connection::TaggedLoggerProxy
455
+ def initialize(logger, tags:); end
456
+
457
+ def add_tags(*tags); end
458
+ def debug(message); end
459
+ def error(message); end
460
+ def fatal(message); end
461
+ def info(message); end
462
+ def tag(logger); end
463
+ def tags; end
464
+ def unknown(message); end
465
+ def warn(message); end
466
+
467
+ private
468
+
469
+ def log(type, message); end
470
+ end
471
+
472
+ class ActionCable::Connection::TestCase < ::ActiveSupport::TestCase
473
+ include(::ActiveSupport::Testing::ConstantLookup)
474
+ include(::ActionCable::Connection::Assertions)
475
+ include(::ActionCable::Connection::TestCase::Behavior)
476
+ extend(::ActiveSupport::Testing::ConstantLookup::ClassMethods)
477
+ extend(::ActionCable::Connection::TestCase::Behavior::ClassMethods)
478
+
479
+ def _connection_class; end
480
+ def _connection_class=(_); end
481
+ def _connection_class?; end
482
+ def connection; end
483
+
484
+ class << self
485
+ def _connection_class; end
486
+ def _connection_class=(value); end
487
+ def _connection_class?; end
488
+ end
489
+ end
490
+
491
+ module ActionCable::Connection::TestCase::Behavior
492
+ include(::ActionCable::Connection::Assertions)
493
+ extend(::ActiveSupport::Concern)
494
+
495
+ include(::ActiveSupport::Testing::ConstantLookup)
496
+
497
+ mixes_in_class_methods(::ActionCable::Connection::TestCase::Behavior::ClassMethods)
498
+
499
+ def connect(path = T.unsafe(nil), **request_params); end
500
+ def cookies; end
501
+ def disconnect; end
502
+
503
+ private
504
+
505
+ def build_test_request(path, params: T.unsafe(nil), headers: T.unsafe(nil), session: T.unsafe(nil), env: T.unsafe(nil)); end
506
+ end
507
+
508
+ module ActionCable::Connection::TestCase::Behavior::ClassMethods
509
+ def connection_class; end
510
+ def determine_default_connection(name); end
511
+ def tests(connection); end
512
+ end
513
+
514
+ ActionCable::Connection::TestCase::Behavior::DEFAULT_PATH = T.let(T.unsafe(nil), String)
515
+
516
+ class ActionCable::Connection::WebSocket
517
+ def initialize(env, event_target, event_loop, protocols: T.unsafe(nil)); end
518
+
519
+ def alive?; end
520
+ def close; end
521
+ def possible?; end
522
+ def protocol; end
523
+ def rack_response; end
524
+ def transmit(data); end
525
+
526
+ private
527
+
528
+ def websocket; end
529
+ end
530
+
531
+ class ActionCable::Engine < ::Rails::Engine
532
+ end
533
+
534
+ module ActionCable::Helpers
535
+ end
536
+
537
+ module ActionCable::Helpers::ActionCableHelper
538
+ def action_cable_meta_tag; end
539
+ end
540
+
541
+ ActionCable::INTERNAL = T.let(T.unsafe(nil), Hash)
542
+
543
+ class ActionCable::RemoteConnections
544
+ def initialize(server); end
545
+
546
+ def server; end
547
+ def where(identifier); end
548
+ end
549
+
550
+ class ActionCable::RemoteConnections::RemoteConnection
551
+ include(::ActionCable::Connection::InternalChannel)
552
+ include(::ActionCable::Connection::Identification)
553
+ extend(::ActionCable::Connection::Identification::ClassMethods)
554
+
555
+ def initialize(server, ids); end
556
+
557
+ def disconnect; end
558
+ def identifiers; end
559
+ def identifiers=(_); end
560
+ def identifiers?; end
561
+
562
+ protected
563
+
564
+ def server; end
565
+
566
+ private
567
+
568
+ def set_identifier_instance_vars(ids); end
569
+ def valid_identifiers?(ids); end
570
+
571
+ class << self
572
+ def identifiers; end
573
+ def identifiers=(value); end
574
+ def identifiers?; end
575
+ end
576
+ end
577
+
578
+ class ActionCable::RemoteConnections::RemoteConnection::InvalidIdentifiersError < ::StandardError
579
+ end
580
+
581
+ module ActionCable::Server
582
+ extend(::ActiveSupport::Autoload)
583
+ end
584
+
585
+ class ActionCable::Server::Base
586
+ include(::ActionCable::Server::Broadcasting)
587
+ include(::ActionCable::Server::Connections)
588
+
589
+ def initialize(config: T.unsafe(nil)); end
590
+
591
+ def call(env); end
592
+ def config; end
593
+ def connection_identifiers; end
594
+ def disconnect(identifiers); end
595
+ def event_loop; end
596
+ def logger(*args, &block); end
597
+ def mutex; end
598
+ def pubsub; end
599
+ def remote_connections; end
600
+ def restart; end
601
+ def worker_pool; end
602
+
603
+ class << self
604
+ def config; end
605
+ def config=(val); end
606
+ def logger; end
607
+ end
608
+ end
609
+
610
+ module ActionCable::Server::Broadcasting
611
+ def broadcast(broadcasting, message, coder: T.unsafe(nil)); end
612
+ def broadcaster_for(broadcasting, coder: T.unsafe(nil)); end
613
+ end
614
+
615
+ class ActionCable::Server::Broadcasting::Broadcaster
616
+ def initialize(server, broadcasting, coder:); end
617
+
618
+ def broadcast(message); end
619
+ def broadcasting; end
620
+ def coder; end
621
+ def server; end
622
+ end
623
+
624
+ class ActionCable::Server::Configuration
625
+ def initialize; end
626
+
627
+ def allow_same_origin_as_host; end
628
+ def allow_same_origin_as_host=(_); end
629
+ def allowed_request_origins; end
630
+ def allowed_request_origins=(_); end
631
+ def cable; end
632
+ def cable=(_); end
633
+ def connection_class; end
634
+ def connection_class=(_); end
635
+ def disable_request_forgery_protection; end
636
+ def disable_request_forgery_protection=(_); end
637
+ def log_tags; end
638
+ def log_tags=(_); end
639
+ def logger; end
640
+ def logger=(_); end
641
+ def mount_path; end
642
+ def mount_path=(_); end
643
+ def pubsub_adapter; end
644
+ def url; end
645
+ def url=(_); end
646
+ def worker_pool_size; end
647
+ def worker_pool_size=(_); end
648
+ end
649
+
650
+ module ActionCable::Server::Connections
651
+ def add_connection(connection); end
652
+ def connections; end
653
+ def open_connections_statistics; end
654
+ def remove_connection(connection); end
655
+ def setup_heartbeat_timer; end
656
+ end
657
+
658
+ ActionCable::Server::Connections::BEAT_INTERVAL = T.let(T.unsafe(nil), Integer)
659
+
660
+ class ActionCable::Server::Worker
661
+ include(::ActiveSupport::Callbacks)
662
+ extend(::ActiveSupport::Callbacks::ClassMethods)
663
+ extend(::ActiveSupport::DescendantsTracker)
664
+
665
+ def __callbacks; end
666
+ def __callbacks?; end
667
+ def _run_work_callbacks(&block); end
668
+ def _work_callbacks; end
669
+ def connection; end
670
+ def connection=(obj); end
671
+
672
+ class << self
673
+ def __callbacks; end
674
+ def __callbacks=(value); end
675
+ def __callbacks?; end
676
+ def _work_callbacks; end
677
+ def _work_callbacks=(value); end
678
+ def connection; end
679
+ def connection=(obj); end
680
+ end
681
+ end
682
+
683
+ module ActionCable::SubscriptionAdapter
684
+ extend(::ActiveSupport::Autoload)
685
+ end
686
+
687
+ class ActionCable::SubscriptionAdapter::Base
688
+ def initialize(server); end
689
+
690
+ def broadcast(channel, payload); end
691
+ def identifier; end
692
+ def logger; end
693
+ def server; end
694
+ def shutdown; end
695
+ def subscribe(channel, message_callback, success_callback = T.unsafe(nil)); end
696
+ def unsubscribe(channel, message_callback); end
697
+ end
698
+
699
+ module ActionCable::SubscriptionAdapter::ChannelPrefix
700
+ def broadcast(channel, payload); end
701
+ def subscribe(channel, callback, success_callback = T.unsafe(nil)); end
702
+ def unsubscribe(channel, callback); end
703
+
704
+ private
705
+
706
+ def channel_with_prefix(channel); end
707
+ end
708
+
709
+ class ActionCable::SubscriptionAdapter::SubscriberMap
710
+ def initialize; end
711
+
712
+ def add_channel(channel, on_success); end
713
+ def add_subscriber(channel, subscriber, on_success); end
714
+ def broadcast(channel, message); end
715
+ def invoke_callback(callback, message); end
716
+ def remove_channel(channel); end
717
+ def remove_subscriber(channel, subscriber); end
718
+ end
719
+
720
+ class ActionCable::SubscriptionAdapter::Test < ::ActionCable::SubscriptionAdapter::Async
721
+ def broadcast(channel, payload); end
722
+ def broadcasts(channel); end
723
+ def clear; end
724
+ def clear_messages(channel); end
725
+
726
+ private
727
+
728
+ def channels_data; end
729
+ end
730
+
731
+ class ActionCable::TestCase < ::ActiveSupport::TestCase
732
+ include(::ActionCable::TestHelper)
733
+ end
734
+
735
+ module ActionCable::TestHelper
736
+ def after_teardown; end
737
+ def assert_broadcast_on(stream, data, &block); end
738
+ def assert_broadcasts(stream, number, &block); end
739
+ def assert_no_broadcasts(stream, &block); end
740
+ def before_setup; end
741
+ def broadcasts(*args, &block); end
742
+ def clear_messages(*args, &block); end
743
+ def pubsub_adapter; end
744
+
745
+ private
746
+
747
+ def broadcasts_size(channel); end
748
+ end
749
+
750
+ module ActionCable::VERSION
751
+ end
752
+
753
+ ActionCable::VERSION::MAJOR = T.let(T.unsafe(nil), Integer)
754
+
755
+ ActionCable::VERSION::MINOR = T.let(T.unsafe(nil), Integer)
756
+
757
+ ActionCable::VERSION::PRE = T.let(T.unsafe(nil), String)
758
+
759
+ ActionCable::VERSION::STRING = T.let(T.unsafe(nil), String)
760
+
761
+ ActionCable::VERSION::TINY = T.let(T.unsafe(nil), Integer)
762
+
763
+ module ActionCable::Channel::ChannelStub
764
+ def confirmed?; end
765
+ def rejected?; end
766
+ def start_periodic_timers; end
767
+ def stop_all_streams; end
768
+ def stop_periodic_timers; end
769
+ def stream_from(broadcasting, *_); end
770
+ def streams; end
771
+ end
772
+
773
+ class ActionCable::Channel::ConnectionStub
774
+ def initialize(identifiers = T.unsafe(nil)); end
775
+
776
+ def identifiers; end
777
+ def logger; end
778
+ def subscriptions; end
779
+ def transmissions; end
780
+ def transmit(cable_message); end
781
+ end
782
+
783
+ class ActionCable::Channel::NonInferrableChannelError < ::StandardError
784
+ def initialize(name); end
785
+ end
786
+
787
+ module ActionCable::Connection::Assertions
788
+ def assert_reject_connection(&block); end
789
+ end
790
+
791
+ class ActionCable::Connection::NonInferrableConnectionError < ::StandardError
792
+ def initialize(name); end
793
+ end
794
+
795
+ module ActionCable::Connection::TestConnection
796
+ def initialize(request); end
797
+
798
+ def logger; end
799
+ def request; end
800
+ end
801
+
802
+ class ActionCable::Connection::TestCookieJar < ::ActiveSupport::HashWithIndifferentAccess
803
+ def encrypted; end
804
+ def signed; end
805
+ end
806
+
807
+ class ActionCable::Connection::TestRequest < ::ActionDispatch::TestRequest
808
+ def cookie_jar; end
809
+ def cookie_jar=(_); end
810
+ def session; end
811
+ def session=(_); end
812
+ end
813
+
814
+ class ActionCable::SubscriptionAdapter::Async < ::ActionCable::SubscriptionAdapter::Inline
815
+
816
+ private
817
+
818
+ def new_subscriber_map; end
819
+ end
820
+
821
+ class ActionCable::SubscriptionAdapter::Async::AsyncSubscriberMap < ::ActionCable::SubscriptionAdapter::SubscriberMap
822
+ def initialize(event_loop); end
823
+
824
+ def add_subscriber(*_); end
825
+ def invoke_callback(*_); end
826
+ end
827
+
828
+ class ActionCable::SubscriptionAdapter::Inline < ::ActionCable::SubscriptionAdapter::Base
829
+ def initialize(*_); end
830
+
831
+ def broadcast(channel, payload); end
832
+ def shutdown; end
833
+ def subscribe(channel, callback, success_callback = T.unsafe(nil)); end
834
+ def unsubscribe(channel, callback); end
835
+
836
+ private
837
+
838
+ def new_subscriber_map; end
839
+ def subscriber_map; end
840
+ end