phlex-stimulus 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (147) hide show
  1. checksums.yaml +7 -0
  2. data/.ruby-version +1 -0
  3. data/CHANGELOG.md +16 -0
  4. data/LICENSE.txt +21 -0
  5. data/README.md +341 -0
  6. data/Rakefile +12 -0
  7. data/lib/generators/phlex/stimulus/controller/USAGE +5 -0
  8. data/lib/generators/phlex/stimulus/controller/controller_generator.rb +49 -0
  9. data/lib/generators/phlex/stimulus/controller/templates/component.rb.erb +30 -0
  10. data/lib/generators/phlex/stimulus/controller/templates/controller.ts.erb +23 -0
  11. data/lib/generators/phlex/stimulus/generator_mixin.rb +21 -0
  12. data/lib/generators/phlex/stimulus/install/USAGE +5 -0
  13. data/lib/generators/phlex/stimulus/install/install_generator.rb +111 -0
  14. data/lib/generators/phlex/stimulus/install/templates/app/components/base.rb.erb +29 -0
  15. data/lib/generators/phlex/stimulus/install/templates/app/components/chain_controller.rb.erb +29 -0
  16. data/lib/generators/phlex/stimulus/install/templates/app/components/classlist_controller.rb.erb +30 -0
  17. data/lib/generators/phlex/stimulus/install/templates/app/components/controller.rb.erb +10 -0
  18. data/lib/generators/phlex/stimulus/install/templates/app/components/controller_chain.rb.erb +32 -0
  19. data/lib/generators/phlex/stimulus/install/templates/app/components/controller_template.rb.erb +24 -0
  20. data/lib/generators/phlex/stimulus/install/templates/app/components/log_controller.rb.erb +33 -0
  21. data/lib/generators/phlex/stimulus/install/templates/app/components/sleep_controller.rb.erb +30 -0
  22. data/lib/generators/phlex/stimulus/install/templates/app/components.rb.erb +7 -0
  23. data/lib/generators/phlex/stimulus/install/templates/app/javascript/application.ts.erb +5 -0
  24. data/lib/generators/phlex/stimulus/install/templates/app/javascript/controllers/application.ts.erb +10 -0
  25. data/lib/generators/phlex/stimulus/install/templates/app/javascript/controllers/chain_controller.ts.erb +32 -0
  26. data/lib/generators/phlex/stimulus/install/templates/app/javascript/controllers/chainable_controller.ts.erb +44 -0
  27. data/lib/generators/phlex/stimulus/install/templates/app/javascript/controllers/classlist_controller.ts.erb +30 -0
  28. data/lib/generators/phlex/stimulus/install/templates/app/javascript/controllers/index.ts.erb +4 -0
  29. data/lib/generators/phlex/stimulus/install/templates/app/javascript/controllers/log_controller.ts.erb +25 -0
  30. data/lib/generators/phlex/stimulus/install/templates/app/javascript/controllers/sleep_controller.ts.erb +19 -0
  31. data/lib/generators/phlex/stimulus/install/templates/app/javascript/controllers/typed_controller.ts.erb +53 -0
  32. data/lib/generators/phlex/stimulus/install/templates/app/javascript/utils/misc.ts.erb +37 -0
  33. data/lib/generators/phlex/stimulus/install/templates/app/javascript/utils/template.ts.erb +11 -0
  34. data/lib/phlex/stimulus/components/base.rb +81 -0
  35. data/lib/phlex/stimulus/components/controller.rb +170 -0
  36. data/lib/phlex/stimulus/components.rb +9 -0
  37. data/lib/phlex/stimulus/version.rb +8 -0
  38. data/lib/phlex/stimulus.rb +15 -0
  39. data/sorbet/config +7 -0
  40. data/sorbet/rbi/annotations/.gitattributes +1 -0
  41. data/sorbet/rbi/annotations/actionmailer.rbi +15 -0
  42. data/sorbet/rbi/annotations/actionpack.rbi +430 -0
  43. data/sorbet/rbi/annotations/actionview.rbi +75 -0
  44. data/sorbet/rbi/annotations/activejob.rbi +50 -0
  45. data/sorbet/rbi/annotations/activemodel.rbi +119 -0
  46. data/sorbet/rbi/annotations/activerecord.rbi +172 -0
  47. data/sorbet/rbi/annotations/activesupport.rbi +561 -0
  48. data/sorbet/rbi/annotations/globalid.rbi +30 -0
  49. data/sorbet/rbi/annotations/minitest.rbi +116 -0
  50. data/sorbet/rbi/annotations/railties.rbi +104 -0
  51. data/sorbet/rbi/annotations/rainbow.rbi +269 -0
  52. data/sorbet/rbi/dsl/.gitattributes +1 -0
  53. data/sorbet/rbi/dsl/active_support/callbacks.rbi +21 -0
  54. data/sorbet/rbi/gems/.gitattributes +1 -0
  55. data/sorbet/rbi/gems/action_text-trix@2.1.19.rbi +9 -0
  56. data/sorbet/rbi/gems/actioncable@8.1.3.rbi +9 -0
  57. data/sorbet/rbi/gems/actionmailbox@8.1.3.rbi +9 -0
  58. data/sorbet/rbi/gems/actionmailer@8.1.3.rbi +9 -0
  59. data/sorbet/rbi/gems/actionpack@8.1.3.rbi +20478 -0
  60. data/sorbet/rbi/gems/actiontext@8.1.3.rbi +9 -0
  61. data/sorbet/rbi/gems/actionview@8.1.3.rbi +14722 -0
  62. data/sorbet/rbi/gems/activejob@8.1.3.rbi +9 -0
  63. data/sorbet/rbi/gems/activemodel@8.1.3.rbi +9 -0
  64. data/sorbet/rbi/gems/activerecord@8.1.3.rbi +9 -0
  65. data/sorbet/rbi/gems/activestorage@8.1.3.rbi +9 -0
  66. data/sorbet/rbi/gems/activesupport@8.1.3.rbi +20153 -0
  67. data/sorbet/rbi/gems/ast@2.4.3.rbi +550 -0
  68. data/sorbet/rbi/gems/base64@0.3.0.rbi +545 -0
  69. data/sorbet/rbi/gems/benchmark@0.5.0.rbi +621 -0
  70. data/sorbet/rbi/gems/booleans@0.1.3.rbi +31 -0
  71. data/sorbet/rbi/gems/builder@3.3.0.rbi +9 -0
  72. data/sorbet/rbi/gems/byebug@12.0.0.rbi +49 -0
  73. data/sorbet/rbi/gems/concurrent-ruby@1.3.8.rbi +10656 -0
  74. data/sorbet/rbi/gems/connection_pool@3.0.2.rbi +9 -0
  75. data/sorbet/rbi/gems/crass@1.0.7.rbi +648 -0
  76. data/sorbet/rbi/gems/date@3.5.1.rbi +391 -0
  77. data/sorbet/rbi/gems/drb@2.2.3.rbi +9 -0
  78. data/sorbet/rbi/gems/erb@6.0.6.rbi +1600 -0
  79. data/sorbet/rbi/gems/erubi@1.13.1.rbi +155 -0
  80. data/sorbet/rbi/gems/globalid@1.4.0.rbi +9 -0
  81. data/sorbet/rbi/gems/i18n@1.15.2.rbi +2285 -0
  82. data/sorbet/rbi/gems/io-console@0.8.2.rbi +9 -0
  83. data/sorbet/rbi/gems/json@2.21.1.rbi +2289 -0
  84. data/sorbet/rbi/gems/lint_roller@1.1.0.rbi +189 -0
  85. data/sorbet/rbi/gems/logger@1.7.0.rbi +896 -0
  86. data/sorbet/rbi/gems/loofah@2.25.2.rbi +1134 -0
  87. data/sorbet/rbi/gems/mail@2.9.1.rbi +9 -0
  88. data/sorbet/rbi/gems/marcel@1.2.1.rbi +9 -0
  89. data/sorbet/rbi/gems/mini_mime@1.1.5.rbi +9 -0
  90. data/sorbet/rbi/gems/minitest@6.0.6.rbi +1482 -0
  91. data/sorbet/rbi/gems/net-imap@0.6.4.1.rbi +9 -0
  92. data/sorbet/rbi/gems/net-pop@0.1.2.rbi +9 -0
  93. data/sorbet/rbi/gems/net-protocol@0.2.2.rbi +244 -0
  94. data/sorbet/rbi/gems/net-smtp@0.5.1.rbi +9 -0
  95. data/sorbet/rbi/gems/netrc@0.11.0.rbi +147 -0
  96. data/sorbet/rbi/gems/nio4r@2.7.5.rbi +9 -0
  97. data/sorbet/rbi/gems/nokogiri@1.19.4.rbi +8168 -0
  98. data/sorbet/rbi/gems/parallel@1.28.0.rbi +270 -0
  99. data/sorbet/rbi/gems/phlex-rails@2.4.0.rbi +1945 -0
  100. data/sorbet/rbi/gems/phlex@2.4.1.rbi +1413 -0
  101. data/sorbet/rbi/gems/pp@0.6.4.rbi +387 -0
  102. data/sorbet/rbi/gems/prettyprint@0.2.0.rbi +455 -0
  103. data/sorbet/rbi/gems/prism@1.9.0.rbi +42226 -0
  104. data/sorbet/rbi/gems/racc@1.8.1.rbi +165 -0
  105. data/sorbet/rbi/gems/rack-session@2.1.2.rbi +756 -0
  106. data/sorbet/rbi/gems/rack-test@2.2.0.rbi +681 -0
  107. data/sorbet/rbi/gems/rack@3.2.6.rbi +4653 -0
  108. data/sorbet/rbi/gems/rackup@2.3.1.rbi +9 -0
  109. data/sorbet/rbi/gems/rails-dom-testing@2.3.0.rbi +517 -0
  110. data/sorbet/rbi/gems/rails-html-sanitizer@1.7.1.rbi +620 -0
  111. data/sorbet/rbi/gems/rails@8.1.3.rbi +9 -0
  112. data/sorbet/rbi/gems/railties@8.1.3.rbi +3507 -0
  113. data/sorbet/rbi/gems/rainbow@3.1.1.rbi +362 -0
  114. data/sorbet/rbi/gems/rake@13.4.2.rbi +3130 -0
  115. data/sorbet/rbi/gems/rbi@0.4.0.rbi +5706 -0
  116. data/sorbet/rbi/gems/rbs@4.0.3.rbi +6908 -0
  117. data/sorbet/rbi/gems/refract@1.1.0.rbi +9 -0
  118. data/sorbet/rbi/gems/reline@0.6.3.rbi +2446 -0
  119. data/sorbet/rbi/gems/require-hooks@0.4.0.rbi +152 -0
  120. data/sorbet/rbi/gems/rexml@3.4.4.rbi +4905 -0
  121. data/sorbet/rbi/gems/rubocop-espago@1.3.0.rbi +9 -0
  122. data/sorbet/rbi/gems/ruby-progressbar@1.13.0.rbi +988 -0
  123. data/sorbet/rbi/gems/rubydex@0.2.9.rbi +841 -0
  124. data/sorbet/rbi/gems/securerandom@0.4.1.rbi +75 -0
  125. data/sorbet/rbi/gems/shoulda-context@2.0.0.rbi +544 -0
  126. data/sorbet/rbi/gems/spoom@1.8.4.rbi +6738 -0
  127. data/sorbet/rbi/gems/tapioca@0.19.2.rbi +3599 -0
  128. data/sorbet/rbi/gems/thor@1.5.0.rbi +3870 -0
  129. data/sorbet/rbi/gems/timeout@0.6.1.rbi +200 -0
  130. data/sorbet/rbi/gems/tsort@0.2.0.rbi +389 -0
  131. data/sorbet/rbi/gems/tzinfo@2.0.6.rbi +5474 -0
  132. data/sorbet/rbi/gems/unicode-display_width@3.2.0.rbi +130 -0
  133. data/sorbet/rbi/gems/unicode-emoji@4.2.0.rbi +332 -0
  134. data/sorbet/rbi/gems/uri@1.1.1.rbi +2402 -0
  135. data/sorbet/rbi/gems/useragent@0.16.11.rbi +9 -0
  136. data/sorbet/rbi/gems/websocket-driver@0.8.2.rbi +9 -0
  137. data/sorbet/rbi/gems/websocket-extensions@0.1.5.rbi +9 -0
  138. data/sorbet/rbi/gems/zeitwerk@2.8.2.rbi +9 -0
  139. data/sorbet/rbi/shims/gems/parser.rbi +12 -0
  140. data/sorbet/rbi/shims/gems/rails.rbi +55 -0
  141. data/sorbet/rbi/shims/gems/refract.rbi +13 -0
  142. data/sorbet/rbi/shims/gems/shoulda-context.rbi +16 -0
  143. data/sorbet/tapioca/compilers/phlex_controller.rb +80 -0
  144. data/sorbet/tapioca/config.yml +26 -0
  145. data/sorbet/tapioca/extensions/load_gem.rb +1 -0
  146. data/sorbet/tapioca/require.rb +4 -0
  147. metadata +266 -0
@@ -0,0 +1,681 @@
1
+ # typed: true
2
+
3
+ # DO NOT EDIT MANUALLY
4
+ # This is an autogenerated file for types exported from the `rack-test` gem.
5
+ # Please instead update this file by running `bin/tapioca gem rack-test`.
6
+
7
+
8
+ # pkg:gem/rack-test#lib/rack/test/cookie_jar.rb:6
9
+ module Rack; end
10
+
11
+ # For backwards compatibility with 1.1.0 and below
12
+ #
13
+ # pkg:gem/rack-test#lib/rack/test.rb:381
14
+ Rack::MockSession = Rack::Test::Session
15
+
16
+ # pkg:gem/rack-test#lib/rack/test/cookie_jar.rb:7
17
+ module Rack::Test
18
+ class << self
19
+ # Whether the version of rack in use handles encodings.
20
+ #
21
+ # pkg:gem/rack-test#lib/rack/test.rb:375
22
+ def encoding_aware_strings?; end
23
+ end
24
+ end
25
+
26
+ # Represents individual cookies in the cookie jar. This is considered private
27
+ # API and behavior of this class can change at any time.
28
+ #
29
+ # pkg:gem/rack-test#lib/rack/test/cookie_jar.rb:10
30
+ class Rack::Test::Cookie
31
+ include ::Rack::Utils
32
+
33
+ # pkg:gem/rack-test#lib/rack/test/cookie_jar.rb:23
34
+ def initialize(raw, uri = T.unsafe(nil), default_host = T.unsafe(nil)); end
35
+
36
+ # Order cookies by name, path, and domain.
37
+ #
38
+ # pkg:gem/rack-test#lib/rack/test/cookie_jar.rb:106
39
+ def <=>(other); end
40
+
41
+ # The explicit or implicit domain for the cookie.
42
+ #
43
+ # pkg:gem/rack-test#lib/rack/test/cookie_jar.rb:59
44
+ def domain; end
45
+
46
+ # Whether the cookie has a value.
47
+ #
48
+ # pkg:gem/rack-test#lib/rack/test/cookie_jar.rb:54
49
+ def empty?; end
50
+
51
+ # Whether the cookie is currently expired.
52
+ #
53
+ # pkg:gem/rack-test#lib/rack/test/cookie_jar.rb:86
54
+ def expired?; end
55
+
56
+ # A Time value for when the cookie expires, if the expires option is set.
57
+ #
58
+ # pkg:gem/rack-test#lib/rack/test/cookie_jar.rb:81
59
+ def expires; end
60
+
61
+ # Whether the cookie has the httponly flag, indicating it is not available via
62
+ # a javascript API.
63
+ #
64
+ # pkg:gem/rack-test#lib/rack/test/cookie_jar.rb:71
65
+ def http_only?; end
66
+
67
+ # Cookies that do not match the URI will not be sent in requests to the URI.
68
+ #
69
+ # pkg:gem/rack-test#lib/rack/test/cookie_jar.rb:101
70
+ def matches?(uri); end
71
+
72
+ # The name of the cookie, will be a string
73
+ #
74
+ # pkg:gem/rack-test#lib/rack/test/cookie_jar.rb:14
75
+ def name; end
76
+
77
+ # The explicit or implicit path for the cookie.
78
+ #
79
+ # pkg:gem/rack-test#lib/rack/test/cookie_jar.rb:76
80
+ def path; end
81
+
82
+ # The raw string for the cookie, without options. Will generally be in
83
+ # name=value format is name and value are provided.
84
+ #
85
+ # pkg:gem/rack-test#lib/rack/test/cookie_jar.rb:21
86
+ def raw; end
87
+
88
+ # Wether the given cookie can replace the current cookie in the cookie jar.
89
+ #
90
+ # pkg:gem/rack-test#lib/rack/test/cookie_jar.rb:49
91
+ def replaces?(other); end
92
+
93
+ # Whether the cookie has the secure flag, indicating it can only be sent over
94
+ # an encrypted connection.
95
+ #
96
+ # pkg:gem/rack-test#lib/rack/test/cookie_jar.rb:65
97
+ def secure?; end
98
+
99
+ # A hash of cookie options, including the cookie value, but excluding the cookie name.
100
+ #
101
+ # pkg:gem/rack-test#lib/rack/test/cookie_jar.rb:111
102
+ def to_h; end
103
+
104
+ # pkg:gem/rack-test#lib/rack/test/cookie_jar.rb:120
105
+ def to_hash; end
106
+
107
+ # Whether the cookie is valid for the given URI.
108
+ #
109
+ # pkg:gem/rack-test#lib/rack/test/cookie_jar.rb:91
110
+ def valid?(uri); end
111
+
112
+ # The value of the cookie, will be a string or nil if there is no value.
113
+ #
114
+ # pkg:gem/rack-test#lib/rack/test/cookie_jar.rb:17
115
+ def value; end
116
+
117
+ private
118
+
119
+ # The default URI to use for the cookie, including just the host.
120
+ #
121
+ # pkg:gem/rack-test#lib/rack/test/cookie_jar.rb:125
122
+ def default_uri; end
123
+ end
124
+
125
+ # Represents all cookies for a session, handling adding and
126
+ # removing cookies, and finding which cookies apply to a given
127
+ # request. This is considered private API and behavior of this
128
+ # class can change at any time.
129
+ #
130
+ # pkg:gem/rack-test#lib/rack/test/cookie_jar.rb:134
131
+ class Rack::Test::CookieJar
132
+ # pkg:gem/rack-test#lib/rack/test/cookie_jar.rb:137
133
+ def initialize(cookies = T.unsafe(nil), default_host = T.unsafe(nil)); end
134
+
135
+ # Add a Cookie to the cookie jar.
136
+ #
137
+ # pkg:gem/rack-test#lib/rack/test/cookie_jar.rb:197
138
+ def <<(new_cookie); end
139
+
140
+ # Return the value for first cookie with the given name, or nil
141
+ # if no such cookie exists.
142
+ #
143
+ # pkg:gem/rack-test#lib/rack/test/cookie_jar.rb:150
144
+ def [](name); end
145
+
146
+ # Set a cookie with the given name and value in the
147
+ # cookie jar.
148
+ #
149
+ # pkg:gem/rack-test#lib/rack/test/cookie_jar.rb:160
150
+ def []=(name, value); end
151
+
152
+ # Delete all cookies with the given name from the cookie jar.
153
+ #
154
+ # pkg:gem/rack-test#lib/rack/test/cookie_jar.rb:174
155
+ def delete(name); end
156
+
157
+ # Return a raw cookie string for the cookie header to
158
+ # use for the given URI.
159
+ #
160
+ # pkg:gem/rack-test#lib/rack/test/cookie_jar.rb:208
161
+ def for(uri); end
162
+
163
+ # Return the first cookie with the given name, or nil if
164
+ # no such cookie exists.
165
+ #
166
+ # pkg:gem/rack-test#lib/rack/test/cookie_jar.rb:166
167
+ def get_cookie(name); end
168
+
169
+ # Add a string of raw cookie information to the cookie jar,
170
+ # if the cookie is valid for the given URI.
171
+ # Cookies should be separated with a newline.
172
+ #
173
+ # pkg:gem/rack-test#lib/rack/test/cookie_jar.rb:184
174
+ def merge(raw_cookies, uri = T.unsafe(nil)); end
175
+
176
+ # Return a hash cookie names and cookie values for cookies in the jar.
177
+ #
178
+ # pkg:gem/rack-test#lib/rack/test/cookie_jar.rb:225
179
+ def to_hash; end
180
+
181
+ private
182
+
183
+ # Yield each cookie that matches for the URI.
184
+ #
185
+ # The cookies are sorted by most specific first. So, we loop through
186
+ # all the cookies in order and add it to a hash by cookie name if
187
+ # the cookie can be sent to the current URI. It's added to the hash
188
+ # so that when we are done, the cookies will be unique by name and
189
+ # we'll have grabbed the most specific to the URI.
190
+ #
191
+ # pkg:gem/rack-test#lib/rack/test/cookie_jar.rb:244
192
+ def each_cookie_for(uri); end
193
+
194
+ # Ensure the copy uses a distinct cookies array.
195
+ #
196
+ # pkg:gem/rack-test#lib/rack/test/cookie_jar.rb:143
197
+ def initialize_copy(other); end
198
+ end
199
+
200
+ # pkg:gem/rack-test#lib/rack/test/cookie_jar.rb:135
201
+ Rack::Test::CookieJar::DELIMITER = T.let(T.unsafe(nil), String)
202
+
203
+ # The default host to use for requests, when a full URI is not
204
+ # provided.
205
+ #
206
+ # pkg:gem/rack-test#lib/rack/test.rb:33
207
+ Rack::Test::DEFAULT_HOST = T.let(T.unsafe(nil), String)
208
+
209
+ # The ending boundary in multipart requests
210
+ #
211
+ # pkg:gem/rack-test#lib/rack/test.rb:42
212
+ Rack::Test::END_BOUNDARY = T.let(T.unsafe(nil), String)
213
+
214
+ # The common base class for exceptions raised by Rack::Test
215
+ #
216
+ # pkg:gem/rack-test#lib/rack/test.rb:45
217
+ class Rack::Test::Error < ::StandardError; end
218
+
219
+ # The default multipart boundary to use for multipart request bodies
220
+ #
221
+ # pkg:gem/rack-test#lib/rack/test.rb:36
222
+ Rack::Test::MULTIPART_BOUNDARY = T.let(T.unsafe(nil), String)
223
+
224
+ # This module serves as the primary integration point for using Rack::Test
225
+ # in a testing environment. It depends on an app method being defined in the
226
+ # same context, and provides the Rack::Test API methods (see Rack::Test::Session
227
+ # for their documentation). It defines the following methods that are delegated
228
+ # to the current session: :request, :get, :post, :put, :patch, :delete, :options,
229
+ # :head, :custom_request, :follow_redirect!, :header, :env, :set_cookie,
230
+ # :clear_cookies, :authorize, :basic_authorize, :last_response, and :last_request.
231
+ #
232
+ # Example:
233
+ #
234
+ # class HomepageTest < Test::Unit::TestCase
235
+ # include Rack::Test::Methods
236
+ #
237
+ # def app
238
+ # MyApp
239
+ # end
240
+ # end
241
+ #
242
+ # pkg:gem/rack-test#lib/rack/test/methods.rb:24
243
+ module Rack::Test::Methods
244
+ extend ::Forwardable
245
+
246
+ # Private accessor to avoid uninitialized instance variable warning in Ruby 2.*
247
+ #
248
+ # pkg:gem/rack-test#lib/rack/test/methods.rb:90
249
+ def _rack_test_current_session=(_arg0); end
250
+
251
+ # pkg:gem/rack-test#lib/rack/test/methods.rb:68
252
+ def authorize(*_arg0, **_arg1, &_arg2); end
253
+
254
+ # pkg:gem/rack-test#lib/rack/test/methods.rb:68
255
+ def basic_authorize(*_arg0, **_arg1, &_arg2); end
256
+
257
+ # Create a new Rack::Test::Session for #app.
258
+ #
259
+ # pkg:gem/rack-test#lib/rack/test/methods.rb:40
260
+ def build_rack_test_session(_name); end
261
+
262
+ # pkg:gem/rack-test#lib/rack/test/methods.rb:68
263
+ def clear_cookies(*_arg0, **_arg1, &_arg2); end
264
+
265
+ # Return the currently actively session. This is the session to
266
+ # which the delegated methods are sent.
267
+ #
268
+ # pkg:gem/rack-test#lib/rack/test/methods.rb:55
269
+ def current_session; end
270
+
271
+ # pkg:gem/rack-test#lib/rack/test/methods.rb:68
272
+ def custom_request(*_arg0, **_arg1, &_arg2); end
273
+
274
+ # pkg:gem/rack-test#lib/rack/test/methods.rb:68
275
+ def delete(*_arg0, **_arg1, &_arg2); end
276
+
277
+ # pkg:gem/rack-test#lib/rack/test/methods.rb:68
278
+ def env(*_arg0, **_arg1, &_arg2); end
279
+
280
+ # pkg:gem/rack-test#lib/rack/test/methods.rb:68
281
+ def follow_redirect!(*_arg0, **_arg1, &_arg2); end
282
+
283
+ # pkg:gem/rack-test#lib/rack/test/methods.rb:68
284
+ def get(*_arg0, **_arg1, &_arg2); end
285
+
286
+ # pkg:gem/rack-test#lib/rack/test/methods.rb:68
287
+ def head(*_arg0, **_arg1, &_arg2); end
288
+
289
+ # pkg:gem/rack-test#lib/rack/test/methods.rb:68
290
+ def header(*_arg0, **_arg1, &_arg2); end
291
+
292
+ # pkg:gem/rack-test#lib/rack/test/methods.rb:68
293
+ def last_request(*_arg0, **_arg1, &_arg2); end
294
+
295
+ # pkg:gem/rack-test#lib/rack/test/methods.rb:68
296
+ def last_response(*_arg0, **_arg1, &_arg2); end
297
+
298
+ # pkg:gem/rack-test#lib/rack/test/methods.rb:68
299
+ def options(*_arg0, **_arg1, &_arg2); end
300
+
301
+ # pkg:gem/rack-test#lib/rack/test/methods.rb:68
302
+ def patch(*_arg0, **_arg1, &_arg2); end
303
+
304
+ # pkg:gem/rack-test#lib/rack/test/methods.rb:68
305
+ def post(*_arg0, **_arg1, &_arg2); end
306
+
307
+ # pkg:gem/rack-test#lib/rack/test/methods.rb:68
308
+ def put(*_arg0, **_arg1, &_arg2); end
309
+
310
+ # For backwards compatibility with older rack-test versions.
311
+ #
312
+ # pkg:gem/rack-test#lib/rack/test/methods.rb:37
313
+ def rack_mock_session(name = T.unsafe(nil)); end
314
+
315
+ # Return the existing session with the given name, or a new
316
+ # rack session. Always use a new session if name is nil.
317
+ #
318
+ # pkg:gem/rack-test#lib/rack/test/methods.rb:29
319
+ def rack_test_session(name = T.unsafe(nil)); end
320
+
321
+ # pkg:gem/rack-test#lib/rack/test/methods.rb:68
322
+ def request(*_arg0, **_arg1, &_arg2); end
323
+
324
+ # pkg:gem/rack-test#lib/rack/test/methods.rb:68
325
+ def set_cookie(*_arg0, **_arg1, &_arg2); end
326
+
327
+ # Create a new session (or reuse an existing session with the given name),
328
+ # and make it the current session for the given block.
329
+ #
330
+ # pkg:gem/rack-test#lib/rack/test/methods.rb:61
331
+ def with_session(name); end
332
+
333
+ private
334
+
335
+ # Private accessor to avoid uninitialized instance variable warning in Ruby 2.*
336
+ #
337
+ # pkg:gem/rack-test#lib/rack/test/methods.rb:90
338
+ def _rack_test_current_session; end
339
+ end
340
+
341
+ # The starting boundary in multipart requests
342
+ #
343
+ # pkg:gem/rack-test#lib/rack/test.rb:39
344
+ Rack::Test::START_BOUNDARY = T.let(T.unsafe(nil), String)
345
+
346
+ # Rack::Test::Session handles a series of requests issued to a Rack app.
347
+ # It keeps track of the cookies for the session, and allows for setting headers
348
+ # and a default rack environment that is used for future requests.
349
+ #
350
+ # Rack::Test::Session's methods are most often called through Rack::Test::Methods,
351
+ # which will automatically build a session when it's first used.
352
+ #
353
+ # pkg:gem/rack-test#lib/rack/test.rb:53
354
+ class Rack::Test::Session
355
+ include ::Rack::Utils
356
+ include ::Rack::Test::Utils
357
+ extend ::Forwardable
358
+
359
+ # Creates a Rack::Test::Session for a given Rack app or Rack::Test::BasicSession.
360
+ #
361
+ # Note: Generally, you won't need to initialize a Rack::Test::Session directly.
362
+ # Instead, you should include Rack::Test::Methods into your testing context.
363
+ # (See README.rdoc for an example)
364
+ #
365
+ # The following methods are defined via metaprogramming: get, post, put, patch,
366
+ # delete, options, and head. Each method submits a request with the given request
367
+ # method, with the given URI and optional parameters and rack environment.
368
+ # Examples:
369
+ #
370
+ # # URI only:
371
+ # get("/") # GET /
372
+ # get("/?foo=bar") # GET /?foo=bar
373
+ #
374
+ # # URI and parameters
375
+ # get("/foo", 'bar'=>'baz') # GET /foo?bar=baz
376
+ # post("/foo", 'bar'=>'baz') # POST /foo (bar=baz in request body)
377
+ #
378
+ # # URI, parameters, and rack environment
379
+ # get("/bar", {}, 'CONTENT_TYPE'=>'foo')
380
+ # get("/bar", {'foo'=>'baz'}, 'HTTP_ACCEPT'=>'*')
381
+ #
382
+ # The above methods as well as #request and #custom_request store the Rack::Request
383
+ # submitted in #last_request. The methods store a Rack::MockResponse based on the
384
+ # response in #last_response. #last_response is also returned by the methods.
385
+ # If a block is given, #last_response is also yielded to the block.
386
+ #
387
+ # pkg:gem/rack-test#lib/rack/test.rb:99
388
+ def initialize(app, default_host = T.unsafe(nil)); end
389
+
390
+ # Run a block after the each request completes.
391
+ #
392
+ # pkg:gem/rack-test#lib/rack/test.rb:118
393
+ def after_request(&block); end
394
+
395
+ # pkg:gem/rack-test#lib/rack/test.rb:203
396
+ def authorize(username, password); end
397
+
398
+ # Set the username and password for HTTP Basic authorization, to be
399
+ # included in subsequent requests in the HTTP_AUTHORIZATION header.
400
+ #
401
+ # Example:
402
+ # basic_authorize "bryan", "secret"
403
+ #
404
+ # pkg:gem/rack-test#lib/rack/test.rb:198
405
+ def basic_authorize(username, password); end
406
+
407
+ # Replace the current cookie jar with an empty cookie jar.
408
+ #
409
+ # pkg:gem/rack-test#lib/rack/test.rb:123
410
+ def clear_cookies; end
411
+
412
+ # The Rack::Test::CookieJar for the cookies for the current session.
413
+ #
414
+ # pkg:gem/rack-test#lib/rack/test.rb:67
415
+ def cookie_jar; end
416
+
417
+ # The Rack::Test::CookieJar for the cookies for the current session.
418
+ #
419
+ # pkg:gem/rack-test#lib/rack/test.rb:67
420
+ def cookie_jar=(_arg0); end
421
+
422
+ # Issue a request using the given HTTP verb for the given URI, with optional
423
+ # params and rack environment. Example:
424
+ #
425
+ # custom_request "LINK", "/"
426
+ #
427
+ # pkg:gem/rack-test#lib/rack/test.rb:160
428
+ def custom_request(verb, uri, params = T.unsafe(nil), env = T.unsafe(nil), &block); end
429
+
430
+ # The default host used for the session for when using paths for URIs.
431
+ #
432
+ # pkg:gem/rack-test#lib/rack/test.rb:70
433
+ def default_host; end
434
+
435
+ # pkg:gem/rack-test#lib/rack/test.rb:110
436
+ def delete(uri, params = T.unsafe(nil), env = T.unsafe(nil), &block); end
437
+
438
+ # Set an entry in the rack environment to be included on all subsequent
439
+ # requests through the session. Use a value of nil to remove a previously
440
+ # value. Example:
441
+ #
442
+ # env "rack.session", {:csrf => 'token'}
443
+ #
444
+ # pkg:gem/rack-test#lib/rack/test.rb:185
445
+ def env(name, value); end
446
+
447
+ # Rack::Test will not follow any redirects automatically. This method
448
+ # will follow the redirect returned (including setting the Referer header
449
+ # on the new request) in the last response. If the last response was not
450
+ # a redirect, an error will be raised.
451
+ #
452
+ # pkg:gem/rack-test#lib/rack/test.rb:209
453
+ def follow_redirect!; end
454
+
455
+ # pkg:gem/rack-test#lib/rack/test.rb:110
456
+ def get(uri, params = T.unsafe(nil), env = T.unsafe(nil), &block); end
457
+
458
+ # pkg:gem/rack-test#lib/rack/test.rb:110
459
+ def head(uri, params = T.unsafe(nil), env = T.unsafe(nil), &block); end
460
+
461
+ # Set a header to be included on all subsequent requests through the
462
+ # session. Use a value of nil to remove a previously configured header.
463
+ #
464
+ # In accordance with the Rack spec, headers will be included in the Rack
465
+ # environment hash in HTTP_USER_AGENT form. Example:
466
+ #
467
+ # header "user-agent", "Firefox"
468
+ #
469
+ # pkg:gem/rack-test#lib/rack/test.rb:173
470
+ def header(name, value); end
471
+
472
+ # Return the last request issued in the session. Raises an error if no
473
+ # requests have been sent yet.
474
+ #
475
+ # pkg:gem/rack-test#lib/rack/test.rb:134
476
+ def last_request; end
477
+
478
+ # Return the last response received in the session. Raises an error if
479
+ # no requests have been sent yet.
480
+ #
481
+ # pkg:gem/rack-test#lib/rack/test.rb:141
482
+ def last_response; end
483
+
484
+ # pkg:gem/rack-test#lib/rack/test.rb:110
485
+ def options(uri, params = T.unsafe(nil), env = T.unsafe(nil), &block); end
486
+
487
+ # pkg:gem/rack-test#lib/rack/test.rb:110
488
+ def patch(uri, params = T.unsafe(nil), env = T.unsafe(nil), &block); end
489
+
490
+ # pkg:gem/rack-test#lib/rack/test.rb:110
491
+ def post(uri, params = T.unsafe(nil), env = T.unsafe(nil), &block); end
492
+
493
+ # pkg:gem/rack-test#lib/rack/test.rb:110
494
+ def put(uri, params = T.unsafe(nil), env = T.unsafe(nil), &block); end
495
+
496
+ # Issue a request to the Rack app for the given URI and optional Rack
497
+ # environment. Example:
498
+ #
499
+ # request "/"
500
+ #
501
+ # pkg:gem/rack-test#lib/rack/test.rb:150
502
+ def request(uri, env = T.unsafe(nil), &block); end
503
+
504
+ # Yield to the block, and restore the last request, last response, and
505
+ # cookie jar to the state they were prior to block execution upon
506
+ # exiting the block.
507
+ #
508
+ # pkg:gem/rack-test#lib/rack/test.rb:240
509
+ def restore_state; end
510
+
511
+ # Set a cookie in the current cookie jar.
512
+ #
513
+ # pkg:gem/rack-test#lib/rack/test.rb:128
514
+ def set_cookie(cookie, uri = T.unsafe(nil)); end
515
+
516
+ private
517
+
518
+ # Append a string version of the query params to the array of query params.
519
+ #
520
+ # pkg:gem/rack-test#lib/rack/test.rb:340
521
+ def append_query_params(query_array, query_params); end
522
+
523
+ # close() gets called automatically in newer Rack versions.
524
+ #
525
+ # pkg:gem/rack-test#lib/rack/test.rb:266
526
+ def close_body(body); end
527
+
528
+ # Update environment to use based on given URI.
529
+ #
530
+ # pkg:gem/rack-test#lib/rack/test.rb:293
531
+ def env_for(uri, env); end
532
+
533
+ # Return the multipart content type to use based on the environment.
534
+ #
535
+ # pkg:gem/rack-test#lib/rack/test.rb:346
536
+ def multipart_content_type(env); end
537
+
538
+ # Normalize URI based on given URI/path and environment.
539
+ #
540
+ # pkg:gem/rack-test#lib/rack/test.rb:271
541
+ def parse_uri(path, env); end
542
+
543
+ # Submit the request with the given URI and rack environment to
544
+ # the mock session. Returns and potentially yields the last response.
545
+ #
546
+ # pkg:gem/rack-test#lib/rack/test.rb:357
547
+ def process_request(uri, env); end
548
+
549
+ class << self
550
+ # pkg:gem/rack-test#lib/rack/test.rb:57
551
+ def new(app, default_host = T.unsafe(nil)); end
552
+ end
553
+ end
554
+
555
+ # pkg:gem/rack-test#lib/rack/test.rb:279
556
+ Rack::Test::Session::DEFAULT_ENV = T.let(T.unsafe(nil), Hash)
557
+
558
+ # Wraps a Tempfile with a content type. Including one or more UploadedFile's
559
+ # in the params causes Rack::Test to build and issue a multipart request.
560
+ #
561
+ # Example:
562
+ # post "/photos", "file" => Rack::Test::UploadedFile.new("me.jpg", "image/jpeg")
563
+ #
564
+ # pkg:gem/rack-test#lib/rack/test/uploaded_file.rb:14
565
+ class Rack::Test::UploadedFile
566
+ # Creates a new UploadedFile instance.
567
+ #
568
+ # Arguments:
569
+ # content :: is a path to a file, or an {IO} or {StringIO} object representing the content.
570
+ # content_type :: MIME type of the file
571
+ # binary :: Whether the file should be set to binmode (content treated as binary).
572
+ # original_filename :: The filename to use for the file. Required if content is StringIO, optional override if not
573
+ #
574
+ # pkg:gem/rack-test#lib/rack/test/uploaded_file.rb:31
575
+ def initialize(content, content_type = T.unsafe(nil), binary = T.unsafe(nil), original_filename: T.unsafe(nil)); end
576
+
577
+ # Append to given buffer in 64K chunks to avoid multiple large
578
+ # copies of file data in memory. Rewind tempfile before and
579
+ # after to make sure all data in tempfile is appended to the
580
+ # buffer.
581
+ #
582
+ # pkg:gem/rack-test#lib/rack/test/uploaded_file.rb:60
583
+ def append_to(buffer); end
584
+
585
+ # The content type of the "uploaded" file
586
+ #
587
+ # pkg:gem/rack-test#lib/rack/test/uploaded_file.rb:22
588
+ def content_type; end
589
+
590
+ # The content type of the "uploaded" file
591
+ #
592
+ # pkg:gem/rack-test#lib/rack/test/uploaded_file.rb:22
593
+ def content_type=(_arg0); end
594
+
595
+ # pkg:gem/rack-test#lib/rack/test/uploaded_file.rb:49
596
+ def local_path; end
597
+
598
+ # Delegate all methods not handled to the tempfile.
599
+ #
600
+ # pkg:gem/rack-test#lib/rack/test/uploaded_file.rb:52
601
+ def method_missing(method_name, *args, &block); end
602
+
603
+ # The filename, *not* including the path, of the "uploaded" file
604
+ #
605
+ # pkg:gem/rack-test#lib/rack/test/uploaded_file.rb:16
606
+ def original_filename; end
607
+
608
+ # The path to the tempfile. Will not work if the receiver's content is from a StringIO.
609
+ #
610
+ # pkg:gem/rack-test#lib/rack/test/uploaded_file.rb:46
611
+ def path; end
612
+
613
+ # The tempfile
614
+ #
615
+ # pkg:gem/rack-test#lib/rack/test/uploaded_file.rb:19
616
+ def tempfile; end
617
+
618
+ private
619
+
620
+ # Create a tempfile and copy the content from the given path into the tempfile, optionally renaming if
621
+ # original_filename has been set.
622
+ #
623
+ # pkg:gem/rack-test#lib/rack/test/uploaded_file.rb:86
624
+ def initialize_from_file_path(path); end
625
+
626
+ # Use the StringIO as the tempfile.
627
+ #
628
+ # pkg:gem/rack-test#lib/rack/test/uploaded_file.rb:78
629
+ def initialize_from_stringio(stringio); end
630
+
631
+ # pkg:gem/rack-test#lib/rack/test/uploaded_file.rb:71
632
+ def respond_to_missing?(method_name, include_private = T.unsafe(nil)); end
633
+ end
634
+
635
+ # pkg:gem/rack-test#lib/rack/test/utils.rb:5
636
+ module Rack::Test::Utils
637
+ include ::Rack::Utils
638
+ extend ::Rack::Utils
639
+ extend ::Rack::Test::Utils
640
+
641
+ # Build a multipart body for the given params.
642
+ #
643
+ # pkg:gem/rack-test#lib/rack/test/utils.rb:34
644
+ def build_multipart(params, _first = T.unsafe(nil), multipart = T.unsafe(nil)); end
645
+
646
+ # Build a query string for the given value and prefix. The value
647
+ # can be an array or hash of parameters.
648
+ #
649
+ # pkg:gem/rack-test#lib/rack/test/utils.rb:11
650
+ def build_nested_query(value, prefix = T.unsafe(nil)); end
651
+
652
+ private
653
+
654
+ # Append each multipart parameter value to the buffer.
655
+ #
656
+ # pkg:gem/rack-test#lib/rack/test/utils.rb:100
657
+ def _build_parts(buffer, parameters); end
658
+
659
+ # Append the multipart fragment for a parameter that is a file upload to the buffer.
660
+ #
661
+ # pkg:gem/rack-test#lib/rack/test/utils.rb:133
662
+ def build_file_part(buffer, parameter_name, uploaded_file); end
663
+
664
+ # Build the multipart content for uploading.
665
+ #
666
+ # pkg:gem/rack-test#lib/rack/test/utils.rb:94
667
+ def build_parts(buffer, parameters); end
668
+
669
+ # Append the multipart fragment for a parameter that isn't a file upload to the buffer.
670
+ #
671
+ # pkg:gem/rack-test#lib/rack/test/utils.rb:121
672
+ def build_primitive_part(buffer, parameter_name, value); end
673
+
674
+ # Return a flattened hash of parameter values based on the given params.
675
+ #
676
+ # pkg:gem/rack-test#lib/rack/test/utils.rb:62
677
+ def normalize_multipart_params(params, first = T.unsafe(nil)); end
678
+ end
679
+
680
+ # pkg:gem/rack-test#lib/rack/test/version.rb:3
681
+ Rack::Test::VERSION = T.let(T.unsafe(nil), String)