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,8 @@
1
+ # DO NOT EDIT MANUALLY
2
+ # This is an autogenerated file for types exported from the `unicode-display_width` gem.
3
+ # Please instead update this file by running `dev typecheck update`.
4
+
5
+ # typed: true
6
+
7
+ # THIS IS AN EMPTY RBI FILE.
8
+ # see https://github.com/Shopify/tapioca/blob/master/README.md#manual-gem-requires
@@ -0,0 +1,438 @@
1
+ # DO NOT EDIT MANUALLY
2
+ # This is an autogenerated file for types exported from the `websocket-driver` gem.
3
+ # Please instead update this file by running `dev typecheck update`.
4
+
5
+ # typed: true
6
+
7
+ module WebSocket
8
+ end
9
+
10
+ class WebSocket::Driver
11
+ include(::WebSocket::Driver::EventEmitter)
12
+
13
+ def initialize(socket, options = T.unsafe(nil)); end
14
+
15
+ def add_extension(extension); end
16
+ def binary(message); end
17
+ def close(reason = T.unsafe(nil), code = T.unsafe(nil)); end
18
+ def ping(*args); end
19
+ def pong(*args); end
20
+ def protocol; end
21
+ def ready_state; end
22
+ def set_header(name, value); end
23
+ def start; end
24
+ def state; end
25
+ def text(message); end
26
+
27
+ private
28
+
29
+ def fail(type, message); end
30
+ def fail_handshake(error); end
31
+ def open; end
32
+ def queue(message); end
33
+
34
+ class << self
35
+ def client(socket, options = T.unsafe(nil)); end
36
+ def encode(string, encoding = T.unsafe(nil)); end
37
+ def rack(socket, options = T.unsafe(nil)); end
38
+ def server(socket, options = T.unsafe(nil)); end
39
+ def validate_options(options, valid_keys); end
40
+ def websocket?(env); end
41
+ end
42
+ end
43
+
44
+ WebSocket::Driver::BINARY = T.let(T.unsafe(nil), String)
45
+
46
+ class WebSocket::Driver::Client < ::WebSocket::Driver::Hybi
47
+ def initialize(socket, options = T.unsafe(nil)); end
48
+
49
+ def headers; end
50
+ def parse(chunk); end
51
+ def proxy(origin, options = T.unsafe(nil)); end
52
+ def start; end
53
+ def status; end
54
+ def version; end
55
+
56
+ private
57
+
58
+ def fail_handshake(message); end
59
+ def handshake_request; end
60
+ def validate_handshake; end
61
+
62
+ class << self
63
+ def generate_key; end
64
+ end
65
+ end
66
+
67
+ WebSocket::Driver::Client::VALID_SCHEMES = T.let(T.unsafe(nil), Array)
68
+
69
+ class WebSocket::Driver::CloseEvent < ::Struct
70
+ def code; end
71
+ def code=(_); end
72
+ def reason; end
73
+ def reason=(_); end
74
+
75
+ class << self
76
+ def [](*_); end
77
+ def inspect; end
78
+ def members; end
79
+ def new(*_); end
80
+ end
81
+ end
82
+
83
+ class WebSocket::Driver::ConfigurationError < ::ArgumentError
84
+ end
85
+
86
+ class WebSocket::Driver::ConnectEvent < ::Struct
87
+ class << self
88
+ def [](*_); end
89
+ def inspect; end
90
+ def members; end
91
+ def new(*_); end
92
+ end
93
+ end
94
+
95
+ class WebSocket::Driver::Draft75 < ::WebSocket::Driver
96
+ def initialize(socket, options = T.unsafe(nil)); end
97
+
98
+ def close(reason = T.unsafe(nil), code = T.unsafe(nil)); end
99
+ def frame(buffer, type = T.unsafe(nil), error_type = T.unsafe(nil)); end
100
+ def parse(chunk); end
101
+ def version; end
102
+
103
+ private
104
+
105
+ def handshake_response; end
106
+ def parse_leading_byte(octet); end
107
+ end
108
+
109
+ class WebSocket::Driver::Draft76 < ::WebSocket::Driver::Draft75
110
+ def initialize(socket, options = T.unsafe(nil)); end
111
+
112
+ def close(reason = T.unsafe(nil), code = T.unsafe(nil)); end
113
+ def start; end
114
+ def version; end
115
+
116
+ private
117
+
118
+ def handshake_response; end
119
+ def handshake_signature; end
120
+ def number_from_key(key); end
121
+ def parse_leading_byte(octet); end
122
+ def send_handshake_body; end
123
+ def spaces_in_key(key); end
124
+ end
125
+
126
+ WebSocket::Driver::Draft76::BODY_SIZE = T.let(T.unsafe(nil), Integer)
127
+
128
+ module WebSocket::Driver::EventEmitter
129
+ def initialize; end
130
+
131
+ def add_listener(event, callable = T.unsafe(nil), &block); end
132
+ def emit(event, *args); end
133
+ def listener_count(event); end
134
+ def listeners(event); end
135
+ def on(event, callable = T.unsafe(nil), &block); end
136
+ def remove_all_listeners(event = T.unsafe(nil)); end
137
+ def remove_listener(event, callable = T.unsafe(nil), &block); end
138
+ end
139
+
140
+ class WebSocket::Driver::Headers
141
+ def initialize(received = T.unsafe(nil)); end
142
+
143
+ def [](name); end
144
+ def []=(name, value); end
145
+ def clear; end
146
+ def inspect; end
147
+ def to_h; end
148
+ def to_s; end
149
+ end
150
+
151
+ WebSocket::Driver::Headers::ALLOWED_DUPLICATES = T.let(T.unsafe(nil), Array)
152
+
153
+ class WebSocket::Driver::Hybi < ::WebSocket::Driver
154
+ def initialize(socket, options = T.unsafe(nil)); end
155
+
156
+ def add_extension(extension); end
157
+ def binary(message); end
158
+ def close(reason = T.unsafe(nil), code = T.unsafe(nil)); end
159
+ def frame(buffer, type = T.unsafe(nil), code = T.unsafe(nil)); end
160
+ def parse(chunk); end
161
+ def ping(message = T.unsafe(nil), &callback); end
162
+ def pong(message = T.unsafe(nil)); end
163
+ def version; end
164
+
165
+ private
166
+
167
+ def check_frame_length; end
168
+ def emit_frame(buffer); end
169
+ def emit_message; end
170
+ def fail(type, message); end
171
+ def handshake_response; end
172
+ def parse_extended_length(buffer); end
173
+ def parse_length(octet); end
174
+ def parse_opcode(octet); end
175
+ def send_frame(frame); end
176
+ def shutdown(code, reason, error = T.unsafe(nil)); end
177
+
178
+ class << self
179
+ def generate_accept(key); end
180
+ end
181
+ end
182
+
183
+ WebSocket::Driver::Hybi::BYTE = T.let(T.unsafe(nil), Integer)
184
+
185
+ WebSocket::Driver::Hybi::DEFAULT_ERROR_CODE = T.let(T.unsafe(nil), Integer)
186
+
187
+ WebSocket::Driver::Hybi::ERRORS = T.let(T.unsafe(nil), Hash)
188
+
189
+ WebSocket::Driver::Hybi::ERROR_CODES = T.let(T.unsafe(nil), Array)
190
+
191
+ WebSocket::Driver::Hybi::FIN = T.let(T.unsafe(nil), Integer)
192
+
193
+ class WebSocket::Driver::Hybi::Frame
194
+ def final; end
195
+ def final=(_); end
196
+ def length; end
197
+ def length=(_); end
198
+ def length_bytes; end
199
+ def length_bytes=(_); end
200
+ def masked; end
201
+ def masked=(_); end
202
+ def masking_key; end
203
+ def masking_key=(_); end
204
+ def opcode; end
205
+ def opcode=(_); end
206
+ def payload; end
207
+ def payload=(_); end
208
+ def rsv1; end
209
+ def rsv1=(_); end
210
+ def rsv2; end
211
+ def rsv2=(_); end
212
+ def rsv3; end
213
+ def rsv3=(_); end
214
+ end
215
+
216
+ WebSocket::Driver::Hybi::GUID = T.let(T.unsafe(nil), String)
217
+
218
+ WebSocket::Driver::Hybi::LENGTH = T.let(T.unsafe(nil), Integer)
219
+
220
+ WebSocket::Driver::Hybi::MASK = T.let(T.unsafe(nil), Integer)
221
+
222
+ WebSocket::Driver::Hybi::MAX_RESERVED_ERROR = T.let(T.unsafe(nil), Integer)
223
+
224
+ WebSocket::Driver::Hybi::MESSAGE_OPCODES = T.let(T.unsafe(nil), Array)
225
+
226
+ WebSocket::Driver::Hybi::MIN_RESERVED_ERROR = T.let(T.unsafe(nil), Integer)
227
+
228
+ class WebSocket::Driver::Hybi::Message
229
+ def initialize; end
230
+
231
+ def <<(frame); end
232
+ def data; end
233
+ def data=(_); end
234
+ def opcode; end
235
+ def opcode=(_); end
236
+ def rsv1; end
237
+ def rsv1=(_); end
238
+ def rsv2; end
239
+ def rsv2=(_); end
240
+ def rsv3; end
241
+ def rsv3=(_); end
242
+ end
243
+
244
+ WebSocket::Driver::Hybi::OPCODE = T.let(T.unsafe(nil), Integer)
245
+
246
+ WebSocket::Driver::Hybi::OPCODES = T.let(T.unsafe(nil), Hash)
247
+
248
+ WebSocket::Driver::Hybi::OPCODE_CODES = T.let(T.unsafe(nil), Array)
249
+
250
+ WebSocket::Driver::Hybi::OPENING_OPCODES = T.let(T.unsafe(nil), Array)
251
+
252
+ WebSocket::Driver::Hybi::PACK_FORMATS = T.let(T.unsafe(nil), Hash)
253
+
254
+ WebSocket::Driver::Hybi::RSV1 = T.let(T.unsafe(nil), Integer)
255
+
256
+ WebSocket::Driver::Hybi::RSV2 = T.let(T.unsafe(nil), Integer)
257
+
258
+ WebSocket::Driver::Hybi::RSV3 = T.let(T.unsafe(nil), Integer)
259
+
260
+ WebSocket::Driver::Hybi::VERSION = T.let(T.unsafe(nil), String)
261
+
262
+ WebSocket::Driver::MAX_LENGTH = T.let(T.unsafe(nil), Integer)
263
+
264
+ class WebSocket::Driver::MessageEvent < ::Struct
265
+ def data; end
266
+ def data=(_); end
267
+
268
+ class << self
269
+ def [](*_); end
270
+ def inspect; end
271
+ def members; end
272
+ def new(*_); end
273
+ end
274
+ end
275
+
276
+ class WebSocket::Driver::OpenEvent < ::Struct
277
+ class << self
278
+ def [](*_); end
279
+ def inspect; end
280
+ def members; end
281
+ def new(*_); end
282
+ end
283
+ end
284
+
285
+ class WebSocket::Driver::PingEvent < ::Struct
286
+ def data; end
287
+ def data=(_); end
288
+
289
+ class << self
290
+ def [](*_); end
291
+ def inspect; end
292
+ def members; end
293
+ def new(*_); end
294
+ end
295
+ end
296
+
297
+ class WebSocket::Driver::PongEvent < ::Struct
298
+ def data; end
299
+ def data=(_); end
300
+
301
+ class << self
302
+ def [](*_); end
303
+ def inspect; end
304
+ def members; end
305
+ def new(*_); end
306
+ end
307
+ end
308
+
309
+ class WebSocket::Driver::ProtocolError < ::StandardError
310
+ end
311
+
312
+ class WebSocket::Driver::Proxy
313
+ include(::WebSocket::Driver::EventEmitter)
314
+
315
+ def initialize(client, origin, options); end
316
+
317
+ def headers; end
318
+ def parse(chunk); end
319
+ def set_header(name, value); end
320
+ def start; end
321
+ def status; end
322
+ end
323
+
324
+ WebSocket::Driver::Proxy::PORTS = T.let(T.unsafe(nil), Hash)
325
+
326
+ WebSocket::Driver::STATES = T.let(T.unsafe(nil), Array)
327
+
328
+ class WebSocket::Driver::Server < ::WebSocket::Driver
329
+ def initialize(socket, options = T.unsafe(nil)); end
330
+
331
+ def add_extension(*args, &block); end
332
+ def binary(*args, &block); end
333
+ def close(*args, &block); end
334
+ def env; end
335
+ def frame(*args, &block); end
336
+ def parse(chunk); end
337
+ def ping(*args, &block); end
338
+ def protocol; end
339
+ def set_header(*args, &block); end
340
+ def start(*args, &block); end
341
+ def text(*args, &block); end
342
+ def url; end
343
+ def version; end
344
+ def write(buffer); end
345
+
346
+ private
347
+
348
+ def fail_request(message); end
349
+ def open; end
350
+ end
351
+
352
+ WebSocket::Driver::Server::EVENTS = T.let(T.unsafe(nil), Array)
353
+
354
+ class WebSocket::Driver::StreamReader
355
+ def initialize; end
356
+
357
+ def each_byte; end
358
+ def put(chunk); end
359
+ def read(length); end
360
+
361
+ private
362
+
363
+ def prune; end
364
+ end
365
+
366
+ WebSocket::Driver::StreamReader::MINIMUM_AUTOMATIC_PRUNE_OFFSET = T.let(T.unsafe(nil), Integer)
367
+
368
+ WebSocket::Driver::UNICODE = T.let(T.unsafe(nil), String)
369
+
370
+ class WebSocket::Driver::URIError < ::ArgumentError
371
+ end
372
+
373
+ module WebSocket::HTTP
374
+ class << self
375
+ def normalize_header(name); end
376
+ end
377
+ end
378
+
379
+ module WebSocket::HTTP::Headers
380
+ def initialize; end
381
+
382
+ def complete?; end
383
+ def error?; end
384
+ def headers; end
385
+ def parse(chunk); end
386
+
387
+ private
388
+
389
+ def complete; end
390
+ def error; end
391
+ def header_line(line); end
392
+ def string_buffer; end
393
+ end
394
+
395
+ WebSocket::HTTP::Headers::CR = T.let(T.unsafe(nil), Integer)
396
+
397
+ WebSocket::HTTP::Headers::HEADER_LINE = T.let(T.unsafe(nil), Regexp)
398
+
399
+ WebSocket::HTTP::Headers::LF = T.let(T.unsafe(nil), Integer)
400
+
401
+ WebSocket::HTTP::Headers::MAX_LINE_LENGTH = T.let(T.unsafe(nil), Integer)
402
+
403
+ class WebSocket::HTTP::Request
404
+ include(::WebSocket::HTTP::Headers)
405
+
406
+ def env; end
407
+
408
+ private
409
+
410
+ def complete; end
411
+ def start_line(line); end
412
+ end
413
+
414
+ WebSocket::HTTP::Request::REQUEST_LINE = T.let(T.unsafe(nil), Regexp)
415
+
416
+ WebSocket::HTTP::Request::REQUEST_TARGET = T.let(T.unsafe(nil), Regexp)
417
+
418
+ WebSocket::HTTP::Request::RESERVED_HEADERS = T.let(T.unsafe(nil), Array)
419
+
420
+ class WebSocket::HTTP::Response
421
+ include(::WebSocket::HTTP::Headers)
422
+
423
+ def [](name); end
424
+ def body; end
425
+ def code; end
426
+
427
+ private
428
+
429
+ def start_line(line); end
430
+ end
431
+
432
+ WebSocket::HTTP::Response::STATUS_LINE = T.let(T.unsafe(nil), Regexp)
433
+
434
+ module WebSocket::Mask
435
+ class << self
436
+ def mask(_, _); end
437
+ end
438
+ end
@@ -0,0 +1,71 @@
1
+ # DO NOT EDIT MANUALLY
2
+ # This is an autogenerated file for types exported from the `websocket-extensions` gem.
3
+ # Please instead update this file by running `dev typecheck update`.
4
+
5
+ # typed: true
6
+
7
+ module WebSocket
8
+ end
9
+
10
+ class WebSocket::Extensions
11
+ def initialize; end
12
+
13
+ def activate(header); end
14
+ def add(ext); end
15
+ def close; end
16
+ def generate_offer; end
17
+ def generate_response(header); end
18
+ def process_incoming_message(message); end
19
+ def process_outgoing_message(message); end
20
+ def valid_frame_rsv(frame); end
21
+ def valid_frame_rsv?(frame); end
22
+
23
+ private
24
+
25
+ def reserve(ext); end
26
+ def reserved?(ext); end
27
+ end
28
+
29
+ class WebSocket::Extensions::ExtensionError < ::ArgumentError
30
+ end
31
+
32
+ WebSocket::Extensions::MESSAGE_OPCODES = T.let(T.unsafe(nil), Array)
33
+
34
+ class WebSocket::Extensions::Parser
35
+ class << self
36
+ def parse_header(header); end
37
+ def serialize_params(name, params); end
38
+ end
39
+ end
40
+
41
+ WebSocket::Extensions::Parser::EXT = T.let(T.unsafe(nil), Regexp)
42
+
43
+ WebSocket::Extensions::Parser::EXT_LIST = T.let(T.unsafe(nil), Regexp)
44
+
45
+ WebSocket::Extensions::Parser::NOTOKEN = T.let(T.unsafe(nil), Regexp)
46
+
47
+ WebSocket::Extensions::Parser::NUMBER = T.let(T.unsafe(nil), Regexp)
48
+
49
+ WebSocket::Extensions::Parser::PARAM = T.let(T.unsafe(nil), Regexp)
50
+
51
+ class WebSocket::Extensions::Parser::ParseError < ::ArgumentError
52
+ end
53
+
54
+ WebSocket::Extensions::Parser::QUOTED = T.let(T.unsafe(nil), Regexp)
55
+
56
+ WebSocket::Extensions::Parser::TOKEN = T.let(T.unsafe(nil), Regexp)
57
+
58
+ module WebSocket::Mask
59
+ class << self
60
+ def mask(_, _); end
61
+ end
62
+ end
63
+
64
+ class WebSocket::Extensions::Offers
65
+ def initialize; end
66
+
67
+ def by_name(name); end
68
+ def each_offer(&block); end
69
+ def push(name, params); end
70
+ def to_a; end
71
+ end