decentworks-date-support 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 (142) hide show
  1. checksums.yaml +7 -0
  2. data/.gem_rbs_collection/actionpack/7.2/.rbs_meta.yaml +9 -0
  3. data/.gem_rbs_collection/actionpack/7.2/actioncontroller-7.2.rbs +14 -0
  4. data/.gem_rbs_collection/actionpack/7.2/actioncontroller.rbs +290 -0
  5. data/.gem_rbs_collection/actionpack/7.2/actiondispatch.rbs +349 -0
  6. data/.gem_rbs_collection/actionpack/7.2/actionpack-generated.rbs +11497 -0
  7. data/.gem_rbs_collection/actionpack/7.2/patch.rbs +77 -0
  8. data/.gem_rbs_collection/actionview/6.0/.rbs_meta.yaml +9 -0
  9. data/.gem_rbs_collection/actionview/6.0/actionview-generated.rbs +8976 -0
  10. data/.gem_rbs_collection/actionview/6.0/actionview.rbs +1940 -0
  11. data/.gem_rbs_collection/actionview/6.0/patch.rbs +57 -0
  12. data/.gem_rbs_collection/activesupport/7.0/.rbs_meta.yaml +9 -0
  13. data/.gem_rbs_collection/activesupport/7.0/activesupport-7.0.rbs +381 -0
  14. data/.gem_rbs_collection/activesupport/7.0/activesupport-generated.rbs +11633 -0
  15. data/.gem_rbs_collection/activesupport/7.0/activesupport.rbs +724 -0
  16. data/.gem_rbs_collection/activesupport/7.0/manifest.yaml +15 -0
  17. data/.gem_rbs_collection/activesupport/7.0/patch.rbs +55 -0
  18. data/.gem_rbs_collection/ast/2.4/.rbs_meta.yaml +9 -0
  19. data/.gem_rbs_collection/ast/2.4/ast.rbs +73 -0
  20. data/.gem_rbs_collection/cgi/0.5/.rbs_meta.yaml +9 -0
  21. data/.gem_rbs_collection/cgi/0.5/core.rbs +925 -0
  22. data/.gem_rbs_collection/cgi/0.5/manifest.yaml +3 -0
  23. data/.gem_rbs_collection/concurrent-ruby/1.1/.rbs_meta.yaml +9 -0
  24. data/.gem_rbs_collection/concurrent-ruby/1.1/array.rbs +4 -0
  25. data/.gem_rbs_collection/concurrent-ruby/1.1/atomic_reference.rbs +16 -0
  26. data/.gem_rbs_collection/concurrent-ruby/1.1/executor.rbs +96 -0
  27. data/.gem_rbs_collection/concurrent-ruby/1.1/hash.rbs +4 -0
  28. data/.gem_rbs_collection/concurrent-ruby/1.1/map.rbs +68 -0
  29. data/.gem_rbs_collection/concurrent-ruby/1.1/promises.rbs +249 -0
  30. data/.gem_rbs_collection/concurrent-ruby/1.1/set.rbs +4 -0
  31. data/.gem_rbs_collection/concurrent-ruby/1.1/timer_task.rbs +47 -0
  32. data/.gem_rbs_collection/concurrent-ruby/1.1/utility/processor_counter.rbs +5 -0
  33. data/.gem_rbs_collection/connection_pool/2.4/.rbs_meta.yaml +9 -0
  34. data/.gem_rbs_collection/connection_pool/2.4/connection_pool.rbs +34 -0
  35. data/.gem_rbs_collection/connection_pool/2.4/manifest.yaml +2 -0
  36. data/.gem_rbs_collection/diff-lcs/1.5/.rbs_meta.yaml +9 -0
  37. data/.gem_rbs_collection/diff-lcs/1.5/diff-lcs.rbs +11 -0
  38. data/.gem_rbs_collection/faker/3.4.2/.rbs_meta.yaml +9 -0
  39. data/.gem_rbs_collection/faker/3.4.2/faker-2.23.rbs +90 -0
  40. data/.gem_rbs_collection/faker/3.4.2/faker.rbs +18 -0
  41. data/.gem_rbs_collection/i18n/1.10/.rbs_meta.yaml +9 -0
  42. data/.gem_rbs_collection/i18n/1.10/backend.rbs +274 -0
  43. data/.gem_rbs_collection/i18n/1.10/i18n.rbs +116 -0
  44. data/.gem_rbs_collection/lint_roller/1.1/.rbs_meta.yaml +9 -0
  45. data/.gem_rbs_collection/lint_roller/1.1/lint_roller.rbs +48 -0
  46. data/.gem_rbs_collection/minitest/5.25/.rbs_meta.yaml +9 -0
  47. data/.gem_rbs_collection/minitest/5.25/minitest/abstract_reporter.rbs +52 -0
  48. data/.gem_rbs_collection/minitest/5.25/minitest/assertion.rbs +17 -0
  49. data/.gem_rbs_collection/minitest/5.25/minitest/assertions.rbs +590 -0
  50. data/.gem_rbs_collection/minitest/5.25/minitest/backtrace_filter.rbs +23 -0
  51. data/.gem_rbs_collection/minitest/5.25/minitest/bench_spec.rbs +102 -0
  52. data/.gem_rbs_collection/minitest/5.25/minitest/benchmark.rbs +259 -0
  53. data/.gem_rbs_collection/minitest/5.25/minitest/composite_reporter.rbs +25 -0
  54. data/.gem_rbs_collection/minitest/5.25/minitest/compress.rbs +13 -0
  55. data/.gem_rbs_collection/minitest/5.25/minitest/error_on_warning.rbs +3 -0
  56. data/.gem_rbs_collection/minitest/5.25/minitest/expectation.rbs +2 -0
  57. data/.gem_rbs_collection/minitest/5.25/minitest/expectations.rbs +21 -0
  58. data/.gem_rbs_collection/minitest/5.25/minitest/guard.rbs +64 -0
  59. data/.gem_rbs_collection/minitest/5.25/minitest/mock.rbs +64 -0
  60. data/.gem_rbs_collection/minitest/5.25/minitest/parallel/executor.rbs +46 -0
  61. data/.gem_rbs_collection/minitest/5.25/minitest/parallel/test/class_methods.rbs +5 -0
  62. data/.gem_rbs_collection/minitest/5.25/minitest/parallel/test.rbs +3 -0
  63. data/.gem_rbs_collection/minitest/5.25/minitest/parallel.rbs +2 -0
  64. data/.gem_rbs_collection/minitest/5.25/minitest/pride_io.rbs +62 -0
  65. data/.gem_rbs_collection/minitest/5.25/minitest/pride_lol.rbs +19 -0
  66. data/.gem_rbs_collection/minitest/5.25/minitest/progress_reporter.rbs +11 -0
  67. data/.gem_rbs_collection/minitest/5.25/minitest/reportable.rbs +53 -0
  68. data/.gem_rbs_collection/minitest/5.25/minitest/reporter.rbs +5 -0
  69. data/.gem_rbs_collection/minitest/5.25/minitest/result.rbs +28 -0
  70. data/.gem_rbs_collection/minitest/5.25/minitest/runnable.rbs +163 -0
  71. data/.gem_rbs_collection/minitest/5.25/minitest/skip.rbs +6 -0
  72. data/.gem_rbs_collection/minitest/5.25/minitest/spec/dsl/instance_methods.rbs +48 -0
  73. data/.gem_rbs_collection/minitest/5.25/minitest/spec/dsl.rbs +129 -0
  74. data/.gem_rbs_collection/minitest/5.25/minitest/spec.rbs +11 -0
  75. data/.gem_rbs_collection/minitest/5.25/minitest/statistics_reporter.rbs +81 -0
  76. data/.gem_rbs_collection/minitest/5.25/minitest/summary_reporter.rbs +18 -0
  77. data/.gem_rbs_collection/minitest/5.25/minitest/test/lifecycle_hooks.rbs +92 -0
  78. data/.gem_rbs_collection/minitest/5.25/minitest/test.rbs +69 -0
  79. data/.gem_rbs_collection/minitest/5.25/minitest/unexpected_error.rbs +12 -0
  80. data/.gem_rbs_collection/minitest/5.25/minitest/unexpected_warning.rbs +6 -0
  81. data/.gem_rbs_collection/minitest/5.25/minitest/unit/test_case.rbs +3 -0
  82. data/.gem_rbs_collection/minitest/5.25/minitest/unit.rbs +4 -0
  83. data/.gem_rbs_collection/minitest/5.25/minitest.rbs +115 -0
  84. data/.gem_rbs_collection/nokogiri/1.11/.rbs_meta.yaml +9 -0
  85. data/.gem_rbs_collection/nokogiri/1.11/nokogiri.rbs +2332 -0
  86. data/.gem_rbs_collection/nokogiri/1.11/patch.rbs +4 -0
  87. data/.gem_rbs_collection/parallel/1.20/.rbs_meta.yaml +9 -0
  88. data/.gem_rbs_collection/parallel/1.20/parallel.rbs +86 -0
  89. data/.gem_rbs_collection/parser/3.2/.rbs_meta.yaml +9 -0
  90. data/.gem_rbs_collection/parser/3.2/manifest.yaml +7 -0
  91. data/.gem_rbs_collection/parser/3.2/parser.rbs +194 -0
  92. data/.gem_rbs_collection/parser/3.2/polyfill.rbs +4 -0
  93. data/.gem_rbs_collection/rack/2.2/.rbs_meta.yaml +9 -0
  94. data/.gem_rbs_collection/rack/2.2/manifest.yaml +3 -0
  95. data/.gem_rbs_collection/rack/2.2/rack.rbs +1480 -0
  96. data/.gem_rbs_collection/rails-dom-testing/2.0/.rbs_meta.yaml +9 -0
  97. data/.gem_rbs_collection/rails-dom-testing/2.0/rails-dom-testing.rbs +51 -0
  98. data/.gem_rbs_collection/rails-html-sanitizer/1.6/.rbs_meta.yaml +9 -0
  99. data/.gem_rbs_collection/rails-html-sanitizer/1.6/rails-html-sanitizer.rbs +53 -0
  100. data/.gem_rbs_collection/railties/6.0/.rbs_meta.yaml +9 -0
  101. data/.gem_rbs_collection/railties/6.0/manifest.yaml +2 -0
  102. data/.gem_rbs_collection/railties/6.0/patch.rbs +17 -0
  103. data/.gem_rbs_collection/railties/6.0/railties-generated.rbs +4822 -0
  104. data/.gem_rbs_collection/railties/6.0/railties.rbs +44 -0
  105. data/.gem_rbs_collection/rainbow/3.0/.rbs_meta.yaml +9 -0
  106. data/.gem_rbs_collection/rainbow/3.0/global.rbs +7 -0
  107. data/.gem_rbs_collection/rainbow/3.0/presenter.rbs +209 -0
  108. data/.gem_rbs_collection/rainbow/3.0/rainbow.rbs +5 -0
  109. data/.gem_rbs_collection/rake/13.0/.rbs_meta.yaml +9 -0
  110. data/.gem_rbs_collection/rake/13.0/manifest.yaml +2 -0
  111. data/.gem_rbs_collection/rake/13.0/rake.rbs +39 -0
  112. data/.gem_rbs_collection/regexp_parser/2.8/.rbs_meta.yaml +9 -0
  113. data/.gem_rbs_collection/regexp_parser/2.8/regexp_parser.rbs +17 -0
  114. data/.gem_rbs_collection/rubocop/1.57/.rbs_meta.yaml +9 -0
  115. data/.gem_rbs_collection/rubocop/1.57/rubocop.rbs +208 -0
  116. data/.gem_rbs_collection/rubocop-ast/1.46/.rbs_meta.yaml +9 -0
  117. data/.gem_rbs_collection/rubocop-ast/1.46/rubocop-ast.rbs +903 -0
  118. data/.gem_rbs_collection/thor/1.2/.rbs_meta.yaml +9 -0
  119. data/.gem_rbs_collection/thor/1.2/thor.rbs +62 -0
  120. data/.gem_rbs_collection/tzinfo/2.0/.rbs_meta.yaml +9 -0
  121. data/.gem_rbs_collection/tzinfo/2.0/manifest.yaml +7 -0
  122. data/.gem_rbs_collection/tzinfo/2.0/tzinfo.rbs +600 -0
  123. data/.rspec +3 -0
  124. data/.rubocop.yml +8 -0
  125. data/.ruby-version +1 -0
  126. data/CHANGELOG.md +5 -0
  127. data/CODE_OF_CONDUCT.md +132 -0
  128. data/LICENSE +21 -0
  129. data/LICENSE.txt +21 -0
  130. data/README.md +54 -0
  131. data/Rakefile +12 -0
  132. data/Steepfile +43 -0
  133. data/lib/decentworks/active_support/time_with_zone_support.rb +327 -0
  134. data/lib/decentworks/date/support/version.rb +9 -0
  135. data/lib/decentworks/date_support.rb +323 -0
  136. data/lib/decentworks_date_support.rb +4 -0
  137. data/rbs_collection.lock.yaml +288 -0
  138. data/rbs_collection.yaml +41 -0
  139. data/sig/decentworks/active_support/time_with_zone_support.rbs +109 -0
  140. data/sig/decentworks/date/support.rbs +8 -0
  141. data/sig/decentworks/date_support.rbs +107 -0
  142. metadata +197 -0
@@ -0,0 +1,4822 @@
1
+ # The generated code is based on Ruby on Rails source code
2
+ # You can find the license of Ruby on Rails from following.
3
+
4
+ #Copyright (c) 2005-2019 David Heinemeier Hansson
5
+ #
6
+ #Permission is hereby granted, free of charge, to any person obtaining
7
+ #a copy of this software and associated documentation files (the
8
+ #"Software"), to deal in the Software without restriction, including
9
+ #without limitation the rights to use, copy, modify, merge, publish,
10
+ #distribute, sublicense, and/or sell copies of the Software, and to
11
+ #permit persons to whom the Software is furnished to do so, subject to
12
+ #the following conditions:
13
+ #
14
+ #The above copyright notice and this permission notice shall be
15
+ #included in all copies or substantial portions of the Software.
16
+ #
17
+ #THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18
+ #EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19
+ #MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20
+ #NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
21
+ #LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
22
+ #OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
23
+ #WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24
+
25
+ module Minitest
26
+ class SuppressedSummaryReporter < SummaryReporter
27
+ # Disable extra failure output after a run if output is inline.
28
+ def aggregated_results: () -> untyped
29
+ end
30
+
31
+ def self.plugin_rails_options: (untyped opts, untyped options) -> untyped
32
+
33
+ # Owes great inspiration to test runner trailblazers like RSpec,
34
+ # minitest-reporters, maxitest and others.
35
+ def self.plugin_rails_init: (untyped options) -> untyped
36
+ end
37
+
38
+ class RDoc::Generator::API < RDoc::Generator::SDoc
39
+ def generate_class_tree_level: (untyped classes, ?::Hash[untyped, untyped] visited) -> untyped
40
+
41
+ private
42
+
43
+ def build_core_ext_subtree: (untyped classes, untyped visited) -> untyped
44
+
45
+ def core_extension?: (untyped klass) -> untyped
46
+
47
+ def active_storage?: (untyped klass) -> untyped
48
+ end
49
+
50
+ module Rails
51
+ module API
52
+ class Task < RDoc::Task
53
+ RDOC_FILES: ::Hash[untyped, untyped]
54
+
55
+ def initialize: (untyped name) -> untyped
56
+
57
+ # Hack, ignore the desc calls performed by the original initializer.
58
+ def desc: (untyped description) -> nil
59
+
60
+ def configure_sdoc: () -> untyped
61
+
62
+ def configure_rdoc_files: () -> untyped
63
+
64
+ def setup_horo_variables: () -> untyped
65
+
66
+ def api_main: () -> untyped
67
+ end
68
+
69
+ class RepoTask < Task
70
+ def configure_sdoc: () -> untyped
71
+
72
+ def component_root_dir: (untyped component) -> untyped
73
+
74
+ def api_dir: () -> "doc/rdoc"
75
+ end
76
+
77
+ class EdgeTask < RepoTask
78
+ def rails_version: () -> ::String
79
+ end
80
+
81
+ class StableTask < RepoTask
82
+ def rails_version: () -> untyped
83
+ end
84
+ end
85
+ end
86
+
87
+ module Rails
88
+ module AppLoader
89
+ # :nodoc:
90
+ extend ::Rails::AppLoader
91
+
92
+ RUBY: untyped
93
+
94
+ EXECUTABLES: ::Array[untyped]
95
+
96
+ BUNDLER_WARNING: ::String
97
+
98
+ def exec_app: () -> (nil | untyped)
99
+
100
+ def find_executable: () -> untyped
101
+ end
102
+ end
103
+
104
+ module Rails
105
+ class AppUpdater
106
+ def self.invoke_from_app_generator: (untyped method) -> untyped
107
+
108
+ def self.app_generator: () -> untyped
109
+
110
+ def self.generator_options: () -> untyped
111
+ end
112
+ end
113
+
114
+ module Rails
115
+ class Application
116
+ module Bootstrap
117
+ include Initializable
118
+ end
119
+ end
120
+ end
121
+
122
+ module Rails
123
+ class Application
124
+ class Configuration < ::Rails::Engine::Configuration
125
+ attr_accessor allow_concurrency: untyped
126
+
127
+ attr_accessor asset_host: untyped
128
+
129
+ attr_accessor autoflush_log: untyped
130
+
131
+ attr_accessor cache_classes: untyped
132
+
133
+ attr_accessor cache_store: untyped
134
+
135
+ attr_accessor consider_all_requests_local: untyped
136
+
137
+ attr_accessor console: untyped
138
+
139
+ attr_accessor eager_load: untyped
140
+
141
+ attr_accessor exceptions_app: untyped
142
+
143
+ attr_accessor file_watcher: untyped
144
+
145
+ attr_accessor filter_parameters: untyped
146
+
147
+ attr_accessor force_ssl: untyped
148
+
149
+ attr_accessor helpers_paths: untyped
150
+
151
+ attr_accessor hosts: untyped
152
+
153
+ attr_accessor logger: untyped
154
+
155
+ attr_accessor log_formatter: untyped
156
+
157
+ attr_accessor log_tags: untyped
158
+
159
+ attr_accessor railties_order: untyped
160
+
161
+ attr_accessor relative_url_root: untyped
162
+
163
+ attr_accessor secret_key_base: untyped
164
+
165
+ attr_accessor ssl_options: untyped
166
+
167
+ attr_accessor public_file_server: ActiveSupport::OrderedOptions
168
+
169
+ attr_accessor session_options: untyped
170
+
171
+ attr_accessor time_zone: untyped
172
+
173
+ attr_accessor reload_classes_only_on_change: untyped
174
+
175
+ attr_accessor beginning_of_week: untyped
176
+
177
+ attr_accessor filter_redirect: untyped
178
+
179
+ attr_accessor x: untyped
180
+
181
+ attr_accessor enable_dependency_loading: untyped
182
+
183
+ attr_accessor read_encrypted_secrets: untyped
184
+
185
+ attr_accessor log_level: untyped
186
+
187
+ attr_accessor content_security_policy_report_only: untyped
188
+
189
+ attr_accessor content_security_policy_nonce_generator: untyped
190
+
191
+ attr_accessor content_security_policy_nonce_directives: untyped
192
+
193
+ attr_accessor require_master_key: untyped
194
+
195
+ attr_accessor credentials: ActiveSupport::OrderedOptions
196
+
197
+ attr_accessor disable_sandbox: untyped
198
+
199
+ attr_accessor add_autoload_paths_to_load_path: untyped
200
+
201
+ attr_reader encoding: untyped
202
+
203
+ attr_reader api_only: untyped
204
+
205
+ attr_reader loaded_config_version: untyped
206
+
207
+ attr_reader autoloader: untyped
208
+
209
+ def initialize: () -> untyped
210
+
211
+ # Loads default configurations. See {the result of the method for each version}[https://guides.rubyonrails.org/configuring.html#results-of-config-load-defaults].
212
+ def load_defaults: (untyped target_version) -> untyped
213
+
214
+ def encoding=: (untyped value) -> untyped
215
+
216
+ def api_only=: (untyped value) -> untyped
217
+
218
+ def debug_exception_response_format: () -> untyped
219
+
220
+ attr_writer debug_exception_response_format: untyped
221
+
222
+ def paths: () -> untyped
223
+
224
+ def load_database_yaml: () -> untyped
225
+
226
+ # Loads and returns the entire raw configuration of database from
227
+ # values stored in <tt>config/database.yml</tt>.
228
+ def database_configuration: () -> untyped
229
+
230
+ def colorize_logging: () -> untyped
231
+
232
+ def colorize_logging=: (untyped val) -> untyped
233
+
234
+ def session_store: (?untyped? new_session_store, **untyped options) -> untyped
235
+
236
+ def session_store?: () -> untyped
237
+
238
+ def annotations: () -> untyped
239
+
240
+ def content_security_policy: () { () -> untyped } -> untyped
241
+
242
+ def autoloader=: (untyped autoloader) -> untyped
243
+
244
+ def default_log_file: () -> untyped
245
+
246
+ class Custom
247
+ # nodoc:
248
+ def initialize: () -> untyped
249
+
250
+ def method_missing: (untyped method, *untyped args) -> untyped
251
+
252
+ def respond_to_missing?: (untyped symbol) -> true
253
+ end
254
+
255
+ private
256
+
257
+ def default_credentials_content_path: () -> untyped
258
+
259
+ def default_credentials_key_path: () -> untyped
260
+
261
+ def credentials_available_for_current_env?: () -> untyped
262
+ end
263
+ end
264
+ end
265
+
266
+ module Rails
267
+ class Application
268
+ class DefaultMiddlewareStack
269
+ attr_reader config: untyped
270
+
271
+ attr_reader paths: untyped
272
+
273
+ attr_reader app: untyped
274
+
275
+ def initialize: (untyped app, untyped config, untyped paths) -> untyped
276
+
277
+ def build_stack: () -> untyped
278
+
279
+ private
280
+
281
+ def load_rack_cache: () -> (nil | untyped)
282
+
283
+ def show_exceptions_app: () -> untyped
284
+ end
285
+ end
286
+ end
287
+
288
+ class DummyERB < ERB
289
+ # These classes are used to strip out the ERB configuration
290
+ # values so we can evaluate the database.yml without evaluating
291
+ # the ERB values.
292
+ # :nodoc:
293
+ def make_compiler: (untyped trim_mode) -> DummyCompiler
294
+ end
295
+
296
+ class DummyCompiler < ERB::Compiler
297
+ # :nodoc:
298
+ def compile_content: (untyped stag, untyped `out`) -> untyped
299
+ end
300
+
301
+ module Rails
302
+ class Application
303
+ module Finisher
304
+ include Initializable
305
+
306
+ class MutexHook
307
+ def initialize: (?untyped mutex) -> untyped
308
+
309
+ def run: () -> untyped
310
+
311
+ def complete: (untyped _state) -> untyped
312
+ end
313
+
314
+ module InterlockHook
315
+ def self.run: () -> untyped
316
+
317
+ def self.complete: (untyped _state) -> untyped
318
+ end
319
+ end
320
+ end
321
+ end
322
+
323
+ module Rails
324
+ class Application
325
+ class RoutesReloader
326
+ attr_reader route_sets: untyped
327
+
328
+ attr_reader paths: untyped
329
+
330
+ attr_accessor eager_load: untyped
331
+
332
+ def initialize: () -> untyped
333
+
334
+ def reload!: () -> untyped
335
+
336
+ private
337
+
338
+ def updater: () -> untyped
339
+
340
+ def clear!: () -> untyped
341
+
342
+ def load_paths: () -> untyped
343
+
344
+ def finalize!: () -> untyped
345
+
346
+ def revert: () -> untyped
347
+ end
348
+ end
349
+ end
350
+
351
+ module Rails
352
+ # An Engine with the responsibility of coordinating the whole boot process.
353
+ #
354
+ # == Initialization
355
+ #
356
+ # Rails::Application is responsible for executing all railties and engines
357
+ # initializers. It also executes some bootstrap initializers (check
358
+ # Rails::Application::Bootstrap) and finishing initializers, after all the others
359
+ # are executed (check Rails::Application::Finisher).
360
+ #
361
+ # == Configuration
362
+ #
363
+ # Besides providing the same configuration as Rails::Engine and Rails::Railtie,
364
+ # the application object has several specific configurations, for example
365
+ # "cache_classes", "consider_all_requests_local", "filter_parameters",
366
+ # "logger" and so forth.
367
+ #
368
+ # Check Rails::Application::Configuration to see them all.
369
+ #
370
+ # == Routes
371
+ #
372
+ # The application object is also responsible for holding the routes and reloading routes
373
+ # whenever the files change in development.
374
+ #
375
+ # == Middlewares
376
+ #
377
+ # The Application is also responsible for building the middleware stack.
378
+ #
379
+ # == Booting process
380
+ #
381
+ # The application is also responsible for setting up and executing the booting
382
+ # process. From the moment you require "config/application.rb" in your app,
383
+ # the booting process goes like this:
384
+ #
385
+ # 1) require "config/boot.rb" to setup load paths
386
+ # 2) require railties and engines
387
+ # 3) Define Rails.application as "class MyApp::Application < Rails::Application"
388
+ # 4) Run config.before_configuration callbacks
389
+ # 5) Load config/environments/ENV.rb
390
+ # 6) Run config.before_initialize callbacks
391
+ # 7) Run Railtie#initializer defined by railties, engines and application.
392
+ # One by one, each engine sets up its load paths, routes and runs its config/initializers/* files.
393
+ # 8) Custom Railtie#initializers added by railties, engines and applications are executed
394
+ # 9) Build the middleware stack and run to_prepare callbacks
395
+ # 10) Run config.before_eager_load and eager_load! if eager_load is true
396
+ # 11) Run config.after_initialize callbacks
397
+ #
398
+ # == Multiple Applications
399
+ #
400
+ # If you decide to define multiple applications, then the first application
401
+ # that is initialized will be set to +Rails.application+, unless you override
402
+ # it with a different application.
403
+ #
404
+ # To create a new application, you can instantiate a new instance of a class
405
+ # that has already been created:
406
+ #
407
+ # class Application < Rails::Application
408
+ # end
409
+ #
410
+ # first_application = Application.new
411
+ # second_application = Application.new(config: first_application.config)
412
+ #
413
+ # In the above example, the configuration from the first application was used
414
+ # to initialize the second application. You can also use the +initialize_copy+
415
+ # on one of the applications to create a copy of the application which shares
416
+ # the configuration.
417
+ #
418
+ # If you decide to define Rake tasks, runners, or initializers in an
419
+ # application other than +Rails.application+, then you must run them manually.
420
+ class Application < Engine
421
+ def self.inherited: (untyped base) -> untyped
422
+
423
+ def self.instance: () -> untyped
424
+
425
+ def self.create: (?::Hash[untyped, untyped] initial_variable_values) { () -> untyped } -> untyped
426
+
427
+ def self.find_root: (untyped from) -> untyped
428
+
429
+ attr_accessor assets: untyped
430
+
431
+ attr_accessor sandbox: untyped
432
+
433
+ alias sandbox? sandbox
434
+
435
+ attr_reader reloaders: untyped
436
+
437
+ attr_reader reloader: untyped
438
+
439
+ attr_reader executor: untyped
440
+
441
+ INITIAL_VARIABLES: ::Array[untyped]
442
+
443
+ def initialize: (?::Hash[untyped, untyped] initial_variable_values) { () -> untyped } -> untyped
444
+
445
+ # Returns true if the application is initialized.
446
+ def initialized?: () -> untyped
447
+
448
+ def run_load_hooks!: () -> untyped
449
+
450
+ # Reload application routes regardless if they changed or not.
451
+ def reload_routes!: () -> untyped
452
+
453
+ # Returns the application's KeyGenerator
454
+ def key_generator: () -> untyped
455
+
456
+ # Returns a message verifier object.
457
+ #
458
+ # This verifier can be used to generate and verify signed messages in the application.
459
+ #
460
+ # It is recommended not to use the same verifier for different things, so you can get different
461
+ # verifiers passing the +verifier_name+ argument.
462
+ #
463
+ # ==== Parameters
464
+ #
465
+ # * +verifier_name+ - the name of the message verifier.
466
+ #
467
+ # ==== Examples
468
+ #
469
+ # message = Rails.application.message_verifier('sensitive_data').generate('my sensible data')
470
+ # Rails.application.message_verifier('sensitive_data').verify(message)
471
+ # # => 'my sensible data'
472
+ #
473
+ # See the +ActiveSupport::MessageVerifier+ documentation for more information.
474
+ def message_verifier: (untyped verifier_name) -> untyped
475
+
476
+ # Convenience for loading config/foo.yml for the current Rails env.
477
+ #
478
+ # Example:
479
+ #
480
+ # # config/exception_notification.yml:
481
+ # production:
482
+ # url: http://127.0.0.1:8080
483
+ # namespace: my_app_production
484
+ # development:
485
+ # url: http://localhost:3001
486
+ # namespace: my_app_development
487
+ #
488
+ # # config/environments/production.rb
489
+ # Rails.application.configure do
490
+ # config.middleware.use ExceptionNotifier, config_for(:exception_notification)
491
+ # end
492
+ def config_for: (untyped name, ?env: untyped env) -> untyped
493
+
494
+ # Stores some of the Rails initial environment parameters which
495
+ # will be used by middlewares and engines to configure themselves.
496
+ def env_config: () -> untyped
497
+
498
+ # If you try to define a set of Rake tasks on the instance, these will get
499
+ # passed up to the Rake tasks defined on the application's class.
500
+ def rake_tasks: () { () -> untyped } -> untyped
501
+
502
+ # Sends the initializers to the +initializer+ method defined in the
503
+ # Rails::Initializable module. Each Rails::Application class has its own
504
+ # set of initializers, as defined by the Initializable module.
505
+ def initializer: (untyped name, ?::Hash[untyped, untyped] opts) { () -> untyped } -> untyped
506
+
507
+ # Sends any runner called in the instance of a new application up
508
+ # to the +runner+ method defined in Rails::Railtie.
509
+ def runner: () { () -> untyped } -> untyped
510
+
511
+ # Sends any console called in the instance of a new application up
512
+ # to the +console+ method defined in Rails::Railtie.
513
+ def console: () { () -> untyped } -> untyped
514
+
515
+ # Sends any generators called in the instance of a new application up
516
+ # to the +generators+ method defined in Rails::Railtie.
517
+ def generators: () { () -> untyped } -> untyped
518
+
519
+ # Sends the +isolate_namespace+ method up to the class method.
520
+ def isolate_namespace: (untyped mod) -> untyped
521
+
522
+ def self.add_lib_to_load_path!: (untyped root) -> untyped
523
+
524
+ def require_environment!: () -> untyped
525
+
526
+ def routes_reloader: () -> untyped
527
+
528
+ def watchable_args: () -> ::Array[untyped]
529
+
530
+ def initialize!: (?::Symbol group) -> untyped
531
+
532
+ def initializers: () -> untyped
533
+
534
+ def config: () -> untyped
535
+
536
+ attr_writer config: untyped
537
+
538
+ # Returns secrets added to config/secrets.yml.
539
+ #
540
+ # Example:
541
+ #
542
+ # development:
543
+ # secret_key_base: 836fa3665997a860728bcb9e9a1e704d427cfc920e79d847d79c8a9a907b9e965defa4154b2b86bdec6930adbe33f21364523a6f6ce363865724549fdfc08553
544
+ # test:
545
+ # secret_key_base: 5a37811464e7d378488b0f073e2193b093682e4e21f5d6f3ae0a4e1781e61a351fdc878a843424e81c73fb484a40d23f92c8dafac4870e74ede6e5e174423010
546
+ # production:
547
+ # secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
548
+ # namespace: my_app_production
549
+ #
550
+ # +Rails.application.secrets.namespace+ returns +my_app_production+ in the
551
+ # production environment.
552
+ def secrets: () -> ActiveSupport::OrderedOptions
553
+
554
+ attr_writer secrets: ActiveSupport::OrderedOptions
555
+
556
+ # The secret_key_base is used as the input secret to the application's key generator, which in turn
557
+ # is used to create all MessageVerifiers/MessageEncryptors, including the ones that sign and encrypt cookies.
558
+ #
559
+ # In development and test, this is randomly generated and stored in a
560
+ # temporary file in <tt>tmp/development_secret.txt</tt>.
561
+ #
562
+ # In all other environments, we look for it first in ENV["SECRET_KEY_BASE"],
563
+ # then credentials.secret_key_base, and finally secrets.secret_key_base. For most applications,
564
+ # the correct place to store it is in the encrypted credentials file.
565
+ def secret_key_base: () -> untyped
566
+
567
+ # Decrypts the credentials hash as kept in +config/credentials.yml.enc+. This file is encrypted with
568
+ # the Rails master key, which is either taken from <tt>ENV["RAILS_MASTER_KEY"]</tt> or from loading
569
+ # +config/master.key+.
570
+ # If specific credentials file exists for current environment, it takes precedence, thus for +production+
571
+ # environment look first for +config/credentials/production.yml.enc+ with master key taken
572
+ # from <tt>ENV["RAILS_MASTER_KEY"]</tt> or from loading +config/credentials/production.key+.
573
+ # Default behavior can be overwritten by setting +config.credentials.content_path+ and +config.credentials.key_path+.
574
+ def credentials: () -> untyped
575
+
576
+ # Shorthand to decrypt any encrypted configurations or files.
577
+ #
578
+ # For any file added with <tt>rails encrypted:edit</tt> call +read+ to decrypt
579
+ # the file with the master key.
580
+ # The master key is either stored in +config/master.key+ or <tt>ENV["RAILS_MASTER_KEY"]</tt>.
581
+ #
582
+ # Rails.application.encrypted("config/mystery_man.txt.enc").read
583
+ # # => "We've met before, haven't we?"
584
+ #
585
+ # It's also possible to interpret encrypted YAML files with +config+.
586
+ #
587
+ # Rails.application.encrypted("config/credentials.yml.enc").config
588
+ # # => { next_guys_line: "I don't think so. Where was it you think we met?" }
589
+ #
590
+ # Any top-level configs are also accessible directly on the return value:
591
+ #
592
+ # Rails.application.encrypted("config/credentials.yml.enc").next_guys_line
593
+ # # => "I don't think so. Where was it you think we met?"
594
+ #
595
+ # The files or configs can also be encrypted with a custom key. To decrypt with
596
+ # a key in the +ENV+, use:
597
+ #
598
+ # Rails.application.encrypted("config/special_tokens.yml.enc", env_key: "SPECIAL_TOKENS")
599
+ #
600
+ # Or to decrypt with a file, that should be version control ignored, relative to +Rails.root+:
601
+ #
602
+ # Rails.application.encrypted("config/special_tokens.yml.enc", key_path: "config/special_tokens.key")
603
+ def encrypted: (untyped path, ?env_key: ::String env_key, ?key_path: ::String key_path) -> ActiveSupport::EncryptedConfiguration
604
+
605
+ def to_app: () -> untyped
606
+
607
+ def helpers_paths: () -> untyped
608
+
609
+ def migration_railties: () -> untyped
610
+
611
+ # Eager loads the application code.
612
+ def eager_load!: () -> untyped
613
+
614
+ alias build_middleware_stack app
615
+
616
+ def run_tasks_blocks: (untyped app) -> untyped
617
+
618
+ def run_generators_blocks: (untyped app) -> untyped
619
+
620
+ def run_runner_blocks: (untyped app) -> untyped
621
+
622
+ def run_console_blocks: (untyped app) -> untyped
623
+
624
+ def ordered_railties: () -> untyped
625
+
626
+ def railties_initializers: (untyped current) -> untyped
627
+
628
+ def default_middleware_stack: () -> untyped
629
+
630
+ def validate_secret_key_base: (untyped secret_key_base) -> untyped
631
+
632
+ private
633
+
634
+ def generate_development_secret: () -> untyped
635
+
636
+ def build_request: (untyped env) -> untyped
637
+
638
+ def build_middleware: () -> untyped
639
+
640
+ class NonSymbolAccessDeprecatedHash[T, U] < HashWithIndifferentAccess[T, U]
641
+ # :nodoc:
642
+ def initialize: (?untyped? value) -> untyped
643
+
644
+ def []=: (untyped key, untyped value) -> untyped
645
+
646
+ private
647
+
648
+ def convert_key: (untyped key) -> untyped
649
+
650
+ def convert_value: (untyped value, ?::Hash[untyped, untyped] options) -> untyped
651
+ end
652
+ end
653
+ end
654
+
655
+ class Rails::ApplicationController < ActionController::Base
656
+ private
657
+
658
+ def require_local!: () -> untyped
659
+
660
+ def local_request?: () -> untyped
661
+
662
+ def disable_content_security_policy_nonce!: () -> untyped
663
+ end
664
+
665
+ module Rails
666
+ module Autoloaders
667
+ extend Enumerable[untyped]
668
+
669
+ def self.main: () -> untyped
670
+
671
+ def self.once: () -> untyped
672
+
673
+ def self.each: () { (untyped) -> untyped } -> untyped
674
+
675
+ def self.logger=: (untyped logger) -> untyped
676
+
677
+ def self.log!: () -> untyped
678
+
679
+ def self.zeitwerk_enabled?: () -> untyped
680
+ end
681
+ end
682
+
683
+ module Rails
684
+ class BacktraceCleaner < ActiveSupport::BacktraceCleaner
685
+ APP_DIRS_PATTERN: untyped
686
+
687
+ RENDER_TEMPLATE_PATTERN: untyped
688
+
689
+ EMPTY_STRING: ::String
690
+
691
+ SLASH: ::String
692
+
693
+ DOT_SLASH: ::String
694
+
695
+ def initialize: () -> untyped
696
+ end
697
+ end
698
+
699
+ class CodeStatistics
700
+ # nodoc:
701
+ TEST_TYPES: ::Array[untyped]
702
+
703
+ HEADERS: ::Hash[untyped, untyped]
704
+
705
+ def initialize: (*untyped pairs) -> untyped
706
+
707
+ def to_s: () -> untyped
708
+
709
+ private
710
+
711
+ def calculate_statistics: () -> untyped
712
+
713
+ def calculate_directory_statistics: (untyped directory, ?untyped pattern) -> untyped
714
+
715
+ def calculate_total: () -> untyped
716
+
717
+ def calculate_code: () -> untyped
718
+
719
+ def calculate_tests: () -> untyped
720
+
721
+ def width_for: (untyped label) -> untyped
722
+
723
+ def print_header: () -> untyped
724
+
725
+ def print_splitter: () -> untyped
726
+
727
+ def print_line: (untyped name, untyped statistics) -> untyped
728
+
729
+ def print_code_test_stats: () -> untyped
730
+ end
731
+
732
+ class CodeStatisticsCalculator
733
+ # nodoc:
734
+ attr_reader lines: untyped
735
+
736
+ # nodoc:
737
+ attr_reader code_lines: untyped
738
+
739
+ # nodoc:
740
+ attr_reader classes: untyped
741
+
742
+ # nodoc:
743
+ attr_reader methods: untyped
744
+
745
+ PATTERNS: ::Hash[untyped, untyped]
746
+
747
+ def initialize: (?::Integer lines, ?::Integer code_lines, ?::Integer classes, ?::Integer methods) -> untyped
748
+
749
+ def add: (untyped code_statistics_calculator) -> untyped
750
+
751
+ def add_by_file_path: (untyped file_path) -> untyped
752
+
753
+ def add_by_io: (untyped io, untyped file_type) -> untyped
754
+
755
+ private
756
+
757
+ def file_type: (untyped file_path) -> untyped
758
+ end
759
+
760
+ module Rails
761
+ module Command
762
+ module Actions
763
+ # Change to the application's path if there is no <tt>config.ru</tt> file in current directory.
764
+ # This allows us to run <tt>rails server</tt> from other directories, but still get
765
+ # the main <tt>config.ru</tt> and properly set the <tt>tmp</tt> directory.
766
+ def set_application_directory!: () -> untyped
767
+
768
+ def require_application_and_environment!: () -> untyped
769
+
770
+ def require_application!: () -> untyped
771
+
772
+ def require_environment!: () -> untyped
773
+
774
+ def load_tasks: () -> untyped
775
+
776
+ def load_generators: () -> untyped
777
+ end
778
+ end
779
+ end
780
+
781
+ module Rails
782
+ module Command
783
+ class Base < Thor
784
+ class Error < Thor::Error
785
+ end
786
+
787
+ include Actions
788
+
789
+ def self.exit_on_failure?: () -> false
790
+
791
+ # Returns true when the app is a Rails engine.
792
+ def self.engine?: () -> untyped
793
+
794
+ # Tries to get the description from a USAGE file one folder above the command
795
+ # root.
796
+ def self.desc: (?untyped? usage, ?untyped? description, ?::Hash[untyped, untyped] options) -> untyped
797
+
798
+ # Convenience method to get the namespace from the class name. It's the
799
+ # same as Thor default except that the Command at the end of the class
800
+ # is removed.
801
+ def self.namespace: (?untyped? name) -> untyped
802
+
803
+ # Convenience method to hide this command from the available ones when
804
+ # running rails command.
805
+ def self.hide_command!: () -> untyped
806
+
807
+ def self.inherited: (untyped base) -> untyped
808
+
809
+ def self.perform: (untyped command, untyped args, untyped config) -> untyped
810
+
811
+ def self.printing_commands: () -> untyped
812
+
813
+ def self.executable: () -> ::String
814
+
815
+ # Use Rails' default banner.
816
+ def self.banner: () -> untyped
817
+
818
+ # Sets the base_name taking into account the current class namespace.
819
+ #
820
+ # Rails::Command::TestCommand.base_name # => 'rails'
821
+ def self.base_name: () -> untyped
822
+
823
+ # Return command name without namespaces.
824
+ #
825
+ # Rails::Command::TestCommand.command_name # => 'test'
826
+ def self.command_name: () -> untyped
827
+
828
+ # Path to lookup a USAGE description in a file.
829
+ def self.usage_path: () -> untyped
830
+
831
+ # Default file root to place extra files a command might need, placed
832
+ # one folder above the command file.
833
+ #
834
+ # For a Rails::Command::TestCommand placed in <tt>rails/command/test_command.rb</tt>
835
+ # would return <tt>rails/test</tt>.
836
+ def self.default_command_root: () -> untyped
837
+
838
+ private
839
+
840
+ # Allow the command method to be called perform.
841
+ def self.create_command: (untyped meth) -> untyped
842
+
843
+ def self.command_root_namespace: () -> untyped
844
+
845
+ def self.relative_command_path: () -> untyped
846
+
847
+ def self.namespaced_commands: () -> untyped
848
+
849
+ public
850
+
851
+ def help: () -> untyped
852
+ end
853
+ end
854
+ end
855
+
856
+ module Rails
857
+ module Command
858
+ module Behavior
859
+ # nodoc:
860
+ extend ActiveSupport::Concern
861
+
862
+ module ClassMethods
863
+ # Remove the color from output.
864
+ def no_color!: () -> untyped
865
+
866
+ # Track all command subclasses.
867
+ def subclasses: () -> untyped
868
+
869
+ private
870
+
871
+ # Prints a list of generators.
872
+ def print_list: (untyped base, untyped namespaces) -> (nil | untyped)
873
+
874
+ # Receives namespaces in an array and tries to find matching generators
875
+ # in the load path.
876
+ def lookup: (untyped namespaces) -> (nil | untyped)
877
+
878
+ # This will try to load any command in the load path to show in help.
879
+ def lookup!: () -> untyped
880
+
881
+ # Convert namespaces to paths by replacing ":" for "/" and adding
882
+ # an extra lookup. For example, "rails:model" should be searched
883
+ # in both: "rails/model/model_generator" and "rails/model_generator".
884
+ def namespaces_to_paths: (untyped namespaces) -> untyped
885
+ end
886
+ end
887
+ end
888
+ end
889
+
890
+ module Rails
891
+ module Command
892
+ module EnvironmentArgument
893
+ # nodoc:
894
+ extend ActiveSupport::Concern
895
+
896
+ private
897
+
898
+ def extract_environment_option_from_argument: (?default_environment: untyped default_environment) -> untyped
899
+
900
+ def acceptable_environment: (?untyped? env) -> untyped
901
+
902
+ def available_environments: () -> untyped
903
+ end
904
+ end
905
+ end
906
+
907
+ module Rails
908
+ module Command
909
+ module Helpers
910
+ module Editor
911
+ private
912
+
913
+ def ensure_editor_available: (command: untyped command) -> untyped
914
+
915
+ def catch_editing_exceptions: () { () -> untyped } -> untyped
916
+ end
917
+ end
918
+ end
919
+ end
920
+
921
+ module Rails
922
+ module Command
923
+ module Spellchecker
924
+ def self.suggest: (untyped word, from: untyped from) -> untyped
925
+
926
+ def self.levenshtein_distance: (untyped str1, untyped str2) -> untyped
927
+ end
928
+ end
929
+ end
930
+
931
+ module Rails
932
+ module Command
933
+ extend ActiveSupport::Autoload
934
+
935
+ include Behavior
936
+
937
+ HELP_MAPPINGS: ::Array[untyped]
938
+
939
+ def self.hidden_commands: () -> untyped
940
+
941
+ def self.environment: () -> untyped
942
+
943
+ # Receives a namespace, arguments and the behavior to invoke the command.
944
+ def self.invoke: (untyped full_namespace, ?untyped args, **untyped config) -> untyped
945
+
946
+ def self.find_by_namespace: (untyped namespace, ?untyped? command_name) -> untyped
947
+
948
+ # Returns the root of the Rails engine or app running the command.
949
+ def self.root: () -> untyped
950
+
951
+ def self.print_commands: () -> untyped
952
+
953
+ COMMANDS_IN_USAGE: ::Array[untyped]
954
+
955
+ def self.commands: () -> untyped
956
+
957
+ def self.command_type: () -> untyped
958
+
959
+ def self.lookup_paths: () -> untyped
960
+
961
+ def self.file_lookup_paths: () -> untyped
962
+ end
963
+ end
964
+
965
+ module Rails
966
+ module Generators
967
+ class AppGenerator
968
+ # :nodoc:
969
+ # We want to exit on failure to be kind to other libraries
970
+ # This is only when accessing via CLI
971
+ def self.exit_on_failure?: () -> true
972
+ end
973
+ end
974
+
975
+ module Command
976
+ class ApplicationCommand < Base
977
+ def help: () -> untyped
978
+
979
+ def perform: (*untyped args) -> untyped
980
+ end
981
+ end
982
+ end
983
+
984
+ module Rails
985
+ class Console
986
+ module BacktraceCleaner
987
+ def filter_backtrace: (untyped bt) -> untyped
988
+ end
989
+
990
+ def self.start: (*untyped args) -> untyped
991
+
992
+ attr_reader options: untyped
993
+
994
+ attr_reader app: untyped
995
+
996
+ attr_reader console: untyped
997
+
998
+ def initialize: (untyped app, ?::Hash[untyped, untyped] options) -> untyped
999
+
1000
+ def sandbox?: () -> untyped
1001
+
1002
+ def environment: () -> untyped
1003
+
1004
+ alias environment? environment
1005
+
1006
+ def set_environment!: () -> untyped
1007
+
1008
+ def start: () -> untyped
1009
+ end
1010
+
1011
+ module Command
1012
+ class ConsoleCommand < Base
1013
+ # :nodoc:
1014
+ include EnvironmentArgument
1015
+
1016
+ def initialize: (?untyped args, ?::Hash[untyped, untyped] local_options, ?::Hash[untyped, untyped] config) -> untyped
1017
+
1018
+ def perform: () -> untyped
1019
+ end
1020
+ end
1021
+ end
1022
+
1023
+ module Rails
1024
+ module Command
1025
+ class CredentialsCommand < Rails::Command::Base
1026
+ # :nodoc:
1027
+ include Helpers::Editor
1028
+
1029
+ include EnvironmentArgument
1030
+
1031
+ def help: () -> untyped
1032
+
1033
+ def edit: () -> untyped
1034
+
1035
+ def show: () -> untyped
1036
+
1037
+ private
1038
+
1039
+ def credentials: () -> untyped
1040
+
1041
+ def ensure_encryption_key_has_been_added: () -> untyped
1042
+
1043
+ def ensure_credentials_have_been_added: () -> untyped
1044
+
1045
+ def change_credentials_in_system_editor: () -> untyped
1046
+
1047
+ def missing_credentials_message: () -> untyped
1048
+
1049
+ def content_path: () -> untyped
1050
+
1051
+ def key_path: () -> untyped
1052
+
1053
+ def encryption_key_file_generator: () -> Rails::Generators::EncryptionKeyFileGenerator
1054
+
1055
+ def encrypted_file_generator: () -> Rails::Generators::EncryptedFileGenerator
1056
+
1057
+ def credentials_generator: () -> Rails::Generators::CredentialsGenerator
1058
+ end
1059
+ end
1060
+ end
1061
+
1062
+ module Rails
1063
+ module Command
1064
+ module Db
1065
+ module System
1066
+ class ChangeCommand < Base
1067
+ def perform: () -> untyped
1068
+ end
1069
+ end
1070
+ end
1071
+ end
1072
+ end
1073
+
1074
+ module Rails
1075
+ class DBConsole
1076
+ def self.start: (*untyped args) -> untyped
1077
+
1078
+ def initialize: (?::Hash[untyped, untyped] options) -> untyped
1079
+
1080
+ def start: () -> untyped
1081
+
1082
+ def config: () -> untyped
1083
+
1084
+ def environment: () -> untyped
1085
+
1086
+ def database: () -> untyped
1087
+
1088
+ private
1089
+
1090
+ def configurations: () -> untyped
1091
+
1092
+ def find_cmd_and_exec: (untyped commands, *untyped args) -> untyped
1093
+ end
1094
+
1095
+ module Command
1096
+ class DbconsoleCommand < Base
1097
+ # :nodoc:
1098
+ include EnvironmentArgument
1099
+
1100
+ def perform: () -> untyped
1101
+ end
1102
+ end
1103
+ end
1104
+
1105
+ module Rails
1106
+ module Command
1107
+ class DestroyCommand < Base
1108
+ def help: () -> untyped
1109
+
1110
+ def perform: () -> untyped
1111
+ end
1112
+ end
1113
+ end
1114
+
1115
+ module Rails
1116
+ module Command
1117
+ class DevCommand < Base
1118
+ def help: () -> untyped
1119
+
1120
+ def cache: () -> untyped
1121
+ end
1122
+ end
1123
+ end
1124
+
1125
+ module Rails
1126
+ module Command
1127
+ class EncryptedCommand < Rails::Command::Base
1128
+ # :nodoc:
1129
+ include Helpers::Editor
1130
+
1131
+ def help: () -> untyped
1132
+
1133
+ def edit: (untyped file_path) -> untyped
1134
+
1135
+ def show: (untyped file_path) -> untyped
1136
+
1137
+ private
1138
+
1139
+ def ensure_encryption_key_has_been_added: (untyped key_path) -> untyped
1140
+
1141
+ def ensure_encrypted_file_has_been_added: (untyped file_path, untyped key_path) -> untyped
1142
+
1143
+ def change_encrypted_file_in_system_editor: (untyped file_path, untyped key_path) -> untyped
1144
+
1145
+ def encryption_key_file_generator: () -> Rails::Generators::EncryptionKeyFileGenerator
1146
+
1147
+ def encrypted_file_generator: () -> Rails::Generators::EncryptedFileGenerator
1148
+
1149
+ def missing_encrypted_message: (file_path: untyped file_path, key_path: untyped key_path, key: untyped key) -> untyped
1150
+ end
1151
+ end
1152
+ end
1153
+
1154
+ module Rails
1155
+ module Command
1156
+ class GenerateCommand < Base
1157
+ def help: () -> untyped
1158
+
1159
+ def perform: () -> untyped
1160
+ end
1161
+ end
1162
+ end
1163
+
1164
+ module Rails
1165
+ module Command
1166
+ class HelpCommand < Base
1167
+ def help: () -> untyped
1168
+ end
1169
+ end
1170
+ end
1171
+
1172
+ module Rails
1173
+ module Command
1174
+ class InitializersCommand < Base
1175
+ # :nodoc:
1176
+ include EnvironmentArgument
1177
+
1178
+ def perform: () -> untyped
1179
+ end
1180
+ end
1181
+ end
1182
+
1183
+ module Rails
1184
+ module Command
1185
+ class NewCommand < Base
1186
+ def help: () -> untyped
1187
+
1188
+ def perform: () -> untyped
1189
+ end
1190
+ end
1191
+ end
1192
+
1193
+ module Rails
1194
+ module Command
1195
+ class NotesCommand < Base
1196
+ def perform: () -> untyped
1197
+
1198
+ private
1199
+
1200
+ def display_annotations: () -> untyped
1201
+
1202
+ def directories: () -> untyped
1203
+
1204
+ def deprecation_warning: () -> (nil | untyped)
1205
+
1206
+ def source_annotation_directories: () -> untyped
1207
+ end
1208
+ end
1209
+ end
1210
+
1211
+ module Rails
1212
+ module Command
1213
+ class PluginCommand < Base
1214
+ def help: () -> untyped
1215
+
1216
+ def self.banner: () -> ::String
1217
+
1218
+ def perform: (?untyped? `type`, *untyped plugin_args) -> untyped
1219
+
1220
+ private
1221
+
1222
+ def run_plugin_generator: (untyped plugin_args) -> untyped
1223
+ end
1224
+ end
1225
+ end
1226
+
1227
+ module Rails
1228
+ module Command
1229
+ class RakeCommand < Base
1230
+ # :nodoc:
1231
+ extend Rails::Command::Actions
1232
+
1233
+ def self.printing_commands: () -> untyped
1234
+
1235
+ def self.perform: (untyped task) -> untyped
1236
+
1237
+ def self.rake_tasks: () -> untyped
1238
+
1239
+ def self.formatted_rake_tasks: () -> untyped
1240
+
1241
+ def self.require_rake: () -> untyped
1242
+ end
1243
+ end
1244
+ end
1245
+
1246
+ module Rails
1247
+ module Command
1248
+ class RoutesCommand < Base
1249
+ def perform: () -> untyped
1250
+
1251
+ private
1252
+
1253
+ def inspector: () -> ActionDispatch::Routing::RoutesInspector
1254
+
1255
+ def formatter: () -> untyped
1256
+
1257
+ def routes_filter: () -> untyped
1258
+ end
1259
+ end
1260
+ end
1261
+
1262
+ module Rails
1263
+ module Command
1264
+ class RunnerCommand < Base
1265
+ # :nodoc:
1266
+ include EnvironmentArgument
1267
+
1268
+ def help: () -> untyped
1269
+
1270
+ def self.banner: () -> ::String
1271
+
1272
+ def perform: (?untyped? code_or_file, *untyped command_argv) -> untyped
1273
+ end
1274
+ end
1275
+ end
1276
+
1277
+ module Rails
1278
+ module Command
1279
+ class SecretsCommand < Rails::Command::Base
1280
+ def help: () -> untyped
1281
+
1282
+ def setup: () -> untyped
1283
+
1284
+ def edit: () -> untyped
1285
+
1286
+ def show: () -> untyped
1287
+
1288
+ private
1289
+
1290
+ def deprecate_in_favor_of_credentials_and_exit: () -> untyped
1291
+ end
1292
+ end
1293
+ end
1294
+
1295
+ module Rails
1296
+ class Server < ::Rack::Server
1297
+ class Options
1298
+ def parse!: (untyped args) -> untyped
1299
+ end
1300
+
1301
+ def initialize: (?untyped? options) -> untyped
1302
+
1303
+ def opt_parser: () -> Options
1304
+
1305
+ def set_environment: () -> untyped
1306
+
1307
+ def start: (?untyped? after_stop_callback) -> untyped
1308
+
1309
+ def serveable?: () -> untyped
1310
+
1311
+ def middleware: () -> Hash[untyped, untyped]
1312
+
1313
+ def default_options: () -> untyped
1314
+
1315
+ def served_url: () -> untyped
1316
+
1317
+ private
1318
+
1319
+ def setup_dev_caching: () -> untyped
1320
+
1321
+ def create_tmp_directories: () -> untyped
1322
+
1323
+ def log_to_stdout: () -> untyped
1324
+
1325
+ def use_puma?: () -> untyped
1326
+ end
1327
+
1328
+ module Command
1329
+ class ServerCommand < Base
1330
+ # :nodoc:
1331
+ include EnvironmentArgument
1332
+
1333
+ # Hard-coding a bunch of handlers here as we don't have a public way of
1334
+ # querying them from the Rack::Handler registry.
1335
+ RACK_SERVERS: ::Array[untyped]
1336
+
1337
+ DEFAULT_PORT: ::Integer
1338
+
1339
+ DEFAULT_PID_PATH: ::String
1340
+
1341
+ def initialize: (untyped args, untyped local_options) -> untyped
1342
+
1343
+ def perform: () -> untyped
1344
+
1345
+ def server_options: () -> { user_supplied_options: untyped, server: untyped, :log_stdout => untyped, Port: untyped, Host: untyped, DoNotReverseLookup: true, config: untyped, environment: untyped, daemonize: untyped, pid: untyped, caching: untyped, restart_cmd: untyped, early_hints: untyped }
1346
+
1347
+ private
1348
+
1349
+ def user_supplied_options: () -> untyped
1350
+
1351
+ def port: () -> untyped
1352
+
1353
+ def host: () -> untyped
1354
+
1355
+ def environment: () -> untyped
1356
+
1357
+ def restart_command: () -> ::String
1358
+
1359
+ def early_hints: () -> untyped
1360
+
1361
+ def log_to_stdout?: () -> untyped
1362
+
1363
+ def pid: () -> untyped
1364
+
1365
+ def self.banner: () -> "rails server -u [thin/puma/webrick] [options]"
1366
+
1367
+ def prepare_restart: () -> untyped
1368
+
1369
+ def deprecate_positional_rack_server_and_rewrite_to_option: (untyped original_options) -> untyped
1370
+
1371
+ def rack_server_suggestion: (untyped server) -> untyped
1372
+
1373
+ def print_boot_information: (untyped server, untyped url) -> untyped
1374
+ end
1375
+ end
1376
+ end
1377
+
1378
+ module Rails
1379
+ module Command
1380
+ class TestCommand < Base
1381
+ def help: () -> untyped
1382
+
1383
+ def perform: () -> untyped
1384
+ end
1385
+ end
1386
+ end
1387
+
1388
+ module Rails
1389
+ module Command
1390
+ class VersionCommand < Base
1391
+ # :nodoc:
1392
+ def perform: () -> untyped
1393
+ end
1394
+ end
1395
+ end
1396
+
1397
+ module Rails
1398
+ module Configuration
1399
+ # MiddlewareStackProxy is a proxy for the Rails middleware stack that allows
1400
+ # you to configure middlewares in your application. It works basically as a
1401
+ # command recorder, saving each command to be applied after initialization
1402
+ # over the default middleware stack, so you can add, swap, or remove any
1403
+ # middleware in Rails.
1404
+ #
1405
+ # You can add your own middlewares by using the +config.middleware.use+ method:
1406
+ #
1407
+ # config.middleware.use Magical::Unicorns
1408
+ #
1409
+ # This will put the <tt>Magical::Unicorns</tt> middleware on the end of the stack.
1410
+ # You can use +insert_before+ if you wish to add a middleware before another:
1411
+ #
1412
+ # config.middleware.insert_before Rack::Head, Magical::Unicorns
1413
+ #
1414
+ # There's also +insert_after+ which will insert a middleware after another:
1415
+ #
1416
+ # config.middleware.insert_after Rack::Head, Magical::Unicorns
1417
+ #
1418
+ # Middlewares can also be completely swapped out and replaced with others:
1419
+ #
1420
+ # config.middleware.swap ActionDispatch::Flash, Magical::Unicorns
1421
+ #
1422
+ # And finally they can also be removed from the stack completely:
1423
+ #
1424
+ # config.middleware.delete ActionDispatch::Flash
1425
+ #
1426
+ class MiddlewareStackProxy
1427
+ def initialize: (?untyped operations, ?untyped delete_operations) -> untyped
1428
+
1429
+ def merge_into: (untyped other) -> untyped
1430
+
1431
+ def +: (untyped other) -> MiddlewareStackProxy
1432
+
1433
+ attr_reader operations: untyped
1434
+
1435
+ attr_reader delete_operations: untyped
1436
+ end
1437
+
1438
+ class Generators
1439
+ # nodoc:
1440
+ attr_accessor aliases: untyped
1441
+
1442
+ # nodoc:
1443
+ attr_accessor options: untyped
1444
+
1445
+ # nodoc:
1446
+ attr_accessor templates: untyped
1447
+
1448
+ # nodoc:
1449
+ attr_accessor fallbacks: untyped
1450
+
1451
+ # nodoc:
1452
+ attr_accessor colorize_logging: untyped
1453
+
1454
+ # nodoc:
1455
+ attr_accessor api_only: untyped
1456
+
1457
+ attr_reader hidden_namespaces: untyped
1458
+
1459
+ def initialize: () -> untyped
1460
+
1461
+ def initialize_copy: (untyped source) -> untyped
1462
+
1463
+ def hide_namespace: (untyped namespace) -> untyped
1464
+
1465
+ def method_missing: (untyped method, *untyped args) -> untyped
1466
+ end
1467
+ end
1468
+ end
1469
+
1470
+ module Rails
1471
+ module ConsoleMethods
1472
+ # reference the global "app" instance, created on demand. To recreate the
1473
+ # instance, pass a non-false value as the parameter.
1474
+ def app: (?bool create) -> untyped
1475
+
1476
+ # create a new session. If a block is given, the new session will be yielded
1477
+ # to the block before being returned.
1478
+ def new_session: () { (untyped) -> untyped } -> untyped
1479
+
1480
+ # reloads the environment
1481
+ def reload!: (?bool print) -> true
1482
+ end
1483
+ end
1484
+
1485
+ module Rails
1486
+ module ConsoleMethods
1487
+ # Gets the helper methods available to the controller.
1488
+ #
1489
+ # This method assumes an +ApplicationController+ exists, and it extends +ActionController::Base+
1490
+ def helper: () -> untyped
1491
+
1492
+ # Gets a new instance of a controller object.
1493
+ #
1494
+ # This method assumes an +ApplicationController+ exists, and it extends +ActionController::Base+
1495
+ def controller: () -> untyped
1496
+ end
1497
+ end
1498
+
1499
+ module Rails
1500
+ module DevCaching
1501
+ FILE: ::String
1502
+
1503
+ def self.enable_by_file: () -> untyped
1504
+
1505
+ def self.enable_by_argument: (untyped caching) -> untyped
1506
+
1507
+ def self.create_cache_file: () -> untyped
1508
+
1509
+ def self.delete_cache_file: () -> untyped
1510
+ end
1511
+ end
1512
+
1513
+ APP_PATH: untyped
1514
+
1515
+ module Rails
1516
+ class Engine
1517
+ class Configuration < ::Rails::Railtie::Configuration
1518
+ attr_reader root: untyped
1519
+
1520
+ attr_accessor middleware: untyped
1521
+
1522
+ attr_accessor javascript_path: untyped
1523
+
1524
+ attr_writer eager_load_paths: untyped
1525
+
1526
+ attr_writer autoload_once_paths: untyped
1527
+
1528
+ attr_writer autoload_paths: untyped
1529
+
1530
+ def initialize: (?untyped? root) -> untyped
1531
+
1532
+ # Holds generators configuration:
1533
+ #
1534
+ # config.generators do |g|
1535
+ # g.orm :data_mapper, migration: true
1536
+ # g.template_engine :haml
1537
+ # g.test_framework :rspec
1538
+ # end
1539
+ #
1540
+ # If you want to disable color in console, do:
1541
+ #
1542
+ # config.generators.colorize_logging = false
1543
+ #
1544
+ def generators: () { (untyped) -> untyped } -> untyped
1545
+
1546
+ def paths: () -> untyped
1547
+
1548
+ def root=: (untyped value) -> untyped
1549
+
1550
+ def eager_load_paths: () -> untyped
1551
+
1552
+ def autoload_once_paths: () -> untyped
1553
+
1554
+ def autoload_paths: () -> untyped
1555
+ end
1556
+ end
1557
+ end
1558
+
1559
+ module Rails
1560
+ class Engine < Railtie
1561
+ class Railties
1562
+ include Enumerable[untyped]
1563
+
1564
+ attr_reader _all: untyped
1565
+
1566
+ def initialize: () -> untyped
1567
+
1568
+ def each: (*untyped args) { (untyped) -> untyped } -> untyped
1569
+
1570
+ def -: (untyped others) -> untyped
1571
+ end
1572
+ end
1573
+ end
1574
+
1575
+ module Rails
1576
+ class Engine
1577
+ class Updater
1578
+ def self.generator: () -> untyped
1579
+
1580
+ def self.run: (untyped action) -> untyped
1581
+ end
1582
+ end
1583
+ end
1584
+
1585
+ module Rails
1586
+ # <tt>Rails::Engine</tt> allows you to wrap a specific Rails application or subset of
1587
+ # functionality and share it with other applications or within a larger packaged application.
1588
+ # Every <tt>Rails::Application</tt> is just an engine, which allows for simple
1589
+ # feature and application sharing.
1590
+ #
1591
+ # Any <tt>Rails::Engine</tt> is also a <tt>Rails::Railtie</tt>, so the same
1592
+ # methods (like <tt>rake_tasks</tt> and +generators+) and configuration
1593
+ # options that are available in railties can also be used in engines.
1594
+ #
1595
+ # == Creating an Engine
1596
+ #
1597
+ # If you want a gem to behave as an engine, you have to specify an +Engine+
1598
+ # for it somewhere inside your plugin's +lib+ folder (similar to how we
1599
+ # specify a +Railtie+):
1600
+ #
1601
+ # # lib/my_engine.rb
1602
+ # module MyEngine
1603
+ # class Engine < Rails::Engine
1604
+ # end
1605
+ # end
1606
+ #
1607
+ # Then ensure that this file is loaded at the top of your <tt>config/application.rb</tt>
1608
+ # (or in your +Gemfile+) and it will automatically load models, controllers and helpers
1609
+ # inside +app+, load routes at <tt>config/routes.rb</tt>, load locales at
1610
+ # <tt>config/locales/*</tt>, and load tasks at <tt>lib/tasks/*</tt>.
1611
+ #
1612
+ # == Configuration
1613
+ #
1614
+ # Besides the +Railtie+ configuration which is shared across the application, in a
1615
+ # <tt>Rails::Engine</tt> you can access <tt>autoload_paths</tt>, <tt>eager_load_paths</tt>
1616
+ # and <tt>autoload_once_paths</tt>, which, differently from a <tt>Railtie</tt>, are scoped to
1617
+ # the current engine.
1618
+ #
1619
+ # class MyEngine < Rails::Engine
1620
+ # # Add a load path for this specific Engine
1621
+ # config.autoload_paths << File.expand_path("lib/some/path", __dir__)
1622
+ #
1623
+ # initializer "my_engine.add_middleware" do |app|
1624
+ # app.middleware.use MyEngine::Middleware
1625
+ # end
1626
+ # end
1627
+ #
1628
+ # == Generators
1629
+ #
1630
+ # You can set up generators for engines with <tt>config.generators</tt> method:
1631
+ #
1632
+ # class MyEngine < Rails::Engine
1633
+ # config.generators do |g|
1634
+ # g.orm :active_record
1635
+ # g.template_engine :erb
1636
+ # g.test_framework :test_unit
1637
+ # end
1638
+ # end
1639
+ #
1640
+ # You can also set generators for an application by using <tt>config.app_generators</tt>:
1641
+ #
1642
+ # class MyEngine < Rails::Engine
1643
+ # # note that you can also pass block to app_generators in the same way you
1644
+ # # can pass it to generators method
1645
+ # config.app_generators.orm :datamapper
1646
+ # end
1647
+ #
1648
+ # == Paths
1649
+ #
1650
+ # Applications and engines have flexible path configuration, meaning that you
1651
+ # are not required to place your controllers at <tt>app/controllers</tt>, but
1652
+ # in any place which you find convenient.
1653
+ #
1654
+ # For example, let's suppose you want to place your controllers in <tt>lib/controllers</tt>.
1655
+ # You can set that as an option:
1656
+ #
1657
+ # class MyEngine < Rails::Engine
1658
+ # paths["app/controllers"] = "lib/controllers"
1659
+ # end
1660
+ #
1661
+ # You can also have your controllers loaded from both <tt>app/controllers</tt> and
1662
+ # <tt>lib/controllers</tt>:
1663
+ #
1664
+ # class MyEngine < Rails::Engine
1665
+ # paths["app/controllers"] << "lib/controllers"
1666
+ # end
1667
+ #
1668
+ # The available paths in an engine are:
1669
+ #
1670
+ # class MyEngine < Rails::Engine
1671
+ # paths["app"] # => ["app"]
1672
+ # paths["app/controllers"] # => ["app/controllers"]
1673
+ # paths["app/helpers"] # => ["app/helpers"]
1674
+ # paths["app/models"] # => ["app/models"]
1675
+ # paths["app/views"] # => ["app/views"]
1676
+ # paths["lib"] # => ["lib"]
1677
+ # paths["lib/tasks"] # => ["lib/tasks"]
1678
+ # paths["config"] # => ["config"]
1679
+ # paths["config/initializers"] # => ["config/initializers"]
1680
+ # paths["config/locales"] # => ["config/locales"]
1681
+ # paths["config/routes.rb"] # => ["config/routes.rb"]
1682
+ # end
1683
+ #
1684
+ # The <tt>Application</tt> class adds a couple more paths to this set. And as in your
1685
+ # <tt>Application</tt>, all folders under +app+ are automatically added to the load path.
1686
+ # If you have an <tt>app/services</tt> folder for example, it will be added by default.
1687
+ #
1688
+ # == Endpoint
1689
+ #
1690
+ # An engine can also be a Rack application. It can be useful if you have a Rack application that
1691
+ # you would like to wrap with +Engine+ and provide with some of the +Engine+'s features.
1692
+ #
1693
+ # To do that, use the +endpoint+ method:
1694
+ #
1695
+ # module MyEngine
1696
+ # class Engine < Rails::Engine
1697
+ # endpoint MyRackApplication
1698
+ # end
1699
+ # end
1700
+ #
1701
+ # Now you can mount your engine in application's routes just like that:
1702
+ #
1703
+ # Rails.application.routes.draw do
1704
+ # mount MyEngine::Engine => "/engine"
1705
+ # end
1706
+ #
1707
+ # == Middleware stack
1708
+ #
1709
+ # As an engine can now be a Rack endpoint, it can also have a middleware
1710
+ # stack. The usage is exactly the same as in <tt>Application</tt>:
1711
+ #
1712
+ # module MyEngine
1713
+ # class Engine < Rails::Engine
1714
+ # middleware.use SomeMiddleware
1715
+ # end
1716
+ # end
1717
+ #
1718
+ # == Routes
1719
+ #
1720
+ # If you don't specify an endpoint, routes will be used as the default
1721
+ # endpoint. You can use them just like you use an application's routes:
1722
+ #
1723
+ # # ENGINE/config/routes.rb
1724
+ # MyEngine::Engine.routes.draw do
1725
+ # get "/" => "posts#index"
1726
+ # end
1727
+ #
1728
+ # == Mount priority
1729
+ #
1730
+ # Note that now there can be more than one router in your application, and it's better to avoid
1731
+ # passing requests through many routers. Consider this situation:
1732
+ #
1733
+ # Rails.application.routes.draw do
1734
+ # mount MyEngine::Engine => "/blog"
1735
+ # get "/blog/omg" => "main#omg"
1736
+ # end
1737
+ #
1738
+ # +MyEngine+ is mounted at <tt>/blog</tt>, and <tt>/blog/omg</tt> points to application's
1739
+ # controller. In such a situation, requests to <tt>/blog/omg</tt> will go through +MyEngine+,
1740
+ # and if there is no such route in +Engine+'s routes, it will be dispatched to <tt>main#omg</tt>.
1741
+ # It's much better to swap that:
1742
+ #
1743
+ # Rails.application.routes.draw do
1744
+ # get "/blog/omg" => "main#omg"
1745
+ # mount MyEngine::Engine => "/blog"
1746
+ # end
1747
+ #
1748
+ # Now, +Engine+ will get only requests that were not handled by +Application+.
1749
+ #
1750
+ # == Engine name
1751
+ #
1752
+ # There are some places where an Engine's name is used:
1753
+ #
1754
+ # * routes: when you mount an Engine with <tt>mount(MyEngine::Engine => '/my_engine')</tt>,
1755
+ # it's used as default <tt>:as</tt> option
1756
+ # * rake task for installing migrations <tt>my_engine:install:migrations</tt>
1757
+ #
1758
+ # Engine name is set by default based on class name. For <tt>MyEngine::Engine</tt> it will be
1759
+ # <tt>my_engine_engine</tt>. You can change it manually using the <tt>engine_name</tt> method:
1760
+ #
1761
+ # module MyEngine
1762
+ # class Engine < Rails::Engine
1763
+ # engine_name "my_engine"
1764
+ # end
1765
+ # end
1766
+ #
1767
+ # == Isolated Engine
1768
+ #
1769
+ # Normally when you create controllers, helpers and models inside an engine, they are treated
1770
+ # as if they were created inside the application itself. This means that all helpers and
1771
+ # named routes from the application will be available to your engine's controllers as well.
1772
+ #
1773
+ # However, sometimes you want to isolate your engine from the application, especially if your engine
1774
+ # has its own router. To do that, you simply need to call +isolate_namespace+. This method requires
1775
+ # you to pass a module where all your controllers, helpers and models should be nested to:
1776
+ #
1777
+ # module MyEngine
1778
+ # class Engine < Rails::Engine
1779
+ # isolate_namespace MyEngine
1780
+ # end
1781
+ # end
1782
+ #
1783
+ # With such an engine, everything that is inside the +MyEngine+ module will be isolated from
1784
+ # the application.
1785
+ #
1786
+ # Consider this controller:
1787
+ #
1788
+ # module MyEngine
1789
+ # class FooController < ActionController::Base
1790
+ # end
1791
+ # end
1792
+ #
1793
+ # If the +MyEngine+ engine is marked as isolated, +FooController+ only has
1794
+ # access to helpers from +MyEngine+, and <tt>url_helpers</tt> from
1795
+ # <tt>MyEngine::Engine.routes</tt>.
1796
+ #
1797
+ # The next thing that changes in isolated engines is the behavior of routes.
1798
+ # Normally, when you namespace your controllers, you also need to namespace
1799
+ # the related routes. With an isolated engine, the engine's namespace is
1800
+ # automatically applied, so you don't need to specify it explicitly in your
1801
+ # routes:
1802
+ #
1803
+ # MyEngine::Engine.routes.draw do
1804
+ # resources :articles
1805
+ # end
1806
+ #
1807
+ # If +MyEngine+ is isolated, The routes above will point to
1808
+ # <tt>MyEngine::ArticlesController</tt>. You also don't need to use longer
1809
+ # URL helpers like +my_engine_articles_path+. Instead, you should simply use
1810
+ # +articles_path+, like you would do with your main application.
1811
+ #
1812
+ # To make this behavior consistent with other parts of the framework,
1813
+ # isolated engines also have an effect on <tt>ActiveModel::Naming</tt>. In a
1814
+ # normal Rails app, when you use a namespaced model such as
1815
+ # <tt>Namespace::Article</tt>, <tt>ActiveModel::Naming</tt> will generate
1816
+ # names with the prefix "namespace". In an isolated engine, the prefix will
1817
+ # be omitted in URL helpers and form fields, for convenience.
1818
+ #
1819
+ # polymorphic_url(MyEngine::Article.new)
1820
+ # # => "articles_path" # not "my_engine_articles_path"
1821
+ #
1822
+ # form_for(MyEngine::Article.new) do
1823
+ # text_field :title # => <input type="text" name="article[title]" id="article_title" />
1824
+ # end
1825
+ #
1826
+ # Additionally, an isolated engine will set its own name according to its
1827
+ # namespace, so <tt>MyEngine::Engine.engine_name</tt> will return
1828
+ # "my_engine". It will also set +MyEngine.table_name_prefix+ to "my_engine_",
1829
+ # meaning for example that <tt>MyEngine::Article</tt> will use the
1830
+ # +my_engine_articles+ database table by default.
1831
+ #
1832
+ # == Using Engine's routes outside Engine
1833
+ #
1834
+ # Since you can now mount an engine inside application's routes, you do not have direct access to +Engine+'s
1835
+ # <tt>url_helpers</tt> inside +Application+. When you mount an engine in an application's routes, a special helper is
1836
+ # created to allow you to do that. Consider such a scenario:
1837
+ #
1838
+ # # config/routes.rb
1839
+ # Rails.application.routes.draw do
1840
+ # mount MyEngine::Engine => "/my_engine", as: "my_engine"
1841
+ # get "/foo" => "foo#index"
1842
+ # end
1843
+ #
1844
+ # Now, you can use the <tt>my_engine</tt> helper inside your application:
1845
+ #
1846
+ # class FooController < ApplicationController
1847
+ # def index
1848
+ # my_engine.root_url # => /my_engine/
1849
+ # end
1850
+ # end
1851
+ #
1852
+ # There is also a <tt>main_app</tt> helper that gives you access to application's routes inside Engine:
1853
+ #
1854
+ # module MyEngine
1855
+ # class BarController
1856
+ # def index
1857
+ # main_app.foo_path # => /foo
1858
+ # end
1859
+ # end
1860
+ # end
1861
+ #
1862
+ # Note that the <tt>:as</tt> option given to mount takes the <tt>engine_name</tt> as default, so most of the time
1863
+ # you can simply omit it.
1864
+ #
1865
+ # Finally, if you want to generate a URL to an engine's route using
1866
+ # <tt>polymorphic_url</tt>, you also need to pass the engine helper. Let's
1867
+ # say that you want to create a form pointing to one of the engine's routes.
1868
+ # All you need to do is pass the helper as the first element in array with
1869
+ # attributes for URL:
1870
+ #
1871
+ # form_for([my_engine, @user])
1872
+ #
1873
+ # This code will use <tt>my_engine.user_path(@user)</tt> to generate the proper route.
1874
+ #
1875
+ # == Isolated engine's helpers
1876
+ #
1877
+ # Sometimes you may want to isolate engine, but use helpers that are defined for it.
1878
+ # If you want to share just a few specific helpers you can add them to application's
1879
+ # helpers in ApplicationController:
1880
+ #
1881
+ # class ApplicationController < ActionController::Base
1882
+ # helper MyEngine::SharedEngineHelper
1883
+ # end
1884
+ #
1885
+ # If you want to include all of the engine's helpers, you can use the #helper method on an engine's
1886
+ # instance:
1887
+ #
1888
+ # class ApplicationController < ActionController::Base
1889
+ # helper MyEngine::Engine.helpers
1890
+ # end
1891
+ #
1892
+ # It will include all of the helpers from engine's directory. Take into account that this does
1893
+ # not include helpers defined in controllers with helper_method or other similar solutions,
1894
+ # only helpers defined in the helpers directory will be included.
1895
+ #
1896
+ # == Migrations & seed data
1897
+ #
1898
+ # Engines can have their own migrations. The default path for migrations is exactly the same
1899
+ # as in application: <tt>db/migrate</tt>
1900
+ #
1901
+ # To use engine's migrations in application you can use the rake task below, which copies them to
1902
+ # application's dir:
1903
+ #
1904
+ # rake ENGINE_NAME:install:migrations
1905
+ #
1906
+ # Note that some of the migrations may be skipped if a migration with the same name already exists
1907
+ # in application. In such a situation you must decide whether to leave that migration or rename the
1908
+ # migration in the application and rerun copying migrations.
1909
+ #
1910
+ # If your engine has migrations, you may also want to prepare data for the database in
1911
+ # the <tt>db/seeds.rb</tt> file. You can load that data using the <tt>load_seed</tt> method, e.g.
1912
+ #
1913
+ # MyEngine::Engine.load_seed
1914
+ #
1915
+ # == Loading priority
1916
+ #
1917
+ # In order to change engine's priority you can use +config.railties_order+ in the main application.
1918
+ # It will affect the priority of loading views, helpers, assets, and all the other files
1919
+ # related to engine or application.
1920
+ #
1921
+ # # load Blog::Engine with highest priority, followed by application and other railties
1922
+ # config.railties_order = [Blog::Engine, :main_app, :all]
1923
+ class Engine < Railtie
1924
+ attr_accessor self.called_from: untyped
1925
+
1926
+ attr_accessor self.isolated: untyped
1927
+
1928
+ alias self.isolated? self.isolated
1929
+
1930
+ alias self.engine_name self.railtie_name
1931
+
1932
+ def self.inherited: (untyped base) -> untyped
1933
+
1934
+ def self.find_root: (untyped from) -> untyped
1935
+
1936
+ def self.endpoint: (?untyped? endpoint) -> untyped
1937
+
1938
+ def self.isolate_namespace: (untyped mod) -> untyped
1939
+
1940
+ # Finds engine with given path.
1941
+ def self.find: (untyped path) -> (untyped | nil)
1942
+
1943
+ def initialize: () -> untyped
1944
+
1945
+ # Load console and invoke the registered hooks.
1946
+ # Check <tt>Rails::Railtie.console</tt> for more info.
1947
+ def load_console: (?untyped app) -> untyped
1948
+
1949
+ # Load Rails runner and invoke the registered hooks.
1950
+ # Check <tt>Rails::Railtie.runner</tt> for more info.
1951
+ def load_runner: (?untyped app) -> untyped
1952
+
1953
+ # Load Rake, railties tasks and invoke the registered hooks.
1954
+ # Check <tt>Rails::Railtie.rake_tasks</tt> for more info.
1955
+ def load_tasks: (?untyped app) -> untyped
1956
+
1957
+ # Load Rails generators and invoke the registered hooks.
1958
+ # Check <tt>Rails::Railtie.generators</tt> for more info.
1959
+ def load_generators: (?untyped app) -> untyped
1960
+
1961
+ def eager_load!: () -> (nil | untyped)
1962
+
1963
+ def railties: () -> untyped
1964
+
1965
+ # Returns a module with all the helpers defined for the engine.
1966
+ def helpers: () -> untyped
1967
+
1968
+ # Returns all registered helpers paths.
1969
+ def helpers_paths: () -> untyped
1970
+
1971
+ # Returns the underlying Rack application for this engine.
1972
+ def app: () -> untyped
1973
+
1974
+ # Returns the endpoint for this engine. If none is registered,
1975
+ # defaults to an ActionDispatch::Routing::RouteSet.
1976
+ def endpoint: () -> untyped
1977
+
1978
+ # Define the Rack API for this engine.
1979
+ def call: (untyped env) -> untyped
1980
+
1981
+ # Defines additional Rack env configuration that is added on each call.
1982
+ def env_config: () -> untyped
1983
+
1984
+ # Define the configuration object for the engine.
1985
+ def config: () -> untyped
1986
+
1987
+ # Load data from db/seeds.rb file. It can be used in to load engines'
1988
+ # seeds, e.g.:
1989
+ #
1990
+ # Blog::Engine.load_seed
1991
+ def load_seed: () -> (nil | untyped)
1992
+
1993
+ def routes?: () -> untyped
1994
+
1995
+ def run_tasks_blocks: () -> untyped
1996
+
1997
+ private
1998
+
1999
+ def load_config_initializer: (untyped initializer) -> untyped
2000
+
2001
+ def with_inline_jobs: () { () -> untyped } -> untyped
2002
+
2003
+ def has_migrations?: () -> untyped
2004
+
2005
+ def self.find_root_with_flag: (untyped flag, untyped root_path, ?untyped? default) -> Pathname
2006
+
2007
+ def default_middleware_stack: () -> ActionDispatch::MiddlewareStack
2008
+
2009
+ def _all_autoload_once_paths: () -> untyped
2010
+
2011
+ def _all_autoload_paths: () -> untyped
2012
+
2013
+ def _all_load_paths: (untyped add_autoload_paths_to_load_path) -> untyped
2014
+
2015
+ def build_request: (untyped env) -> untyped
2016
+
2017
+ def build_middleware: () -> untyped
2018
+ end
2019
+ end
2020
+
2021
+ module Rails
2022
+ # Returns the version of the currently loaded Rails as a <tt>Gem::Version</tt>
2023
+ def self.gem_version: () -> Gem::Version
2024
+
2025
+ module VERSION
2026
+ MAJOR: ::Integer
2027
+
2028
+ MINOR: ::Integer
2029
+
2030
+ TINY: ::Integer
2031
+
2032
+ PRE: ::String
2033
+
2034
+ STRING: untyped
2035
+ end
2036
+ end
2037
+
2038
+ module Rails
2039
+ module Generators
2040
+ module Actions
2041
+ class CreateMigration < Thor::Actions::CreateFile
2042
+ # nodoc:
2043
+ def migration_dir: () -> untyped
2044
+
2045
+ def migration_file_name: () -> untyped
2046
+
2047
+ def identical?: () -> untyped
2048
+
2049
+ def revoke!: () -> (nil | untyped)
2050
+
2051
+ def relative_existing_migration: () -> untyped
2052
+
2053
+ def existing_migration: () -> untyped
2054
+
2055
+ alias exists? existing_migration
2056
+
2057
+ private
2058
+
2059
+ def on_conflict_behavior: () { () -> untyped } -> untyped
2060
+
2061
+ def say_status: (untyped status, untyped color, ?untyped message) -> untyped
2062
+ end
2063
+ end
2064
+ end
2065
+ end
2066
+
2067
+ module Rails
2068
+ module Generators
2069
+ module Actions
2070
+ def initialize: () -> untyped
2071
+
2072
+ # Adds an entry into +Gemfile+ for the supplied gem.
2073
+ #
2074
+ # gem "rspec", group: :test
2075
+ # gem "technoweenie-restful-authentication", lib: "restful-authentication", source: "http://gems.github.com/"
2076
+ # gem "rails", "3.0", git: "https://github.com/rails/rails"
2077
+ # gem "RedCloth", ">= 4.1.0", "< 4.2.0"
2078
+ def gem: (*untyped args) -> untyped
2079
+
2080
+ # Wraps gem entries inside a group.
2081
+ #
2082
+ # gem_group :development, :test do
2083
+ # gem "rspec-rails"
2084
+ # end
2085
+ def gem_group: (*untyped names) { () -> untyped } -> untyped
2086
+
2087
+ def github: (untyped repo, ?::Hash[untyped, untyped] options) { () -> untyped } -> untyped
2088
+
2089
+ # Add the given source to +Gemfile+
2090
+ #
2091
+ # If block is given, gem entries in block are wrapped into the source group.
2092
+ #
2093
+ # add_source "http://gems.github.com/"
2094
+ #
2095
+ # add_source "http://gems.github.com/" do
2096
+ # gem "rspec-rails"
2097
+ # end
2098
+ def add_source: (untyped source, ?::Hash[untyped, untyped] options) { () -> untyped } -> untyped
2099
+
2100
+ # Adds a line inside the Application class for <tt>config/application.rb</tt>.
2101
+ #
2102
+ # If options <tt>:env</tt> is specified, the line is appended to the corresponding
2103
+ # file in <tt>config/environments</tt>.
2104
+ #
2105
+ # environment do
2106
+ # "config.action_controller.asset_host = 'cdn.provider.com'"
2107
+ # end
2108
+ #
2109
+ # environment(nil, env: "development") do
2110
+ # "config.action_controller.asset_host = 'localhost:3000'"
2111
+ # end
2112
+ def environment: (?untyped? data, ?::Hash[untyped, untyped] options) { () -> untyped } -> untyped
2113
+
2114
+ alias application environment
2115
+
2116
+ # Run a command in git.
2117
+ #
2118
+ # git :init
2119
+ # git add: "this.file that.rb"
2120
+ # git add: "onefile.rb", rm: "badfile.cxx"
2121
+ def git: (?::Hash[untyped, untyped] commands) -> untyped
2122
+
2123
+ # Create a new file in the <tt>vendor/</tt> directory. Code can be specified
2124
+ # in a block or a data string can be given.
2125
+ #
2126
+ # vendor("sekrit.rb") do
2127
+ # sekrit_salt = "#{Time.now}--#{3.years.ago}--#{rand}--"
2128
+ # "salt = '#{sekrit_salt}'"
2129
+ # end
2130
+ #
2131
+ # vendor("foreign.rb", "# Foreign code is fun")
2132
+ def vendor: (untyped filename, ?untyped? data) { () -> untyped } -> untyped
2133
+
2134
+ # Create a new file in the <tt>lib/</tt> directory. Code can be specified
2135
+ # in a block or a data string can be given.
2136
+ #
2137
+ # lib("crypto.rb") do
2138
+ # "crypted_special_value = '#{rand}--#{Time.now}--#{rand(1337)}--'"
2139
+ # end
2140
+ #
2141
+ # lib("foreign.rb", "# Foreign code is fun")
2142
+ def lib: (untyped filename, ?untyped? data) { () -> untyped } -> untyped
2143
+
2144
+ # Create a new +Rakefile+ with the provided code (either in a block or a string).
2145
+ #
2146
+ # rakefile("bootstrap.rake") do
2147
+ # project = ask("What is the UNIX name of your project?")
2148
+ #
2149
+ # <<-TASK
2150
+ # namespace :#{project} do
2151
+ # task :bootstrap do
2152
+ # puts "I like boots!"
2153
+ # end
2154
+ # end
2155
+ # TASK
2156
+ # end
2157
+ #
2158
+ # rakefile('seed.rake', 'puts "Planting seeds"')
2159
+ def rakefile: (untyped filename, ?untyped? data) { () -> untyped } -> untyped
2160
+
2161
+ # Create a new initializer with the provided code (either in a block or a string).
2162
+ #
2163
+ # initializer("globals.rb") do
2164
+ # data = ""
2165
+ #
2166
+ # ['MY_WORK', 'ADMINS', 'BEST_COMPANY_EVAR'].each do |const|
2167
+ # data << "#{const} = :entp\n"
2168
+ # end
2169
+ #
2170
+ # data
2171
+ # end
2172
+ #
2173
+ # initializer("api.rb", "API_KEY = '123456'")
2174
+ def initializer: (untyped filename, ?untyped? data) { () -> untyped } -> untyped
2175
+
2176
+ # Generate something using a generator from Rails or a plugin.
2177
+ # The second parameter is the argument string that is passed to
2178
+ # the generator or an Array that is joined.
2179
+ #
2180
+ # generate(:authenticated, "user session")
2181
+ def generate: (untyped what, *untyped args) -> untyped
2182
+
2183
+ # Runs the supplied rake task (invoked with 'rake ...')
2184
+ #
2185
+ # rake("db:migrate")
2186
+ # rake("db:migrate", env: "production")
2187
+ # rake("gems:install", sudo: true)
2188
+ # rake("gems:install", capture: true)
2189
+ def rake: (untyped command, ?::Hash[untyped, untyped] options) -> untyped
2190
+
2191
+ # Runs the supplied rake task (invoked with 'rails ...')
2192
+ #
2193
+ # rails_command("db:migrate")
2194
+ # rails_command("db:migrate", env: "production")
2195
+ # rails_command("gems:install", sudo: true)
2196
+ # rails_command("gems:install", capture: true)
2197
+ def rails_command: (untyped command, ?::Hash[untyped, untyped] options) -> untyped
2198
+
2199
+ # Make an entry in Rails routing file <tt>config/routes.rb</tt>
2200
+ #
2201
+ # route "root 'welcome#index'"
2202
+ def route: (untyped routing_code) -> untyped
2203
+
2204
+ # Reads the given file at the source root and prints it in the console.
2205
+ #
2206
+ # readme "README"
2207
+ def readme: (untyped path) -> untyped
2208
+
2209
+ private
2210
+
2211
+ def log: (*untyped args) -> untyped
2212
+
2213
+ def execute_command: (untyped executor, untyped command, ?::Hash[untyped, untyped] options) -> untyped
2214
+
2215
+ def extify: (untyped name) -> untyped
2216
+
2217
+ def quote: (untyped value) -> untyped
2218
+
2219
+ def optimize_indentation: (untyped value, ?::Integer amount) -> (::String | untyped)
2220
+
2221
+ def indentation: () -> untyped
2222
+
2223
+ def with_indentation: () { () -> untyped } -> untyped
2224
+ end
2225
+ end
2226
+ end
2227
+
2228
+ module Rails
2229
+ module Generators
2230
+ # ActiveModel is a class to be implemented by each ORM to allow Rails to
2231
+ # generate customized controller code.
2232
+ #
2233
+ # The API has the same methods as ActiveRecord, but each method returns a
2234
+ # string that matches the ORM API.
2235
+ #
2236
+ # For example:
2237
+ #
2238
+ # ActiveRecord::Generators::ActiveModel.find(Foo, "params[:id]")
2239
+ # # => "Foo.find(params[:id])"
2240
+ #
2241
+ # DataMapper::Generators::ActiveModel.find(Foo, "params[:id]")
2242
+ # # => "Foo.get(params[:id])"
2243
+ #
2244
+ # On initialization, the ActiveModel accepts the instance name that will
2245
+ # receive the calls:
2246
+ #
2247
+ # builder = ActiveRecord::Generators::ActiveModel.new "@foo"
2248
+ # builder.save # => "@foo.save"
2249
+ #
2250
+ # The only exception in ActiveModel for ActiveRecord is the use of self.build
2251
+ # instead of self.new.
2252
+ #
2253
+ class ActiveModel
2254
+ attr_reader name: untyped
2255
+
2256
+ def initialize: (untyped name) -> untyped
2257
+
2258
+ # GET index
2259
+ def self.all: (untyped klass) -> ::String
2260
+
2261
+ # GET show
2262
+ # GET edit
2263
+ # PATCH/PUT update
2264
+ # DELETE destroy
2265
+ def self.find: (untyped klass, ?untyped? params) -> ::String
2266
+
2267
+ # GET new
2268
+ # POST create
2269
+ def self.build: (untyped klass, ?untyped? params) -> untyped
2270
+
2271
+ # POST create
2272
+ def save: () -> ::String
2273
+
2274
+ # PATCH/PUT update
2275
+ def update: (?untyped? params) -> ::String
2276
+
2277
+ # POST create
2278
+ # PATCH/PUT update
2279
+ def errors: () -> ::String
2280
+
2281
+ # DELETE destroy
2282
+ def destroy: () -> ::String
2283
+ end
2284
+ end
2285
+ end
2286
+
2287
+ module Rails
2288
+ module Generators
2289
+ class AppBase < Base
2290
+ # :nodoc:
2291
+ include Database
2292
+
2293
+ include AppName
2294
+
2295
+ attr_accessor rails_template: untyped
2296
+
2297
+ def self.strict_args_position: () -> false
2298
+
2299
+ def self.add_shared_options_for: (untyped name) -> untyped
2300
+
2301
+ def initialize: (*untyped args) -> untyped
2302
+
2303
+ private
2304
+
2305
+ def gemfile_entry: (untyped name, *untyped args) -> untyped
2306
+
2307
+ def gemfile_entries: () -> untyped
2308
+
2309
+ def add_gem_entry_filter: () { (untyped) -> untyped } -> untyped
2310
+
2311
+ def builder: () -> untyped
2312
+
2313
+ def build: (untyped meth, *untyped args) -> untyped
2314
+
2315
+ def create_root: () -> untyped
2316
+
2317
+ def apply_rails_template: () -> untyped
2318
+
2319
+ def set_default_accessors!: () -> untyped
2320
+
2321
+ def database_gemfile_entry: () -> (::Array[untyped] | untyped)
2322
+
2323
+ def web_server_gemfile_entry: () -> (::Array[untyped] | GemfileEntry)
2324
+
2325
+ def include_all_railties?: () -> untyped
2326
+
2327
+ def comment_if: (untyped value) -> untyped
2328
+
2329
+ def keeps?: () -> untyped
2330
+
2331
+ def sqlite3?: () -> untyped
2332
+
2333
+ def skip_active_storage?: () -> untyped
2334
+
2335
+ def skip_action_mailbox?: () -> untyped
2336
+
2337
+ def skip_action_text?: () -> untyped
2338
+
2339
+ class GemfileEntry
2340
+ # Note: It inherits unnamed class, but omitted
2341
+ def initialize: (untyped name, untyped version, untyped comment, ?::Hash[untyped, untyped] options, ?bool commented_out) -> untyped
2342
+
2343
+ def self.github: (untyped name, untyped github, ?untyped? branch, ?untyped? comment) -> untyped
2344
+
2345
+ def self.version: (untyped name, untyped version, ?untyped? comment) -> untyped
2346
+
2347
+ def self.path: (untyped name, untyped path, ?untyped? comment) -> untyped
2348
+
2349
+ def version: () -> untyped
2350
+ end
2351
+
2352
+ def rails_gemfile_entry: () -> untyped
2353
+
2354
+ def rails_version_specifier: (?untyped gem_version) -> untyped
2355
+
2356
+ def assets_gemfile_entry: () -> (::Array[untyped] | untyped)
2357
+
2358
+ def webpacker_gemfile_entry: () -> (::Array[untyped] | untyped)
2359
+
2360
+ def jbuilder_gemfile_entry: () -> GemfileEntry
2361
+
2362
+ def javascript_gemfile_entry: () -> untyped
2363
+
2364
+ def psych_gemfile_entry: () -> (::Array[untyped] | GemfileEntry)
2365
+
2366
+ def cable_gemfile_entry: () -> (::Array[untyped] | untyped)
2367
+
2368
+ def bundle_command: (untyped command, ?::Hash[untyped, untyped] env) -> untyped
2369
+
2370
+ def exec_bundle_command: (untyped bundle_command, untyped command, untyped env) -> untyped
2371
+
2372
+ def bundle_install?: () -> untyped
2373
+
2374
+ def spring_install?: () -> untyped
2375
+
2376
+ def webpack_install?: () -> untyped
2377
+
2378
+ def depends_on_system_test?: () -> untyped
2379
+
2380
+ def depend_on_listen?: () -> untyped
2381
+
2382
+ def depend_on_bootsnap?: () -> untyped
2383
+
2384
+ def os_supports_listen_out_of_the_box?: () -> untyped
2385
+
2386
+ def run_bundle: () -> untyped
2387
+
2388
+ def run_webpack: () -> untyped
2389
+
2390
+ def generate_bundler_binstub: () -> untyped
2391
+
2392
+ def generate_spring_binstubs: () -> untyped
2393
+
2394
+ def empty_directory_with_keep_file: (untyped destination, ?::Hash[untyped, untyped] config) -> untyped
2395
+
2396
+ def keep_file: (untyped destination) -> untyped
2397
+ end
2398
+ end
2399
+ end
2400
+
2401
+ module Rails
2402
+ module Generators
2403
+ module AppName
2404
+ # :nodoc:
2405
+ RESERVED_NAMES: ::Array[untyped]
2406
+
2407
+ private
2408
+
2409
+ def app_name: () -> untyped
2410
+
2411
+ def original_app_name: () -> untyped
2412
+
2413
+ def defined_app_name: () -> untyped
2414
+
2415
+ def defined_app_const_base: () -> untyped
2416
+
2417
+ alias defined_app_const_base? defined_app_const_base
2418
+
2419
+ def app_const_base: () -> untyped
2420
+
2421
+ alias camelized app_const_base
2422
+
2423
+ def app_const: () -> untyped
2424
+
2425
+ def valid_const?: () -> untyped
2426
+ end
2427
+ end
2428
+ end
2429
+
2430
+ module Rails
2431
+ module Generators
2432
+ class Error < Thor::Error
2433
+ end
2434
+
2435
+ class Base < Thor::Group
2436
+ include Thor::Actions
2437
+
2438
+ include Rails::Generators::Actions
2439
+
2440
+ def self.exit_on_failure?: () -> false
2441
+
2442
+ # Returns the source root for this generator using default_source_root as default.
2443
+ def self.source_root: (?untyped? path) -> untyped
2444
+
2445
+ # Tries to get the description from a USAGE file one folder above the source
2446
+ # root otherwise uses a default description.
2447
+ def self.desc: (?untyped? description) -> untyped
2448
+
2449
+ # Convenience method to get the namespace from the class name. It's the
2450
+ # same as Thor default except that the Generator at the end of the class
2451
+ # is removed.
2452
+ def self.namespace: (?untyped? name) -> untyped
2453
+
2454
+ # Convenience method to hide this generator from the available ones when
2455
+ # running rails generator command.
2456
+ def self.hide!: () -> untyped
2457
+
2458
+ # Invoke a generator based on the value supplied by the user to the
2459
+ # given option named "name". A class option is created when this method
2460
+ # is invoked and you can set a hash to customize it.
2461
+ #
2462
+ # ==== Examples
2463
+ #
2464
+ # module Rails::Generators
2465
+ # class ControllerGenerator < Base
2466
+ # hook_for :test_framework, aliases: "-t"
2467
+ # end
2468
+ # end
2469
+ #
2470
+ # The example above will create a test framework option and will invoke
2471
+ # a generator based on the user supplied value.
2472
+ #
2473
+ # For example, if the user invoke the controller generator as:
2474
+ #
2475
+ # rails generate controller Account --test-framework=test_unit
2476
+ #
2477
+ # The controller generator will then try to invoke the following generators:
2478
+ #
2479
+ # "rails:test_unit", "test_unit:controller", "test_unit"
2480
+ #
2481
+ # Notice that "rails:generators:test_unit" could be loaded as well, what
2482
+ # Rails looks for is the first and last parts of the namespace. This is what
2483
+ # allows any test framework to hook into Rails as long as it provides any
2484
+ # of the hooks above.
2485
+ #
2486
+ # ==== Options
2487
+ #
2488
+ # The first and last part used to find the generator to be invoked are
2489
+ # guessed based on class invokes hook_for, as noticed in the example above.
2490
+ # This can be customized with two options: :in and :as.
2491
+ #
2492
+ # Let's suppose you are creating a generator that needs to invoke the
2493
+ # controller generator from test unit. Your first attempt is:
2494
+ #
2495
+ # class AwesomeGenerator < Rails::Generators::Base
2496
+ # hook_for :test_framework
2497
+ # end
2498
+ #
2499
+ # The lookup in this case for test_unit as input is:
2500
+ #
2501
+ # "test_unit:awesome", "test_unit"
2502
+ #
2503
+ # Which is not the desired lookup. You can change it by providing the
2504
+ # :as option:
2505
+ #
2506
+ # class AwesomeGenerator < Rails::Generators::Base
2507
+ # hook_for :test_framework, as: :controller
2508
+ # end
2509
+ #
2510
+ # And now it will look up at:
2511
+ #
2512
+ # "test_unit:controller", "test_unit"
2513
+ #
2514
+ # Similarly, if you want it to also look up in the rails namespace, you
2515
+ # just need to provide the :in value:
2516
+ #
2517
+ # class AwesomeGenerator < Rails::Generators::Base
2518
+ # hook_for :test_framework, in: :rails, as: :controller
2519
+ # end
2520
+ #
2521
+ # And the lookup is exactly the same as previously:
2522
+ #
2523
+ # "rails:test_unit", "test_unit:controller", "test_unit"
2524
+ #
2525
+ # ==== Switches
2526
+ #
2527
+ # All hooks come with switches for user interface. If you do not want
2528
+ # to use any test framework, you can do:
2529
+ #
2530
+ # rails generate controller Account --skip-test-framework
2531
+ #
2532
+ # Or similarly:
2533
+ #
2534
+ # rails generate controller Account --no-test-framework
2535
+ #
2536
+ # ==== Boolean hooks
2537
+ #
2538
+ # In some cases, you may want to provide a boolean hook. For example, webrat
2539
+ # developers might want to have webrat available on controller generator.
2540
+ # This can be achieved as:
2541
+ #
2542
+ # Rails::Generators::ControllerGenerator.hook_for :webrat, type: :boolean
2543
+ #
2544
+ # Then, if you want webrat to be invoked, just supply:
2545
+ #
2546
+ # rails generate controller Account --webrat
2547
+ #
2548
+ # The hooks lookup is similar as above:
2549
+ #
2550
+ # "rails:generators:webrat", "webrat:generators:controller", "webrat"
2551
+ #
2552
+ # ==== Custom invocations
2553
+ #
2554
+ # You can also supply a block to hook_for to customize how the hook is
2555
+ # going to be invoked. The block receives two arguments, an instance
2556
+ # of the current class and the class to be invoked.
2557
+ #
2558
+ # For example, in the resource generator, the controller should be invoked
2559
+ # with a pluralized class name. But by default it is invoked with the same
2560
+ # name as the resource generator, which is singular. To change this, we
2561
+ # can give a block to customize how the controller can be invoked.
2562
+ #
2563
+ # hook_for :resource_controller do |instance, controller|
2564
+ # instance.invoke controller, [ instance.name.pluralize ]
2565
+ # end
2566
+ #
2567
+ def self.hook_for: (*untyped names) { () -> untyped } -> untyped
2568
+
2569
+ # Remove a previously added hook.
2570
+ #
2571
+ # remove_hook_for :orm
2572
+ def self.remove_hook_for: (*untyped names) -> untyped
2573
+
2574
+ def self.class_option: (untyped name, ?::Hash[untyped, untyped] options) -> untyped
2575
+
2576
+ # Returns the default source root for a given generator. This is used internally
2577
+ # by rails to set its generators source root. If you want to customize your source
2578
+ # root, you should use source_root.
2579
+ def self.default_source_root: () -> (nil | untyped)
2580
+
2581
+ # Returns the base root for a common set of generators. This is used to dynamically
2582
+ # guess the default source root.
2583
+ def self.base_root: () -> untyped
2584
+
2585
+ def self.inherited: (untyped base) -> untyped
2586
+
2587
+ private
2588
+
2589
+ # Check whether the given class names are already taken by user
2590
+ # application or Ruby on Rails.
2591
+ def class_collisions: (*untyped class_names) -> (nil | untyped)
2592
+
2593
+ def extract_last_module: (untyped nesting) -> untyped
2594
+
2595
+ def module_namespacing: () { () -> untyped } -> untyped
2596
+
2597
+ def indent: (untyped content, ?::Integer multiplier) -> untyped
2598
+
2599
+ def wrap_with_namespace: (untyped content) -> ::String
2600
+
2601
+ def namespace: () -> untyped
2602
+
2603
+ def namespaced?: () -> untyped
2604
+
2605
+ def namespace_dirs: () -> untyped
2606
+
2607
+ def namespaced_path: () -> untyped
2608
+
2609
+ def self.banner: () -> untyped
2610
+
2611
+ def self.base_name: () -> untyped
2612
+
2613
+ def self.generator_name: () -> untyped
2614
+
2615
+ def self.default_value_for_option: (untyped name, untyped options) -> untyped
2616
+
2617
+ def self.default_aliases_for_option: (untyped name, untyped options) -> untyped
2618
+
2619
+ def self.default_for_option: (untyped config, untyped name, untyped options, untyped default) -> untyped
2620
+
2621
+ def self.hooks: () -> untyped
2622
+
2623
+ def self.prepare_for_invocation: (untyped name, untyped value) -> untyped
2624
+
2625
+ def self.add_shebang_option!: () -> untyped
2626
+
2627
+ def self.usage_path: () -> untyped
2628
+
2629
+ def self.default_generator_root: () -> untyped
2630
+ end
2631
+ end
2632
+ end
2633
+
2634
+ module Css
2635
+ module Generators
2636
+ class AssetsGenerator < Rails::Generators::NamedBase
2637
+ def copy_stylesheet: () -> untyped
2638
+ end
2639
+ end
2640
+ end
2641
+
2642
+ module Css
2643
+ module Generators
2644
+ class ScaffoldGenerator < Rails::Generators::NamedBase
2645
+ # In order to allow the Sass generators to pick up the default Rails CSS and
2646
+ # transform it, we leave it in a standard location for the CSS stylesheet
2647
+ # generators to handle. For the simple, default case, just copy it over.
2648
+ def copy_stylesheet: () -> untyped
2649
+ end
2650
+ end
2651
+ end
2652
+
2653
+ module Rails
2654
+ module Generators
2655
+ module Database
2656
+ # :nodoc:
2657
+ JDBC_DATABASES: ::Array[untyped]
2658
+
2659
+ DATABASES: untyped
2660
+
2661
+ def initialize: () -> untyped
2662
+
2663
+ def gem_for_database: (?untyped database) -> untyped
2664
+
2665
+ def convert_database_option_for_jruby: () -> untyped
2666
+
2667
+ private
2668
+
2669
+ def mysql_socket: () -> untyped
2670
+ end
2671
+ end
2672
+ end
2673
+
2674
+ module Erb
2675
+ module Generators
2676
+ class ControllerGenerator < Base
2677
+ def copy_view_files: () -> untyped
2678
+ end
2679
+ end
2680
+ end
2681
+
2682
+ module Erb
2683
+ module Generators
2684
+ class MailerGenerator < Base
2685
+ def copy_view_files: () -> untyped
2686
+
2687
+ private
2688
+
2689
+ def formats: () -> ::Array[:text | :html]
2690
+
2691
+ def file_name: () -> untyped
2692
+ end
2693
+ end
2694
+ end
2695
+
2696
+ module Erb
2697
+ module Generators
2698
+ class ScaffoldGenerator < Base
2699
+ # :nodoc:
2700
+ # :nodoc:
2701
+ # :nodoc:
2702
+ include Rails::Generators::ResourceHelpers
2703
+
2704
+ def create_root_folder: () -> untyped
2705
+
2706
+ def copy_view_files: () -> untyped
2707
+
2708
+ private
2709
+
2710
+ def available_views: () -> ::Array["index" | "edit" | "show" | "new" | "_form"]
2711
+ end
2712
+ end
2713
+ end
2714
+
2715
+ module Erb
2716
+ module Generators
2717
+ class Base < Rails::Generators::NamedBase
2718
+ private
2719
+
2720
+ def formats: () -> ::Array[untyped]
2721
+
2722
+ def format: () -> :html
2723
+
2724
+ def handler: () -> :erb
2725
+
2726
+ def filename_with_extensions: (untyped name, ?untyped file_format) -> untyped
2727
+ end
2728
+ end
2729
+ end
2730
+
2731
+ module Rails
2732
+ module Generators
2733
+ class GeneratedAttribute
2734
+ # :nodoc:
2735
+ INDEX_OPTIONS: ::Array[untyped]
2736
+
2737
+ UNIQ_INDEX_OPTIONS: ::Array[untyped]
2738
+
2739
+ attr_accessor name: untyped
2740
+
2741
+ attr_accessor type: untyped
2742
+
2743
+ attr_reader attr_options: untyped
2744
+
2745
+ attr_writer index_name: untyped
2746
+
2747
+ def self.parse: (untyped column_definition) -> untyped
2748
+
2749
+ def self.reference?: (untyped `type`) -> untyped
2750
+
2751
+ private
2752
+
2753
+ # parse possible attribute options like :limit for string/text/binary/integer, :precision/:scale for decimals or :polymorphic for references/belongs_to
2754
+ # when declaring options curly brackets should be used
2755
+ def self.parse_type_and_options: (untyped `type`) -> untyped
2756
+
2757
+ public
2758
+
2759
+ def initialize: (untyped name, ?untyped? `type`, ?bool index_type, ?::Hash[untyped, untyped] attr_options) -> untyped
2760
+
2761
+ def field_type: () -> untyped
2762
+
2763
+ def default: () -> untyped
2764
+
2765
+ def plural_name: () -> untyped
2766
+
2767
+ def singular_name: () -> untyped
2768
+
2769
+ def human_name: () -> untyped
2770
+
2771
+ def index_name: () -> untyped
2772
+
2773
+ def column_name: () -> untyped
2774
+
2775
+ def foreign_key?: () -> untyped
2776
+
2777
+ def reference?: () -> untyped
2778
+
2779
+ def polymorphic?: () -> untyped
2780
+
2781
+ def required?: () -> untyped
2782
+
2783
+ def has_index?: () -> untyped
2784
+
2785
+ def has_uniq_index?: () -> untyped
2786
+
2787
+ def password_digest?: () -> untyped
2788
+
2789
+ def token?: () -> untyped
2790
+
2791
+ def rich_text?: () -> untyped
2792
+
2793
+ def attachment?: () -> untyped
2794
+
2795
+ def attachments?: () -> untyped
2796
+
2797
+ def virtual?: () -> untyped
2798
+
2799
+ def inject_options: () -> untyped
2800
+
2801
+ def inject_index_options: () -> untyped
2802
+
2803
+ def options_for_migration: () -> untyped
2804
+ end
2805
+ end
2806
+ end
2807
+
2808
+ module Rails
2809
+ module Generators
2810
+ # Holds common methods for migrations. It assumes that migrations have the
2811
+ # [0-9]*_name format and can be used by other frameworks (like Sequel)
2812
+ # just by implementing the next migration version method.
2813
+ module Migration
2814
+ extend ActiveSupport::Concern
2815
+
2816
+ attr_reader migration_number: untyped
2817
+
2818
+ attr_reader migration_file_name: untyped
2819
+
2820
+ attr_reader migration_class_name: untyped
2821
+
2822
+ module ClassMethods
2823
+ # nodoc:
2824
+ def migration_lookup_at: (untyped dirname) -> untyped
2825
+
2826
+ def migration_exists?: (untyped dirname, untyped file_name) -> untyped
2827
+
2828
+ def current_migration_number: (untyped dirname) -> untyped
2829
+
2830
+ def next_migration_number: (untyped dirname) -> untyped
2831
+ end
2832
+
2833
+ def create_migration: (untyped destination, untyped data, ?::Hash[untyped, untyped] config) { () -> untyped } -> untyped
2834
+
2835
+ def set_migration_assigns!: (untyped destination) -> untyped
2836
+
2837
+ # Creates a migration template at the given destination. The difference
2838
+ # to the default template method is that the migration version is appended
2839
+ # to the destination file name.
2840
+ #
2841
+ # The migration version, migration file name, migration class name are
2842
+ # available as instance variables in the template to be rendered.
2843
+ #
2844
+ # migration_template "migration.rb", "db/migrate/add_foo_to_bar.rb"
2845
+ def migration_template: (untyped source, untyped destination, ?::Hash[untyped, untyped] config) -> untyped
2846
+ end
2847
+ end
2848
+ end
2849
+
2850
+ module Rails
2851
+ module Generators
2852
+ module ModelHelpers
2853
+ # :nodoc:
2854
+ PLURAL_MODEL_NAME_WARN_MESSAGE: ::String
2855
+
2856
+ IRREGULAR_MODEL_NAME_WARN_MESSAGE: ::String
2857
+
2858
+ def self.included: (untyped base) -> untyped
2859
+
2860
+ def initialize: (untyped args, *untyped _options) -> untyped
2861
+ end
2862
+ end
2863
+ end
2864
+
2865
+ module Rails
2866
+ module Generators
2867
+ class NamedBase < Base
2868
+ def initialize: (untyped args, *untyped options) -> untyped
2869
+
2870
+ def template: (untyped source, *untyped args) { () -> untyped } -> untyped
2871
+
2872
+ def js_template: (untyped source, untyped destination) -> untyped
2873
+
2874
+ private
2875
+
2876
+ attr_reader file_name: untyped
2877
+
2878
+ def singular_name: () -> untyped
2879
+
2880
+ def inside_template: () { () -> untyped } -> untyped
2881
+
2882
+ def inside_template?: () -> untyped
2883
+
2884
+ def file_path: () -> untyped
2885
+
2886
+ def class_path: () -> untyped
2887
+
2888
+ def regular_class_path: () -> untyped
2889
+
2890
+ def namespaced_class_path: () -> untyped
2891
+
2892
+ def class_name: () -> untyped
2893
+
2894
+ def human_name: () -> untyped
2895
+
2896
+ def plural_name: () -> untyped
2897
+
2898
+ def i18n_scope: () -> untyped
2899
+
2900
+ def table_name: () -> untyped
2901
+
2902
+ def uncountable?: () -> untyped
2903
+
2904
+ def index_helper: () -> untyped
2905
+
2906
+ def show_helper: () -> ::String
2907
+
2908
+ def edit_helper: () -> ::String
2909
+
2910
+ def new_helper: () -> ::String
2911
+
2912
+ def singular_table_name: () -> untyped
2913
+
2914
+ def plural_table_name: () -> untyped
2915
+
2916
+ def plural_file_name: () -> untyped
2917
+
2918
+ def fixture_file_name: () -> untyped
2919
+
2920
+ def route_url: () -> untyped
2921
+
2922
+ def url_helper_prefix: () -> untyped
2923
+
2924
+ def application_name: () -> untyped
2925
+
2926
+ def redirect_resource_name: () -> untyped
2927
+
2928
+ def model_resource_name: (?prefix: ::String prefix) -> untyped
2929
+
2930
+ def singular_route_name: () -> untyped
2931
+
2932
+ def plural_route_name: () -> untyped
2933
+
2934
+ def assign_names!: (untyped name) -> untyped
2935
+
2936
+ # Convert attributes array into GeneratedAttribute objects.
2937
+ def parse_attributes!: () -> untyped
2938
+
2939
+ def attributes_names: () -> untyped
2940
+
2941
+ def pluralize_table_names?: () -> untyped
2942
+
2943
+ def mountable_engine?: () -> untyped
2944
+
2945
+ def self.check_class_collision: (?::Hash[untyped, untyped] options) -> untyped
2946
+ end
2947
+ end
2948
+ end
2949
+
2950
+ module Rails
2951
+ module ActionMethods
2952
+ # :nodoc:
2953
+ attr_reader options: untyped
2954
+
2955
+ def initialize: (untyped generator) -> untyped
2956
+
2957
+ private
2958
+
2959
+ def method_missing: (untyped meth, *untyped args) { () -> untyped } -> untyped
2960
+ end
2961
+
2962
+ # The application builder allows you to override elements of the application
2963
+ # generator without being forced to reverse the operations of the default
2964
+ # generator.
2965
+ #
2966
+ # This allows you to override entire operations, like the creation of the
2967
+ # Gemfile, README, or JavaScript files, without needing to know exactly
2968
+ # what those operations do so you can create another template action.
2969
+ #
2970
+ # class CustomAppBuilder < Rails::AppBuilder
2971
+ # def test
2972
+ # @generator.gem "rspec-rails", group: [:development, :test]
2973
+ # run "bundle install"
2974
+ # generate "rspec:install"
2975
+ # end
2976
+ # end
2977
+ class AppBuilder
2978
+ def rakefile: () -> untyped
2979
+
2980
+ def readme: () -> untyped
2981
+
2982
+ def ruby_version: () -> untyped
2983
+
2984
+ def gemfile: () -> untyped
2985
+
2986
+ def configru: () -> untyped
2987
+
2988
+ def gitignore: () -> untyped
2989
+
2990
+ def version_control: () -> untyped
2991
+
2992
+ def package_json: () -> untyped
2993
+
2994
+ def app: () -> untyped
2995
+
2996
+ def bin: () -> untyped
2997
+
2998
+ def bin_when_updating: () -> untyped
2999
+
3000
+ def config: () -> untyped
3001
+
3002
+ def config_when_updating: () -> untyped
3003
+
3004
+ def master_key: () -> (nil | untyped)
3005
+
3006
+ def credentials: () -> (nil | untyped)
3007
+
3008
+ def database_yml: () -> untyped
3009
+
3010
+ def db: () -> untyped
3011
+
3012
+ def lib: () -> untyped
3013
+
3014
+ def log: () -> untyped
3015
+
3016
+ def public_directory: () -> untyped
3017
+
3018
+ def storage: () -> untyped
3019
+
3020
+ def test: () -> untyped
3021
+
3022
+ def system_test: () -> untyped
3023
+
3024
+ def tmp: () -> untyped
3025
+
3026
+ def vendor: () -> untyped
3027
+
3028
+ def config_target_version: () -> untyped
3029
+ end
3030
+
3031
+ module Generators
3032
+ # We need to store the RAILS_DEV_PATH in a constant, otherwise the path
3033
+ # can change in Ruby 1.8.7 when we FileUtils.cd.
3034
+ RAILS_DEV_PATH: untyped
3035
+
3036
+ class AppGenerator < AppBase
3037
+ # :nodoc:
3038
+ WEBPACKS: ::Array[untyped]
3039
+
3040
+ def initialize: (*untyped args) -> untyped
3041
+
3042
+ def create_root_files: () -> untyped
3043
+
3044
+ def create_app_files: () -> untyped
3045
+
3046
+ def create_bin_files: () -> untyped
3047
+
3048
+ def update_bin_files: () -> untyped
3049
+
3050
+ def update_active_storage: () -> untyped
3051
+
3052
+ def create_config_files: () -> untyped
3053
+
3054
+ def update_config_files: () -> untyped
3055
+
3056
+ def create_master_key: () -> untyped
3057
+
3058
+ def create_credentials: () -> untyped
3059
+
3060
+ def display_upgrade_guide_info: () -> untyped
3061
+
3062
+ def create_boot_file: () -> untyped
3063
+
3064
+ def create_active_record_files: () -> (nil | untyped)
3065
+
3066
+ def create_db_files: () -> (nil | untyped)
3067
+
3068
+ def create_lib_files: () -> untyped
3069
+
3070
+ def create_log_files: () -> untyped
3071
+
3072
+ def create_public_files: () -> untyped
3073
+
3074
+ def create_tmp_files: () -> untyped
3075
+
3076
+ def create_vendor_files: () -> untyped
3077
+
3078
+ def create_test_files: () -> untyped
3079
+
3080
+ def create_system_test_files: () -> untyped
3081
+
3082
+ def create_storage_files: () -> untyped
3083
+
3084
+ def delete_app_assets_if_api_option: () -> untyped
3085
+
3086
+ def delete_app_helpers_if_api_option: () -> untyped
3087
+
3088
+ def delete_app_views_if_api_option: () -> untyped
3089
+
3090
+ def delete_public_files_if_api_option: () -> untyped
3091
+
3092
+ def delete_js_folder_skipping_javascript: () -> untyped
3093
+
3094
+ def delete_assets_initializer_skipping_sprockets: () -> untyped
3095
+
3096
+ def delete_application_record_skipping_active_record: () -> untyped
3097
+
3098
+ def delete_action_mailer_files_skipping_action_mailer: () -> untyped
3099
+
3100
+ def delete_action_cable_files_skipping_action_cable: () -> untyped
3101
+
3102
+ def delete_non_api_initializers_if_api_option: () -> untyped
3103
+
3104
+ def delete_api_initializers: () -> untyped
3105
+
3106
+ def delete_new_framework_defaults: () -> untyped
3107
+
3108
+ def delete_bin_yarn: () -> untyped
3109
+
3110
+ def finish_template: () -> untyped
3111
+
3112
+ def run_after_bundle_callbacks: () -> untyped
3113
+
3114
+ def self.banner: () -> ::String
3115
+
3116
+ private
3117
+
3118
+ # Define file as an alias to create_file for backwards compatibility.
3119
+ def file: (*untyped args) { () -> untyped } -> untyped
3120
+
3121
+ def after_bundle: () { () -> untyped } -> untyped
3122
+
3123
+ def get_builder_class: () -> untyped
3124
+ end
3125
+
3126
+ class ARGVScrubber
3127
+ # This class handles preparation of the arguments before the AppGenerator is
3128
+ # called. The class provides version or help information if they were
3129
+ # requested, and also constructs the railsrc file (used for extra configuration
3130
+ # options).
3131
+ #
3132
+ # This class should be called before the AppGenerator is required and started
3133
+ # since it configures and mutates ARGV correctly.
3134
+ # :nodoc:
3135
+ def initialize: (?untyped argv) -> untyped
3136
+
3137
+ def prepare!: () -> untyped
3138
+
3139
+ def self.default_rc_file: () -> untyped
3140
+
3141
+ private
3142
+
3143
+ def handle_version_request!: (untyped argument) -> untyped
3144
+
3145
+ def handle_invalid_command!: (untyped argument, untyped argv) { () -> untyped } -> untyped
3146
+
3147
+ def handle_rails_rc!: (untyped argv) -> untyped
3148
+
3149
+ def railsrc: (untyped argv) { (untyped, untyped) -> untyped } -> untyped
3150
+
3151
+ def read_rc_file: (untyped railsrc) -> untyped
3152
+
3153
+ def insert_railsrc_into_argv!: (untyped argv, untyped railsrc) -> untyped
3154
+ end
3155
+ end
3156
+ end
3157
+
3158
+ module Rails
3159
+ module Generators
3160
+ class ApplicationRecordGenerator < Base
3161
+ end
3162
+ end
3163
+ end
3164
+
3165
+ module Rails
3166
+ module Generators
3167
+ class AssetsGenerator < NamedBase
3168
+ private
3169
+
3170
+ def asset_name: () -> untyped
3171
+ end
3172
+ end
3173
+ end
3174
+
3175
+ module Rails
3176
+ module Generators
3177
+ class ControllerGenerator < NamedBase
3178
+ def create_controller_files: () -> untyped
3179
+
3180
+ def add_routes: () -> (nil | untyped)
3181
+
3182
+ private
3183
+
3184
+ def file_name: () -> untyped
3185
+
3186
+ def remove_possible_suffix: (untyped name) -> untyped
3187
+
3188
+ # This method creates nested route entry for namespaced resources.
3189
+ # For eg. rails g controller foo/bar/baz index show
3190
+ # Will generate -
3191
+ # namespace :foo do
3192
+ # namespace :bar do
3193
+ # get 'baz/index'
3194
+ # get 'baz/show'
3195
+ # end
3196
+ # end
3197
+ def generate_routing_code: () -> untyped
3198
+ end
3199
+ end
3200
+ end
3201
+
3202
+ module Rails
3203
+ module Generators
3204
+ class CredentialsGenerator < Base
3205
+ # :nodoc:
3206
+ def add_credentials_file: () -> untyped
3207
+
3208
+ def add_credentials_file_silently: (?untyped? template) -> untyped
3209
+
3210
+ private
3211
+
3212
+ def credentials: () -> ActiveSupport::EncryptedConfiguration
3213
+
3214
+ def credentials_template: () -> ::String
3215
+ end
3216
+ end
3217
+ end
3218
+
3219
+ module Rails
3220
+ module Generators
3221
+ module Db
3222
+ module System
3223
+ class ChangeGenerator < Base
3224
+ # :nodoc:
3225
+ include Database
3226
+
3227
+ include AppName
3228
+
3229
+ def self.default_generator_root: () -> untyped
3230
+
3231
+ def initialize: () -> untyped
3232
+
3233
+ def edit_database_config: () -> untyped
3234
+
3235
+ def edit_gemfile: () -> untyped
3236
+
3237
+ private
3238
+
3239
+ def all_database_gems: () -> untyped
3240
+
3241
+ def all_database_gems_regex: () -> ::Regexp
3242
+
3243
+ def gem_entry_regex_for: (untyped gem_name) -> ::Regexp
3244
+
3245
+ def gem_entry_for: (*untyped gem_name_and_version) -> ::String
3246
+ end
3247
+ end
3248
+ end
3249
+ end
3250
+ end
3251
+
3252
+ module Rails
3253
+ module Generators
3254
+ class EncryptedFileGenerator < Base
3255
+ # :nodoc:
3256
+ def add_encrypted_file_silently: (untyped file_path, untyped key_path, ?untyped template) -> untyped
3257
+
3258
+ private
3259
+
3260
+ def encrypted_file_template: () -> ::String
3261
+ end
3262
+ end
3263
+ end
3264
+
3265
+ module Rails
3266
+ module Generators
3267
+ class EncryptionKeyFileGenerator < Base
3268
+ # :nodoc:
3269
+ def add_key_file: (untyped key_path) -> untyped
3270
+
3271
+ def add_key_file_silently: (untyped key_path, ?untyped? key) -> untyped
3272
+
3273
+ def ignore_key_file: (untyped key_path, ?ignore: untyped ignore) -> untyped
3274
+
3275
+ def ignore_key_file_silently: (untyped key_path, ?ignore: untyped ignore) -> untyped
3276
+
3277
+ private
3278
+
3279
+ def key_ignore: (untyped key_path) -> untyped
3280
+ end
3281
+ end
3282
+ end
3283
+
3284
+ module Rails
3285
+ module Generators
3286
+ class GeneratorGenerator < NamedBase
3287
+ def create_generator_files: () -> untyped
3288
+
3289
+ private
3290
+
3291
+ def generator_dir: () -> untyped
3292
+ end
3293
+ end
3294
+ end
3295
+
3296
+ module Rails
3297
+ module Generators
3298
+ class HelperGenerator < NamedBase
3299
+ def create_helper_files: () -> untyped
3300
+
3301
+ private
3302
+
3303
+ def file_name: () -> untyped
3304
+ end
3305
+ end
3306
+ end
3307
+
3308
+ module Rails
3309
+ module Generators
3310
+ class IntegrationTestGenerator < NamedBase
3311
+ end
3312
+ end
3313
+ end
3314
+
3315
+ module Rails
3316
+ module Generators
3317
+ class MasterKeyGenerator < Base
3318
+ # :nodoc:
3319
+ MASTER_KEY_PATH: untyped
3320
+
3321
+ def add_master_key_file: () -> untyped
3322
+
3323
+ def add_master_key_file_silently: (?untyped? key) -> untyped
3324
+
3325
+ def ignore_master_key_file: () -> untyped
3326
+
3327
+ def ignore_master_key_file_silently: () -> untyped
3328
+
3329
+ private
3330
+
3331
+ def key_file_generator: () -> EncryptionKeyFileGenerator
3332
+
3333
+ def key_ignore: () -> untyped
3334
+ end
3335
+ end
3336
+ end
3337
+
3338
+ module Rails
3339
+ module Generators
3340
+ class MigrationGenerator < NamedBase
3341
+ end
3342
+ end
3343
+ end
3344
+
3345
+ module Rails
3346
+ module Generators
3347
+ class ModelGenerator < NamedBase
3348
+ # :nodoc:
3349
+ include Rails::Generators::ModelHelpers
3350
+ end
3351
+ end
3352
+ end
3353
+
3354
+ module Rails
3355
+ # The plugin builder allows you to override elements of the plugin
3356
+ # generator without being forced to reverse the operations of the default
3357
+ # generator.
3358
+ #
3359
+ # This allows you to override entire operations, like the creation of the
3360
+ # Gemfile, \README, or JavaScript files, without needing to know exactly
3361
+ # what those operations do so you can create another template action.
3362
+ class PluginBuilder
3363
+ def rakefile: () -> untyped
3364
+
3365
+ def app: () -> untyped
3366
+
3367
+ def readme: () -> untyped
3368
+
3369
+ def gemfile: () -> untyped
3370
+
3371
+ def license: () -> untyped
3372
+
3373
+ def gemspec: () -> untyped
3374
+
3375
+ def gitignore: () -> untyped
3376
+
3377
+ def lib: () -> untyped
3378
+
3379
+ def config: () -> untyped
3380
+
3381
+ def test: () -> untyped
3382
+
3383
+ PASSTHROUGH_OPTIONS: ::Array[untyped]
3384
+
3385
+ def generate_test_dummy: (?bool force) -> untyped
3386
+
3387
+ def test_dummy_config: () -> untyped
3388
+
3389
+ def test_dummy_assets: () -> untyped
3390
+
3391
+ def test_dummy_clean: () -> untyped
3392
+
3393
+ def assets_manifest: () -> untyped
3394
+
3395
+ def stylesheets: () -> untyped
3396
+
3397
+ def bin: (?bool force) -> untyped
3398
+
3399
+ def gemfile_entry: () -> (nil | untyped)
3400
+ end
3401
+
3402
+ module Generators
3403
+ class PluginGenerator < AppBase
3404
+ alias plugin_path app_path
3405
+
3406
+ def initialize: (*untyped args) -> untyped
3407
+
3408
+ def create_root_files: () -> untyped
3409
+
3410
+ def create_app_files: () -> untyped
3411
+
3412
+ def create_config_files: () -> untyped
3413
+
3414
+ def create_lib_files: () -> untyped
3415
+
3416
+ def create_assets_manifest_file: () -> untyped
3417
+
3418
+ def create_public_stylesheets_files: () -> untyped
3419
+
3420
+ def create_bin_files: () -> untyped
3421
+
3422
+ def create_test_files: () -> untyped
3423
+
3424
+ def create_test_dummy_files: () -> (nil | untyped)
3425
+
3426
+ def update_gemfile: () -> untyped
3427
+
3428
+ def finish_template: () -> untyped
3429
+
3430
+ def name: () -> untyped
3431
+
3432
+ def underscored_name: () -> untyped
3433
+
3434
+ def namespaced_name: () -> untyped
3435
+
3436
+ private
3437
+
3438
+ def create_dummy_app: (?untyped? path) -> untyped
3439
+
3440
+ def engine?: () -> untyped
3441
+
3442
+ def full?: () -> untyped
3443
+
3444
+ def mountable?: () -> untyped
3445
+
3446
+ def skip_git?: () -> untyped
3447
+
3448
+ def with_dummy_app?: () -> untyped
3449
+
3450
+ def api?: () -> untyped
3451
+
3452
+ def self.banner: () -> ::String
3453
+
3454
+ def original_name: () -> untyped
3455
+
3456
+ def modules: () -> untyped
3457
+
3458
+ def wrap_in_modules: (untyped unwrapped_code) -> untyped
3459
+
3460
+ def camelized_modules: () -> untyped
3461
+
3462
+ def humanized: () -> untyped
3463
+
3464
+ def camelized: () -> untyped
3465
+
3466
+ def author: () -> untyped
3467
+
3468
+ def email: () -> untyped
3469
+
3470
+ def valid_const?: () -> untyped
3471
+
3472
+ def application_definition: () -> untyped
3473
+
3474
+ alias store_application_definition! application_definition
3475
+
3476
+ def get_builder_class: () -> untyped
3477
+
3478
+ def rakefile_test_tasks: () -> ::String
3479
+
3480
+ def dummy_path: (?untyped? path) -> untyped
3481
+
3482
+ def mute: () { () -> untyped } -> untyped
3483
+
3484
+ def rails_app_path: () -> untyped
3485
+
3486
+ def inside_application?: () -> untyped
3487
+
3488
+ def relative_path: () -> (nil | untyped)
3489
+ end
3490
+ end
3491
+ end
3492
+
3493
+ module Rails
3494
+ module Generators
3495
+ class ResourceGenerator < ModelGenerator
3496
+ # :nodoc:
3497
+ include ResourceHelpers
3498
+ end
3499
+ end
3500
+ end
3501
+
3502
+ module Rails
3503
+ module Generators
3504
+ class ResourceRouteGenerator < NamedBase
3505
+ # :nodoc:
3506
+ # Properly nests namespaces passed into a generator
3507
+ #
3508
+ # $ rails generate resource admin/users/products
3509
+ #
3510
+ # should give you
3511
+ #
3512
+ # namespace :admin do
3513
+ # namespace :users do
3514
+ # resources :products
3515
+ # end
3516
+ # end
3517
+ def add_resource_route: () -> (nil | untyped)
3518
+ end
3519
+ end
3520
+ end
3521
+
3522
+ module Rails
3523
+ module Generators
3524
+ class ScaffoldGenerator < ResourceGenerator
3525
+ def handle_skip: () -> untyped
3526
+ end
3527
+ end
3528
+ end
3529
+
3530
+ module Rails
3531
+ module Generators
3532
+ class ScaffoldControllerGenerator < NamedBase
3533
+ # :nodoc:
3534
+ include ResourceHelpers
3535
+
3536
+ def create_controller_files: () -> untyped
3537
+
3538
+ private
3539
+
3540
+ def permitted_params: () -> untyped
3541
+
3542
+ def attachments?: (untyped name) -> untyped
3543
+ end
3544
+ end
3545
+ end
3546
+
3547
+ module Rails
3548
+ module Generators
3549
+ class SystemTestGenerator < NamedBase
3550
+ end
3551
+ end
3552
+ end
3553
+
3554
+ module Rails
3555
+ module Generators
3556
+ class TaskGenerator < NamedBase
3557
+ def create_task_files: () -> untyped
3558
+ end
3559
+ end
3560
+ end
3561
+
3562
+ module Rails
3563
+ module Generators
3564
+ module ResourceHelpers
3565
+ def self.included: (untyped base) -> untyped
3566
+
3567
+ def initialize: (*untyped args) -> untyped
3568
+
3569
+ private
3570
+
3571
+ attr_reader controller_name: untyped
3572
+
3573
+ attr_reader controller_file_name: untyped
3574
+
3575
+ def controller_class_path: () -> untyped
3576
+
3577
+ def assign_controller_names!: (untyped name) -> untyped
3578
+
3579
+ def controller_file_path: () -> untyped
3580
+
3581
+ def controller_class_name: () -> untyped
3582
+
3583
+ def controller_i18n_scope: () -> untyped
3584
+
3585
+ # Loads the ORM::Generators::ActiveModel class. This class is responsible
3586
+ # to tell scaffold entities how to generate a specific method for the
3587
+ # ORM. Check Rails::Generators::ActiveModel for more information.
3588
+ def orm_class: () -> untyped
3589
+
3590
+ # Initialize ORM::Generators::ActiveModel to access instance methods.
3591
+ def orm_instance: (?untyped name) -> untyped
3592
+ end
3593
+ end
3594
+ end
3595
+
3596
+ module Rails
3597
+ module Generators
3598
+ # This class provides a TestCase for testing generators. To setup, you need
3599
+ # just to configure the destination and set which generator is being tested:
3600
+ #
3601
+ # class AppGeneratorTest < Rails::Generators::TestCase
3602
+ # tests AppGenerator
3603
+ # destination File.expand_path("../tmp", __dir__)
3604
+ # end
3605
+ #
3606
+ # If you want to ensure your destination root is clean before running each test,
3607
+ # you can set a setup callback:
3608
+ #
3609
+ # class AppGeneratorTest < Rails::Generators::TestCase
3610
+ # tests AppGenerator
3611
+ # destination File.expand_path("../tmp", __dir__)
3612
+ # setup :prepare_destination
3613
+ # end
3614
+ class TestCase < ActiveSupport::TestCase
3615
+ include Rails::Generators::Testing::Behaviour
3616
+
3617
+ include Rails::Generators::Testing::SetupAndTeardown
3618
+
3619
+ include Rails::Generators::Testing::Assertions
3620
+
3621
+ include FileUtils
3622
+ end
3623
+ end
3624
+ end
3625
+
3626
+ module TestUnit
3627
+ module Generators
3628
+ class ControllerGenerator < Base
3629
+ def create_test_files: () -> untyped
3630
+ end
3631
+ end
3632
+ end
3633
+
3634
+ module TestUnit
3635
+ module Generators
3636
+ class GeneratorGenerator < Base
3637
+ def create_generator_files: () -> untyped
3638
+
3639
+ private
3640
+
3641
+ def generator_path: () -> untyped
3642
+ end
3643
+ end
3644
+ end
3645
+
3646
+ module TestUnit
3647
+ module Generators
3648
+ class HelperGenerator < Base
3649
+ end
3650
+ end
3651
+ end
3652
+
3653
+ module TestUnit
3654
+ module Generators
3655
+ class IntegrationGenerator < Base
3656
+ def create_test_files: () -> untyped
3657
+
3658
+ private
3659
+
3660
+ def file_name: () -> untyped
3661
+ end
3662
+ end
3663
+ end
3664
+
3665
+ module TestUnit
3666
+ module Generators
3667
+ class JobGenerator < Base
3668
+ def create_test_file: () -> untyped
3669
+
3670
+ private
3671
+
3672
+ def file_name: () -> untyped
3673
+ end
3674
+ end
3675
+ end
3676
+
3677
+ module TestUnit
3678
+ module Generators
3679
+ class MailerGenerator < Base
3680
+ def check_class_collision: () -> untyped
3681
+
3682
+ def create_test_files: () -> untyped
3683
+
3684
+ def create_preview_files: () -> untyped
3685
+
3686
+ private
3687
+
3688
+ def file_name: () -> untyped
3689
+ end
3690
+ end
3691
+ end
3692
+
3693
+ module TestUnit
3694
+ module Generators
3695
+ class ModelGenerator < Base
3696
+ # :nodoc:
3697
+ # :nodoc:
3698
+ # :nodoc:
3699
+ RESERVED_YAML_KEYWORDS: ::Array[untyped]
3700
+
3701
+ def create_test_file: () -> untyped
3702
+
3703
+ def create_fixture_file: () -> untyped
3704
+
3705
+ private
3706
+
3707
+ def yaml_key_value: (untyped key, untyped value) -> untyped
3708
+ end
3709
+ end
3710
+ end
3711
+
3712
+ module TestUnit
3713
+ module Generators
3714
+ class PluginGenerator < Base
3715
+ def create_test_files: () -> untyped
3716
+ end
3717
+ end
3718
+ end
3719
+
3720
+ module TestUnit
3721
+ module Generators
3722
+ class ScaffoldGenerator < Base
3723
+ # :nodoc:
3724
+ # :nodoc:
3725
+ # :nodoc:
3726
+ include Rails::Generators::ResourceHelpers
3727
+
3728
+ def create_test_files: () -> untyped
3729
+
3730
+ def fixture_name: () -> untyped
3731
+
3732
+ private
3733
+
3734
+ def attributes_string: () -> untyped
3735
+
3736
+ def attributes_hash: () -> (::Hash[untyped, untyped] | untyped)
3737
+
3738
+ def boolean?: (untyped name) -> untyped
3739
+
3740
+ def virtual?: (untyped name) -> untyped
3741
+ end
3742
+ end
3743
+ end
3744
+
3745
+ module TestUnit
3746
+ module Generators
3747
+ class SystemGenerator < Base
3748
+ def create_test_files: () -> untyped
3749
+
3750
+ private
3751
+
3752
+ def file_name: () -> untyped
3753
+ end
3754
+ end
3755
+ end
3756
+
3757
+ module TestUnit
3758
+ module Generators
3759
+ class Base < Rails::Generators::NamedBase
3760
+ end
3761
+ end
3762
+ end
3763
+
3764
+ module Rails
3765
+ module Generators
3766
+ module Testing
3767
+ module Assertions
3768
+ # Asserts a given file exists. You need to supply an absolute path or a path relative
3769
+ # to the configured destination:
3770
+ #
3771
+ # assert_file "config/environment.rb"
3772
+ #
3773
+ # You can also give extra arguments. If the argument is a regexp, it will check if the
3774
+ # regular expression matches the given file content. If it's a string, it compares the
3775
+ # file with the given string:
3776
+ #
3777
+ # assert_file "config/environment.rb", /initialize/
3778
+ #
3779
+ # Finally, when a block is given, it yields the file content:
3780
+ #
3781
+ # assert_file "app/controllers/products_controller.rb" do |controller|
3782
+ # assert_instance_method :index, controller do |index|
3783
+ # assert_match(/Product\.all/, index)
3784
+ # end
3785
+ # end
3786
+ def assert_file: (untyped relative, *untyped contents) { (untyped) -> untyped } -> untyped
3787
+
3788
+ alias assert_directory assert_file
3789
+
3790
+ # Asserts a given file does not exist. You need to supply an absolute path or a
3791
+ # path relative to the configured destination:
3792
+ #
3793
+ # assert_no_file "config/random.rb"
3794
+ def assert_no_file: (untyped relative) -> untyped
3795
+
3796
+ alias assert_no_directory assert_no_file
3797
+
3798
+ # Asserts a given migration exists. You need to supply an absolute path or a
3799
+ # path relative to the configured destination:
3800
+ #
3801
+ # assert_migration "db/migrate/create_products.rb"
3802
+ #
3803
+ # This method manipulates the given path and tries to find any migration which
3804
+ # matches the migration name. For example, the call above is converted to:
3805
+ #
3806
+ # assert_file "db/migrate/003_create_products.rb"
3807
+ #
3808
+ # Consequently, assert_migration accepts the same arguments has assert_file.
3809
+ def assert_migration: (untyped relative, *untyped contents) { () -> untyped } -> untyped
3810
+
3811
+ # Asserts a given migration does not exist. You need to supply an absolute path or a
3812
+ # path relative to the configured destination:
3813
+ #
3814
+ # assert_no_migration "db/migrate/create_products.rb"
3815
+ def assert_no_migration: (untyped relative) -> untyped
3816
+
3817
+ # Asserts the given class method exists in the given content. This method does not detect
3818
+ # class methods inside (class << self), only class methods which starts with "self.".
3819
+ # When a block is given, it yields the content of the method.
3820
+ #
3821
+ # assert_migration "db/migrate/create_products.rb" do |migration|
3822
+ # assert_class_method :up, migration do |up|
3823
+ # assert_match(/create_table/, up)
3824
+ # end
3825
+ # end
3826
+ def assert_class_method: (untyped method, untyped content) { () -> untyped } -> untyped
3827
+
3828
+ # Asserts the given method exists in the given content. When a block is given,
3829
+ # it yields the content of the method.
3830
+ #
3831
+ # assert_file "app/controllers/products_controller.rb" do |controller|
3832
+ # assert_instance_method :index, controller do |index|
3833
+ # assert_match(/Product\.all/, index)
3834
+ # end
3835
+ # end
3836
+ def assert_instance_method: (untyped method, untyped content) { (untyped) -> untyped } -> untyped
3837
+
3838
+ alias assert_method assert_instance_method
3839
+
3840
+ # Asserts the given attribute type gets translated to a field type
3841
+ # properly:
3842
+ #
3843
+ # assert_field_type :date, :date_select
3844
+ def assert_field_type: (untyped attribute_type, untyped field_type) -> untyped
3845
+
3846
+ # Asserts the given attribute type gets a proper default value:
3847
+ #
3848
+ # assert_field_default_value :string, "MyString"
3849
+ def assert_field_default_value: (untyped attribute_type, untyped value) -> untyped
3850
+ end
3851
+ end
3852
+ end
3853
+ end
3854
+
3855
+ module Rails
3856
+ module Generators
3857
+ module Testing
3858
+ module Behaviour
3859
+ extend ActiveSupport::Concern
3860
+
3861
+ include ActiveSupport::Testing::Stream
3862
+
3863
+ module ClassMethods
3864
+ # Sets which generator should be tested:
3865
+ #
3866
+ # tests AppGenerator
3867
+ def tests: (untyped klass) -> untyped
3868
+
3869
+ # Sets default arguments on generator invocation. This can be overwritten when
3870
+ # invoking it.
3871
+ #
3872
+ # arguments %w(app_name --skip-active-record)
3873
+ def arguments: (untyped array) -> untyped
3874
+
3875
+ # Sets the destination of generator files:
3876
+ #
3877
+ # destination File.expand_path("../tmp", __dir__)
3878
+ def destination: (untyped path) -> untyped
3879
+ end
3880
+
3881
+ # Runs the generator configured for this class. The first argument is an array like
3882
+ # command line arguments:
3883
+ #
3884
+ # class AppGeneratorTest < Rails::Generators::TestCase
3885
+ # tests AppGenerator
3886
+ # destination File.expand_path("../tmp", __dir__)
3887
+ # setup :prepare_destination
3888
+ #
3889
+ # test "database.yml is not created when skipping Active Record" do
3890
+ # run_generator %w(myapp --skip-active-record)
3891
+ # assert_no_file "config/database.yml"
3892
+ # end
3893
+ # end
3894
+ #
3895
+ # You can provide a configuration hash as second argument. This method returns the output
3896
+ # printed by the generator.
3897
+ def run_generator: (?untyped args, ?::Hash[untyped, untyped] config) -> untyped
3898
+
3899
+ # Instantiate the generator.
3900
+ def generator: (?untyped args, ?::Hash[untyped, untyped] options, ?::Hash[untyped, untyped] config) -> untyped
3901
+
3902
+ # Create a Rails::Generators::GeneratedAttribute by supplying the
3903
+ # attribute type and, optionally, the attribute name:
3904
+ #
3905
+ # create_generated_attribute(:string, 'name')
3906
+ def create_generated_attribute: (untyped attribute_type, ?::String name, ?untyped? index) -> untyped
3907
+
3908
+ private
3909
+
3910
+ def destination_root_is_set?: () -> untyped
3911
+
3912
+ def ensure_current_path: () -> untyped
3913
+
3914
+ def prepare_destination: () -> untyped
3915
+
3916
+ def migration_file_name: (untyped relative) -> untyped
3917
+ end
3918
+ end
3919
+ end
3920
+ end
3921
+
3922
+ module Rails
3923
+ module Generators
3924
+ module Testing
3925
+ module SetupAndTeardown
3926
+ def setup: () -> untyped
3927
+
3928
+ def teardown: () -> untyped
3929
+ end
3930
+ end
3931
+ end
3932
+ end
3933
+
3934
+ module Rails
3935
+ module Generators
3936
+ include Rails::Command::Behavior
3937
+
3938
+ DEFAULT_ALIASES: ::Hash[untyped, untyped]
3939
+
3940
+ DEFAULT_OPTIONS: ::Hash[untyped, untyped]
3941
+
3942
+ def self.configure!: (untyped config) -> untyped
3943
+
3944
+ def self.templates_path: () -> untyped
3945
+
3946
+ def self.aliases: () -> untyped
3947
+
3948
+ def self.options: () -> untyped
3949
+
3950
+ # Hold configured generators fallbacks. If a plugin developer wants a
3951
+ # generator group to fallback to another group in case of missing generators,
3952
+ # they can add a fallback.
3953
+ #
3954
+ # For example, shoulda is considered a test_framework and is an extension
3955
+ # of test_unit. However, most part of shoulda generators are similar to
3956
+ # test_unit ones.
3957
+ #
3958
+ # Shoulda then can tell generators to search for test_unit generators when
3959
+ # some of them are not available by adding a fallback:
3960
+ #
3961
+ # Rails::Generators.fallbacks[:shoulda] = :test_unit
3962
+ def self.fallbacks: () -> untyped
3963
+
3964
+ # Configure generators for API only applications. It basically hides
3965
+ # everything that is usually browser related, such as assets and session
3966
+ # migration generators, and completely disable helpers and assets
3967
+ # so generators such as scaffold won't create them.
3968
+ def self.api_only!: () -> untyped
3969
+
3970
+ # Remove the color from output.
3971
+ def self.no_color!: () -> untyped
3972
+
3973
+ # Returns an array of generator namespaces that are hidden.
3974
+ # Generator namespaces may be hidden for a variety of reasons.
3975
+ # Some are aliased such as "rails:migration" and can be
3976
+ # invoked with the shorter "migration", others are private to other generators
3977
+ # such as "css:scaffold".
3978
+ def self.hidden_namespaces: () -> untyped
3979
+
3980
+ def self.hide_namespaces: (*untyped namespaces) -> untyped
3981
+
3982
+ alias self.hide_namespace self.hide_namespaces
3983
+
3984
+ # Show help message with available generators.
3985
+ def self.help: (?::String command) -> untyped
3986
+
3987
+ def self.public_namespaces: () -> untyped
3988
+
3989
+ def self.print_generators: () -> untyped
3990
+
3991
+ def self.sorted_groups: () -> untyped
3992
+
3993
+ def self.find_by_namespace: (untyped name, ?untyped? base, ?untyped? context) -> untyped
3994
+
3995
+ # Receives a namespace, arguments and the behavior to invoke the generator.
3996
+ # It's used as the default entry point for generate, destroy and update
3997
+ # commands.
3998
+ def self.invoke: (untyped namespace, ?untyped args, ?::Hash[untyped, untyped] config) -> untyped
3999
+
4000
+ def self.print_list: (untyped base, untyped namespaces) -> untyped
4001
+
4002
+ # Try fallbacks for the given base.
4003
+ def self.invoke_fallbacks_for: (untyped name, untyped base) -> (nil | untyped)
4004
+
4005
+ def self.command_type: () -> untyped
4006
+
4007
+ def self.lookup_paths: () -> untyped
4008
+
4009
+ def self.file_lookup_paths: () -> untyped
4010
+ end
4011
+ end
4012
+
4013
+ module Rails
4014
+ # This module helps build the runtime properties that are displayed in
4015
+ # Rails::InfoController responses. These include the active Rails version,
4016
+ # Ruby version, Rack version, and so on.
4017
+ module Info
4018
+ def self.names: () -> untyped
4019
+
4020
+ def self.value_for: (untyped property_name) -> untyped
4021
+
4022
+ # nodoc:
4023
+ def self.property: (untyped name, ?untyped? value) { () -> untyped } -> untyped
4024
+
4025
+ def self.to_s: () -> untyped
4026
+
4027
+ alias self.inspect self.to_s
4028
+
4029
+ def self.to_html: () -> untyped
4030
+ end
4031
+ end
4032
+
4033
+ class Rails::InfoController < Rails::ApplicationController
4034
+ def index: () -> untyped
4035
+
4036
+ def properties: () -> untyped
4037
+
4038
+ def routes: () -> untyped
4039
+
4040
+ private
4041
+
4042
+ def match_route: () { (untyped) -> untyped } -> untyped
4043
+
4044
+ def with_leading_slash: (untyped path) -> untyped
4045
+ end
4046
+
4047
+ module Rails
4048
+ module Initializable
4049
+ def self.included: (untyped base) -> untyped
4050
+
4051
+ class Initializer
4052
+ attr_reader name: untyped
4053
+
4054
+ attr_reader block: untyped
4055
+
4056
+ def initialize: (untyped name, untyped context, untyped options) { () -> untyped } -> untyped
4057
+
4058
+ def before: () -> untyped
4059
+
4060
+ def after: () -> untyped
4061
+
4062
+ def belongs_to?: (untyped group) -> untyped
4063
+
4064
+ def run: (*untyped args) -> untyped
4065
+
4066
+ def bind: (untyped context) -> (untyped | Initializer)
4067
+
4068
+ def context_class: () -> untyped
4069
+ end
4070
+
4071
+ class Collection[T] < Array[T]
4072
+ include TSort[T]
4073
+
4074
+ alias tsort_each_node each
4075
+
4076
+ def tsort_each_child: (T initializer) { (T) -> void } -> void
4077
+
4078
+ def +: (untyped other) -> Collection[untyped]
4079
+ end
4080
+
4081
+ def run_initializers: (?::Symbol group, *untyped args) -> (nil | untyped)
4082
+
4083
+ def initializers: () -> untyped
4084
+
4085
+ module ClassMethods
4086
+ def initializers: () -> untyped
4087
+
4088
+ def initializers_chain: () -> untyped
4089
+
4090
+ def initializers_for: (untyped binding) -> Collection[untyped]
4091
+
4092
+ def initializer: (untyped name, ?::Hash[untyped, untyped] opts) { () -> untyped } -> untyped
4093
+ end
4094
+ end
4095
+ end
4096
+
4097
+ class Rails::MailersController < Rails::ApplicationController
4098
+ def index: () -> untyped
4099
+
4100
+ def preview: () -> untyped
4101
+
4102
+ private
4103
+
4104
+ def show_previews?: () -> untyped
4105
+
4106
+ def find_preview: () -> untyped
4107
+
4108
+ def find_preferred_part: (*untyped formats) -> untyped
4109
+
4110
+ def find_part: (untyped format) -> untyped
4111
+
4112
+ def part_query: (untyped mime_type) -> untyped
4113
+
4114
+ def locale_query: (untyped locale) -> untyped
4115
+
4116
+ def set_locale: () { () -> untyped } -> untyped
4117
+ end
4118
+
4119
+ module Rails
4120
+ module Paths
4121
+ # This object is an extended hash that behaves as root of the <tt>Rails::Paths</tt> system.
4122
+ # It allows you to collect information about how you want to structure your application
4123
+ # paths through a Hash-like API. It requires you to give a physical path on initialization.
4124
+ #
4125
+ # root = Root.new "/rails"
4126
+ # root.add "app/controllers", eager_load: true
4127
+ #
4128
+ # The above command creates a new root object and adds "app/controllers" as a path.
4129
+ # This means we can get a <tt>Rails::Paths::Path</tt> object back like below:
4130
+ #
4131
+ # path = root["app/controllers"]
4132
+ # path.eager_load? # => true
4133
+ # path.is_a?(Rails::Paths::Path) # => true
4134
+ #
4135
+ # The +Path+ object is simply an enumerable and allows you to easily add extra paths:
4136
+ #
4137
+ # path.is_a?(Enumerable) # => true
4138
+ # path.to_ary.inspect # => ["app/controllers"]
4139
+ #
4140
+ # path << "lib/controllers"
4141
+ # path.to_ary.inspect # => ["app/controllers", "lib/controllers"]
4142
+ #
4143
+ # Notice that when you add a path using +add+, the path object created already
4144
+ # contains the path with the same path value given to +add+. In some situations,
4145
+ # you may not want this behavior, so you can give <tt>:with</tt> as option.
4146
+ #
4147
+ # root.add "config/routes", with: "config/routes.rb"
4148
+ # root["config/routes"].inspect # => ["config/routes.rb"]
4149
+ #
4150
+ # The +add+ method accepts the following options as arguments:
4151
+ # eager_load, autoload, autoload_once, and glob.
4152
+ #
4153
+ # Finally, the +Path+ object also provides a few helpers:
4154
+ #
4155
+ # root = Root.new "/rails"
4156
+ # root.add "app/controllers"
4157
+ #
4158
+ # root["app/controllers"].expanded # => ["/rails/app/controllers"]
4159
+ # root["app/controllers"].existent # => ["/rails/app/controllers"]
4160
+ #
4161
+ # Check the <tt>Rails::Paths::Path</tt> documentation for more information.
4162
+ class Root
4163
+ attr_accessor path: untyped
4164
+
4165
+ def initialize: (untyped path) -> untyped
4166
+
4167
+ def []=: (untyped path, untyped value) -> untyped
4168
+
4169
+ def add: (untyped path, ?::Hash[untyped, untyped] options) -> untyped
4170
+
4171
+ def []: (untyped path) -> untyped
4172
+
4173
+ def values: () -> untyped
4174
+
4175
+ def keys: () -> untyped
4176
+
4177
+ def values_at: (*untyped list) -> untyped
4178
+
4179
+ def all_paths: () -> untyped
4180
+
4181
+ def autoload_once: () -> untyped
4182
+
4183
+ def eager_load: () -> untyped
4184
+
4185
+ def autoload_paths: () -> untyped
4186
+
4187
+ def load_paths: () -> untyped
4188
+
4189
+ private
4190
+
4191
+ def filter_by: () { (untyped) -> untyped } -> untyped
4192
+ end
4193
+
4194
+ class Path
4195
+ include Enumerable[untyped]
4196
+
4197
+ attr_accessor glob: untyped
4198
+
4199
+ def initialize: (untyped root, untyped current, untyped paths, ?::Hash[untyped, untyped] options) -> untyped
4200
+
4201
+ def absolute_current: () -> untyped
4202
+
4203
+ def children: () -> untyped
4204
+
4205
+ def first: () -> untyped
4206
+
4207
+ def last: () -> untyped
4208
+
4209
+ def each: () { (untyped) -> untyped } -> untyped
4210
+
4211
+ def <<: (untyped path) -> untyped
4212
+
4213
+ alias push <<
4214
+
4215
+ def concat: (untyped paths) -> untyped
4216
+
4217
+ def unshift: (*untyped paths) -> untyped
4218
+
4219
+ def to_ary: () -> untyped
4220
+
4221
+ def extensions: () -> untyped
4222
+
4223
+ # Expands all paths against the root and return all unique values.
4224
+ def expanded: () -> untyped
4225
+
4226
+ # Returns all expanded paths but only if they exist in the filesystem.
4227
+ def existent: () -> untyped
4228
+
4229
+ def existent_directories: () -> untyped
4230
+
4231
+ alias to_a expanded
4232
+
4233
+ private
4234
+
4235
+ def files_in: (untyped path) -> untyped
4236
+ end
4237
+ end
4238
+ end
4239
+
4240
+ module Rails
4241
+ module Rack
4242
+ # Sets log tags, logs the request, calls the app, and flushes the logs.
4243
+ #
4244
+ # Log tags (+taggers+) can be an Array containing: methods that the +request+
4245
+ # object responds to, objects that respond to +to_s+ or Proc objects that accept
4246
+ # an instance of the +request+ object.
4247
+ class Logger < ActiveSupport::LogSubscriber
4248
+ def initialize: (untyped app, ?untyped? taggers) -> untyped
4249
+
4250
+ def call: (untyped env) -> untyped
4251
+
4252
+ private
4253
+
4254
+ def call_app: (untyped request, untyped env) -> untyped
4255
+
4256
+ def started_request_message: (untyped request) -> untyped
4257
+
4258
+ def compute_tags: (untyped request) -> untyped
4259
+
4260
+ def finish: (untyped request) -> untyped
4261
+
4262
+ def logger: () -> untyped
4263
+ end
4264
+ end
4265
+ end
4266
+
4267
+ module Rails
4268
+ module Rack
4269
+ end
4270
+ end
4271
+
4272
+ module Rails
4273
+ class Railtie
4274
+ module Configurable
4275
+ extend ActiveSupport::Concern
4276
+
4277
+ module ClassMethods
4278
+ def inherited: (untyped base) -> untyped
4279
+
4280
+ def instance: () -> untyped
4281
+
4282
+ def respond_to?: (*untyped args) -> untyped
4283
+
4284
+ def configure: () { () -> untyped } -> untyped
4285
+
4286
+ private
4287
+
4288
+ def method_missing: (*untyped args) { () -> untyped } -> untyped
4289
+ end
4290
+ end
4291
+ end
4292
+ end
4293
+
4294
+ module Rails
4295
+ class Railtie
4296
+ class Configuration
4297
+ def initialize: () -> untyped
4298
+
4299
+ def self.eager_load_namespaces: () -> untyped
4300
+
4301
+ # All namespaces that are eager loaded
4302
+ def eager_load_namespaces: () -> untyped
4303
+
4304
+ # Add files that should be watched for change.
4305
+ def watchable_files: () -> untyped
4306
+
4307
+ # Add directories that should be watched for change.
4308
+ # The key of the hashes should be directories and the values should
4309
+ # be an array of extensions to match in each directory.
4310
+ def watchable_dirs: () -> untyped
4311
+
4312
+ # This allows you to modify the application's middlewares from Engines.
4313
+ #
4314
+ # All operations you run on the app_middleware will be replayed on the
4315
+ # application once it is defined and the default_middlewares are
4316
+ # created
4317
+ def app_middleware: () -> untyped
4318
+
4319
+ # This allows you to modify application's generators from Railties.
4320
+ #
4321
+ # Values set on app_generators will become defaults for application, unless
4322
+ # application overwrites them.
4323
+ def app_generators: () { (untyped) -> untyped } -> untyped
4324
+
4325
+ # First configurable block to run. Called before any initializers are run.
4326
+ def before_configuration: () { () -> untyped } -> untyped
4327
+
4328
+ # Third configurable block to run. Does not run if +config.eager_load+
4329
+ # set to false.
4330
+ def before_eager_load: () { () -> untyped } -> untyped
4331
+
4332
+ # Second configurable block to run. Called before frameworks initialize.
4333
+ def before_initialize: () { () -> untyped } -> untyped
4334
+
4335
+ # Last configurable block to run. Called after frameworks initialize.
4336
+ def after_initialize: () { () -> untyped } -> untyped
4337
+
4338
+ # Array of callbacks defined by #to_prepare.
4339
+ def to_prepare_blocks: () -> untyped
4340
+
4341
+ # Defines generic callbacks to run before #after_initialize. Useful for
4342
+ # Rails::Railtie subclasses.
4343
+ def to_prepare: () { () -> untyped } -> untyped
4344
+
4345
+ def respond_to?: (untyped name, ?bool include_private) -> untyped
4346
+
4347
+ private
4348
+
4349
+ def method_missing: (untyped name, *untyped args) { () -> untyped } -> untyped
4350
+ end
4351
+ end
4352
+ end
4353
+
4354
+ module Rails
4355
+ # <tt>Rails::Railtie</tt> is the core of the Rails framework and provides
4356
+ # several hooks to extend Rails and/or modify the initialization process.
4357
+ #
4358
+ # Every major component of Rails (Action Mailer, Action Controller, Active
4359
+ # Record, etc.) implements a railtie. Each of them is responsible for their
4360
+ # own initialization. This makes Rails itself absent of any component hooks,
4361
+ # allowing other components to be used in place of any of the Rails defaults.
4362
+ #
4363
+ # Developing a Rails extension does _not_ require implementing a railtie, but
4364
+ # if you need to interact with the Rails framework during or after boot, then
4365
+ # a railtie is needed.
4366
+ #
4367
+ # For example, an extension doing any of the following would need a railtie:
4368
+ #
4369
+ # * creating initializers
4370
+ # * configuring a Rails framework for the application, like setting a generator
4371
+ # * adding <tt>config.*</tt> keys to the environment
4372
+ # * setting up a subscriber with <tt>ActiveSupport::Notifications</tt>
4373
+ # * adding Rake tasks
4374
+ #
4375
+ # == Creating a Railtie
4376
+ #
4377
+ # To extend Rails using a railtie, create a subclass of <tt>Rails::Railtie</tt>.
4378
+ # This class must be loaded during the Rails boot process, and is conventionally
4379
+ # called <tt>MyNamespace::Railtie</tt>.
4380
+ #
4381
+ # The following example demonstrates an extension which can be used with or
4382
+ # without Rails.
4383
+ #
4384
+ # # lib/my_gem/railtie.rb
4385
+ # module MyGem
4386
+ # class Railtie < Rails::Railtie
4387
+ # end
4388
+ # end
4389
+ #
4390
+ # # lib/my_gem.rb
4391
+ # require 'my_gem/railtie' if defined?(Rails)
4392
+ #
4393
+ # == Initializers
4394
+ #
4395
+ # To add an initialization step to the Rails boot process from your railtie, just
4396
+ # define the initialization code with the +initializer+ macro:
4397
+ #
4398
+ # class MyRailtie < Rails::Railtie
4399
+ # initializer "my_railtie.configure_rails_initialization" do
4400
+ # # some initialization behavior
4401
+ # end
4402
+ # end
4403
+ #
4404
+ # If specified, the block can also receive the application object, in case you
4405
+ # need to access some application-specific configuration, like middleware:
4406
+ #
4407
+ # class MyRailtie < Rails::Railtie
4408
+ # initializer "my_railtie.configure_rails_initialization" do |app|
4409
+ # app.middleware.use MyRailtie::Middleware
4410
+ # end
4411
+ # end
4412
+ #
4413
+ # Finally, you can also pass <tt>:before</tt> and <tt>:after</tt> as options to
4414
+ # +initializer+, in case you want to couple it with a specific step in the
4415
+ # initialization process.
4416
+ #
4417
+ # == Configuration
4418
+ #
4419
+ # Railties can access a config object which contains configuration shared by all
4420
+ # railties and the application:
4421
+ #
4422
+ # class MyRailtie < Rails::Railtie
4423
+ # # Customize the ORM
4424
+ # config.app_generators.orm :my_railtie_orm
4425
+ #
4426
+ # # Add a to_prepare block which is executed once in production
4427
+ # # and before each request in development.
4428
+ # config.to_prepare do
4429
+ # MyRailtie.setup!
4430
+ # end
4431
+ # end
4432
+ #
4433
+ # == Loading Rake Tasks and Generators
4434
+ #
4435
+ # If your railtie has Rake tasks, you can tell Rails to load them through the method
4436
+ # +rake_tasks+:
4437
+ #
4438
+ # class MyRailtie < Rails::Railtie
4439
+ # rake_tasks do
4440
+ # load 'path/to/my_railtie.tasks'
4441
+ # end
4442
+ # end
4443
+ #
4444
+ # By default, Rails loads generators from your load path. However, if you want to place
4445
+ # your generators at a different location, you can specify in your railtie a block which
4446
+ # will load them during normal generators lookup:
4447
+ #
4448
+ # class MyRailtie < Rails::Railtie
4449
+ # generators do
4450
+ # require 'path/to/my_railtie_generator'
4451
+ # end
4452
+ # end
4453
+ #
4454
+ # Since filenames on the load path are shared across gems, be sure that files you load
4455
+ # through a railtie have unique names.
4456
+ #
4457
+ # == Application and Engine
4458
+ #
4459
+ # An engine is nothing more than a railtie with some initializers already set. And since
4460
+ # <tt>Rails::Application</tt> is an engine, the same configuration described here can be
4461
+ # used in both.
4462
+ #
4463
+ # Be sure to look at the documentation of those specific classes for more information.
4464
+ class Railtie
4465
+ include Initializable
4466
+
4467
+ ABSTRACT_RAILTIES: ::Array[untyped]
4468
+
4469
+ def self.subclasses: () -> untyped
4470
+
4471
+ def self.inherited: (untyped base) -> untyped
4472
+
4473
+ def self.rake_tasks: () { () -> untyped } -> untyped
4474
+
4475
+ def self.console: () { () -> untyped } -> untyped
4476
+
4477
+ def self.runner: () { () -> untyped } -> untyped
4478
+
4479
+ def self.generators: () { () -> untyped } -> untyped
4480
+
4481
+ def self.abstract_railtie?: () -> untyped
4482
+
4483
+ def self.railtie_name: (?untyped? name) -> untyped
4484
+
4485
+ # Since Rails::Railtie cannot be instantiated, any methods that call
4486
+ # +instance+ are intended to be called only on subclasses of a Railtie.
4487
+ def self.instance: () -> untyped
4488
+
4489
+ # Allows you to configure the railtie. This is the same method seen in
4490
+ # Railtie::Configurable, but this module is no longer required for all
4491
+ # subclasses of Railtie so we provide the class method here.
4492
+ def self.configure: () { () -> untyped } -> untyped
4493
+
4494
+ private
4495
+
4496
+ def self.generate_railtie_name: (untyped string) -> untyped
4497
+
4498
+ def self.respond_to_missing?: (untyped name, untyped _) -> untyped
4499
+
4500
+ # If the class method does not have a method, then send the method call
4501
+ # to the Railtie instance.
4502
+ def self.method_missing: (untyped name, *untyped args) { () -> untyped } -> untyped
4503
+
4504
+ # receives an instance variable identifier, set the variable value if is
4505
+ # blank and append given block to value, which will be used later in
4506
+ # `#each_registered_block(type, &block)`
4507
+ def self.register_block_for: (untyped `type`) { () -> untyped } -> untyped
4508
+
4509
+ public
4510
+
4511
+ def initialize: () -> untyped
4512
+
4513
+ def configure: () { () -> untyped } -> untyped
4514
+
4515
+ # This is used to create the <tt>config</tt> object on Railties, an instance of
4516
+ # Railtie::Configuration, that is used by Railties and Application to store
4517
+ # related configuration.
4518
+ def config: () -> untyped
4519
+
4520
+ def railtie_namespace: () -> untyped
4521
+
4522
+ def run_console_blocks: (untyped app) -> untyped
4523
+
4524
+ def run_generators_blocks: (untyped app) -> untyped
4525
+
4526
+ def run_runner_blocks: (untyped app) -> untyped
4527
+
4528
+ def run_tasks_blocks: (untyped app) -> untyped
4529
+
4530
+ private
4531
+
4532
+ # run `&block` in every registered block in `#register_block_for`
4533
+ def each_registered_block: (untyped `type`) { () -> untyped } -> untyped
4534
+ end
4535
+ end
4536
+
4537
+ module Rails
4538
+ class Secrets
4539
+ # Greatly inspired by Ara T. Howard's magnificent sekrets gem. (trim non-ascii characters)
4540
+ # :nodoc:
4541
+ class MissingKeyError < RuntimeError
4542
+ def initialize: () -> untyped
4543
+ end
4544
+
4545
+ attr_writer self.root: untyped
4546
+
4547
+ def self.parse: (untyped paths, env: untyped env) -> untyped
4548
+
4549
+ def self.key: () -> untyped
4550
+
4551
+ def self.encrypt: (untyped data) -> untyped
4552
+
4553
+ def self.decrypt: (untyped data) -> untyped
4554
+
4555
+ def self.read: () -> untyped
4556
+
4557
+ def self.write: (untyped contents) -> untyped
4558
+
4559
+ def self.read_for_editing: () { () -> untyped } -> untyped
4560
+
4561
+ def self.handle_missing_key: () -> untyped
4562
+
4563
+ def self.read_key_file: () -> untyped
4564
+
4565
+ def self.key_path: () -> untyped
4566
+
4567
+ def self.path: () -> untyped
4568
+
4569
+ def self.preprocess: (untyped path) -> untyped
4570
+
4571
+ def self.writing: (untyped contents) { (untyped) -> untyped } -> untyped
4572
+
4573
+ def self.encryptor: () -> untyped
4574
+ end
4575
+ end
4576
+
4577
+ module Rails
4578
+ # Implements the logic behind <tt>Rails::Command::NotesCommand</tt>. See <tt>rails notes --help</tt> for usage information.
4579
+ #
4580
+ # Annotation objects are triplets <tt>:line</tt>, <tt>:tag</tt>, <tt>:text</tt> that
4581
+ # represent the line where the annotation lives, its tag, and its text. Note
4582
+ # the filename is not stored.
4583
+ #
4584
+ # Annotations are looked for in comments and modulus whitespace they have to
4585
+ # start with the tag optionally followed by a colon. Everything up to the end
4586
+ # of the line (or closing ERB comment tag) is considered to be their text.
4587
+ class SourceAnnotationExtractor
4588
+ class Annotation
4589
+ # Note: It inherits unnamed class, but omitted
4590
+ def self.directories: () -> untyped
4591
+
4592
+ # Registers additional directories to be included
4593
+ # Rails::SourceAnnotationExtractor::Annotation.register_directories("spec", "another")
4594
+ def self.register_directories: (*untyped dirs) -> untyped
4595
+
4596
+ def self.tags: () -> untyped
4597
+
4598
+ # Registers additional tags
4599
+ # Rails::SourceAnnotationExtractor::Annotation.register_tags("TESTME", "DEPRECATEME")
4600
+ def self.register_tags: (*untyped additional_tags) -> untyped
4601
+
4602
+ def self.extensions: () -> untyped
4603
+
4604
+ # Registers new Annotations File Extensions
4605
+ # Rails::SourceAnnotationExtractor::Annotation.register_extensions("css", "scss", "sass", "less", "js") { |tag| /\/\/\s*(#{tag}):?\s*(.*)$/ }
4606
+ def self.register_extensions: (*untyped exts) { () -> untyped } -> untyped
4607
+
4608
+ # Returns a representation of the annotation that looks like this:
4609
+ #
4610
+ # [126] [TODO] This algorithm is simple and clearly correct, make it faster.
4611
+ #
4612
+ # If +options+ has a flag <tt>:tag</tt> the tag is shown as in the example above.
4613
+ # Otherwise the string contains just line and text.
4614
+ def to_s: (?::Hash[untyped, untyped] options) -> untyped
4615
+
4616
+ # Used in annotations.rake
4617
+ # nodoc:
4618
+ def self.notes_task_deprecation_warning: () -> untyped
4619
+ end
4620
+
4621
+ # Prints all annotations with tag +tag+ under the root directories +app+,
4622
+ # +config+, +db+, +lib+, and +test+ (recursively).
4623
+ #
4624
+ # If +tag+ is <tt>nil</tt>, annotations with either default or registered tags are printed.
4625
+ #
4626
+ # Specific directories can be explicitly set using the <tt>:dirs</tt> key in +options+.
4627
+ #
4628
+ # Rails::SourceAnnotationExtractor.enumerate 'TODO|FIXME', dirs: %w(app lib), tag: true
4629
+ #
4630
+ # If +options+ has a <tt>:tag</tt> flag, it will be passed to each annotation's +to_s+.
4631
+ #
4632
+ # See <tt>#find_in</tt> for a list of file extensions that will be taken into account.
4633
+ #
4634
+ # This class method is the single entry point for the `rails notes` command.
4635
+ def self.enumerate: (?untyped? tag, ?::Hash[untyped, untyped] options) -> untyped
4636
+
4637
+ attr_reader tag: untyped
4638
+
4639
+ def initialize: (untyped tag) -> untyped
4640
+
4641
+ # Returns a hash that maps filenames under +dirs+ (recursively) to arrays
4642
+ # with their annotations.
4643
+ def find: (untyped dirs) -> untyped
4644
+
4645
+ # Returns a hash that maps filenames under +dir+ (recursively) to arrays
4646
+ # with their annotations. Files with extensions registered in
4647
+ # <tt>Rails::SourceAnnotationExtractor::Annotation.extensions</tt> are
4648
+ # taken into account. Only files with annotations are included.
4649
+ def find_in: (untyped dir) -> untyped
4650
+
4651
+ # If +file+ is the filename of a file that contains annotations this method returns
4652
+ # a hash with a single entry that maps +file+ to an array of its annotations.
4653
+ # Otherwise it returns an empty hash.
4654
+ def extract_annotations_from: (untyped file, untyped pattern) -> untyped
4655
+
4656
+ # Prints the mapping from filenames to annotations in +results+ ordered by filename.
4657
+ # The +options+ hash is passed to each annotation's +to_s+.
4658
+ def display: (untyped results, ?::Hash[untyped, untyped] options) -> untyped
4659
+ end
4660
+ end
4661
+
4662
+ # Remove this deprecated class in the next minor version
4663
+ # nodoc:
4664
+ SourceAnnotationExtractor: untyped
4665
+
4666
+ module Rails
4667
+ module LineFiltering
4668
+ # :nodoc:
4669
+ def run: (untyped reporter, ?::Hash[untyped, untyped] options) -> untyped
4670
+ end
4671
+ end
4672
+
4673
+ module Rails
4674
+ class TestUnitRailtie < Rails::Railtie
4675
+ end
4676
+ end
4677
+
4678
+ module Rails
4679
+ class TestUnitReporter < Minitest::StatisticsReporter
4680
+ def record: (untyped result) -> untyped
4681
+
4682
+ def report: () -> (nil | untyped)
4683
+
4684
+ def aggregated_results: () -> untyped
4685
+
4686
+ def filtered_results: () -> untyped
4687
+
4688
+ def relative_path_for: (untyped file) -> untyped
4689
+
4690
+ private
4691
+
4692
+ def output_inline?: () -> untyped
4693
+
4694
+ def fail_fast?: () -> untyped
4695
+
4696
+ def format_line: (untyped result) -> untyped
4697
+
4698
+ def format_rerun_snippet: (untyped result) -> ::String
4699
+
4700
+ def app_root: () -> untyped
4701
+
4702
+ def colored_output?: () -> untyped
4703
+
4704
+ COLOR_BY_RESULT_CODE: ::Hash[untyped, untyped]
4705
+
4706
+ def color_output: (untyped string, by: untyped by) -> untyped
4707
+ end
4708
+ end
4709
+
4710
+ module Rails
4711
+ module TestUnit
4712
+ class Runner
4713
+ def self.attach_before_load_options: (untyped opts) -> untyped
4714
+
4715
+ def self.parse_options: (untyped argv) -> untyped
4716
+
4717
+ def self.rake_run: (?untyped argv) -> untyped
4718
+
4719
+ def self.run: (?untyped argv) -> untyped
4720
+
4721
+ def self.load_tests: (untyped argv) -> untyped
4722
+
4723
+ def self.compose_filter: (untyped runnable, untyped filter) -> untyped
4724
+
4725
+ def self.extract_filters: (untyped argv) -> untyped
4726
+ end
4727
+
4728
+ class CompositeFilter
4729
+ # :nodoc:
4730
+ attr_reader named_filter: untyped
4731
+
4732
+ def initialize: (untyped runnable, untyped filter, untyped patterns) -> untyped
4733
+
4734
+ # minitest uses === to find matching filters.
4735
+ def ===: (untyped method) -> untyped
4736
+
4737
+ private
4738
+
4739
+ def derive_named_filter: (untyped filter) -> untyped
4740
+
4741
+ def derive_line_filters: (untyped patterns) -> untyped
4742
+ end
4743
+
4744
+ class Filter
4745
+ # :nodoc:
4746
+ def initialize: (untyped runnable, untyped file, untyped line) -> untyped
4747
+
4748
+ def ===: (untyped method) -> (nil | untyped)
4749
+
4750
+ private
4751
+
4752
+ def definition_for: (untyped method) -> untyped
4753
+ end
4754
+ end
4755
+ end
4756
+
4757
+ module Rails
4758
+ # Returns the version of the currently loaded Rails as a string.
4759
+ def self.version: () -> untyped
4760
+ end
4761
+
4762
+ class Rails::WelcomeController < Rails::ApplicationController
4763
+ def index: () -> nil
4764
+ end
4765
+
4766
+ module Rails
4767
+ extend ActiveSupport::Autoload
4768
+
4769
+ attr_writer self.application: untyped
4770
+
4771
+ attr_accessor self.app_class: untyped
4772
+
4773
+ attr_accessor self.cache: untyped
4774
+
4775
+ attr_accessor self.logger: untyped
4776
+
4777
+ # The Configuration instance used to configure the Rails environment
4778
+ def self.configuration: () -> untyped
4779
+
4780
+ def self.backtrace_cleaner: () -> untyped
4781
+
4782
+ # Returns a Pathname object of the current Rails project,
4783
+ # otherwise it returns +nil+ if there is no project:
4784
+ #
4785
+ # Rails.root
4786
+ # # => #<Pathname:/Users/someuser/some/path/project>
4787
+ def self.root: () -> untyped
4788
+
4789
+ # Returns the current Rails environment.
4790
+ #
4791
+ # Rails.env # => "development"
4792
+ # Rails.env.development? # => true
4793
+ # Rails.env.production? # => false
4794
+ def self.env: () -> untyped
4795
+
4796
+ # Sets the Rails environment.
4797
+ #
4798
+ # Rails.env = "staging" # => "staging"
4799
+ def self.env=: (untyped environment) -> untyped
4800
+
4801
+ # Returns all Rails groups for loading based on:
4802
+ #
4803
+ # * The Rails environment;
4804
+ # * The environment variable RAILS_GROUPS;
4805
+ # * The optional envs given as argument and the hash with group dependencies;
4806
+ #
4807
+ # groups assets: [:development, :test]
4808
+ #
4809
+ # # Returns
4810
+ # # => [:default, "development", :assets] for Rails.env == "development"
4811
+ # # => [:default, "production"] for Rails.env == "production"
4812
+ def self.groups: (*untyped groups) -> untyped
4813
+
4814
+ # Returns a Pathname object of the public folder of the current
4815
+ # Rails project, otherwise it returns +nil+ if there is no project:
4816
+ #
4817
+ # Rails.public_path
4818
+ # # => #<Pathname:/Users/someuser/some/path/project/public>
4819
+ def self.public_path: () -> untyped
4820
+
4821
+ def self.autoloaders: () -> untyped
4822
+ end