sorbet-schema 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (89) hide show
  1. checksums.yaml +7 -0
  2. data/.ruby-version +1 -0
  3. data/.standard.yml +6 -0
  4. data/.tool-versions +1 -0
  5. data/CHANGELOG.md +24 -0
  6. data/CODE_OF_CONDUCT.md +84 -0
  7. data/Gemfile +25 -0
  8. data/Gemfile.lock +147 -0
  9. data/LICENSE.txt +21 -0
  10. data/README.md +43 -0
  11. data/Rakefile +22 -0
  12. data/lib/sorbet-schema/hash_transformer.rb +22 -0
  13. data/lib/sorbet-schema/struct_ext.rb +37 -0
  14. data/lib/sorbet-schema/version.rb +5 -0
  15. data/lib/sorbet-schema.rb +27 -0
  16. data/lib/typed/coercion/coercer.rb +18 -0
  17. data/lib/typed/coercion/coercion_error.rb +7 -0
  18. data/lib/typed/coercion/coercion_not_supported_error.rb +7 -0
  19. data/lib/typed/coercion/float_coercer.rb +21 -0
  20. data/lib/typed/coercion/integer_coercer.rb +21 -0
  21. data/lib/typed/coercion/string_coercer.rb +19 -0
  22. data/lib/typed/coercion/struct_coercer.rb +26 -0
  23. data/lib/typed/coercion.rb +26 -0
  24. data/lib/typed/deserialize_error.rb +6 -0
  25. data/lib/typed/field.rb +28 -0
  26. data/lib/typed/hash_serializer.rb +21 -0
  27. data/lib/typed/json_serializer.rb +28 -0
  28. data/lib/typed/parse_error.rb +12 -0
  29. data/lib/typed/schema.rb +10 -0
  30. data/lib/typed/serializer.rb +61 -0
  31. data/lib/typed/validations/field_type_validator.rb +24 -0
  32. data/lib/typed/validations/field_validator.rb +15 -0
  33. data/lib/typed/validations/multiple_validation_error.rb +16 -0
  34. data/lib/typed/validations/required_field_error.rb +14 -0
  35. data/lib/typed/validations/type_mismatch_error.rb +14 -0
  36. data/lib/typed/validations/validated_value.rb +12 -0
  37. data/lib/typed/validations/validation_error.rb +8 -0
  38. data/lib/typed/validations/validation_results.rb +29 -0
  39. data/lib/typed/validations.rb +8 -0
  40. data/sorbet/config +5 -0
  41. data/sorbet/rbi/annotations/rainbow.rbi +269 -0
  42. data/sorbet/rbi/gems/.gitattributes +1 -0
  43. data/sorbet/rbi/gems/ansi@1.5.0.rbi +687 -0
  44. data/sorbet/rbi/gems/ast@2.4.2.rbi +584 -0
  45. data/sorbet/rbi/gems/builder@3.2.4.rbi +504 -0
  46. data/sorbet/rbi/gems/erubi@1.12.0.rbi +145 -0
  47. data/sorbet/rbi/gems/io-console@0.7.2.rbi +8 -0
  48. data/sorbet/rbi/gems/json@2.7.1.rbi +1553 -0
  49. data/sorbet/rbi/gems/language_server-protocol@3.17.0.3.rbi +14237 -0
  50. data/sorbet/rbi/gems/lint_roller@1.1.0.rbi +239 -0
  51. data/sorbet/rbi/gems/minitest-focus@1.4.0.rbi +91 -0
  52. data/sorbet/rbi/gems/minitest-reporters@1.6.1.rbi +1010 -0
  53. data/sorbet/rbi/gems/minitest@5.22.2.rbi +2233 -0
  54. data/sorbet/rbi/gems/netrc@0.11.0.rbi +158 -0
  55. data/sorbet/rbi/gems/parallel@1.24.0.rbi +280 -0
  56. data/sorbet/rbi/gems/parser@3.3.0.5.rbi +5472 -0
  57. data/sorbet/rbi/gems/prettier_print@1.2.1.rbi +951 -0
  58. data/sorbet/rbi/gems/prism@0.24.0.rbi +31040 -0
  59. data/sorbet/rbi/gems/psych@5.1.2.rbi +1731 -0
  60. data/sorbet/rbi/gems/racc@1.7.3.rbi +157 -0
  61. data/sorbet/rbi/gems/rainbow@3.1.1.rbi +402 -0
  62. data/sorbet/rbi/gems/rake@13.1.0.rbi +3027 -0
  63. data/sorbet/rbi/gems/rbi@0.1.9.rbi +3006 -0
  64. data/sorbet/rbi/gems/regexp_parser@2.9.0.rbi +3771 -0
  65. data/sorbet/rbi/gems/reline@0.4.3.rbi +8 -0
  66. data/sorbet/rbi/gems/rexml@3.2.6.rbi +4781 -0
  67. data/sorbet/rbi/gems/rubocop-ast@1.31.1.rbi +7014 -0
  68. data/sorbet/rbi/gems/rubocop-performance@1.20.2.rbi +8 -0
  69. data/sorbet/rbi/gems/rubocop-sorbet@0.7.7.rbi +8 -0
  70. data/sorbet/rbi/gems/rubocop@1.61.0.rbi +57499 -0
  71. data/sorbet/rbi/gems/ruby-progressbar@1.13.0.rbi +1317 -0
  72. data/sorbet/rbi/gems/sorbet-result@1.1.0.rbi +519 -0
  73. data/sorbet/rbi/gems/sorbet-struct-comparable@1.3.0.rbi +34 -0
  74. data/sorbet/rbi/gems/spoom@1.2.4.rbi +3777 -0
  75. data/sorbet/rbi/gems/standard-custom@1.0.2.rbi +8 -0
  76. data/sorbet/rbi/gems/standard-performance@1.3.1.rbi +80 -0
  77. data/sorbet/rbi/gems/standard-sorbet@0.0.2.rbi +52 -0
  78. data/sorbet/rbi/gems/standard@1.34.0.rbi +850 -0
  79. data/sorbet/rbi/gems/stringio@3.1.0.rbi +8 -0
  80. data/sorbet/rbi/gems/syntax_tree@6.2.0.rbi +23133 -0
  81. data/sorbet/rbi/gems/tapioca@0.12.0.rbi +3499 -0
  82. data/sorbet/rbi/gems/thor@1.3.1.rbi +4351 -0
  83. data/sorbet/rbi/gems/unicode-display_width@2.5.0.rbi +65 -0
  84. data/sorbet/rbi/gems/yard-sorbet@0.8.1.rbi +428 -0
  85. data/sorbet/rbi/gems/yard@0.9.36.rbi +18220 -0
  86. data/sorbet/rbi/gems/zeitwerk@2.6.13.rbi +1003 -0
  87. data/sorbet/tapioca/config.yml +4 -0
  88. data/sorbet/tapioca/require.rb +12 -0
  89. metadata +191 -0
@@ -0,0 +1,4351 @@
1
+ # typed: true
2
+
3
+ # DO NOT EDIT MANUALLY
4
+ # This is an autogenerated file for types exported from the `thor` gem.
5
+ # Please instead update this file by running `bin/tapioca gem thor`.
6
+
7
+ # source://thor//lib/thor/shell/lcs_diff.rb#1
8
+ module LCSDiff
9
+ protected
10
+
11
+ # Overwrite show_diff to show diff with colors if Diff::LCS is
12
+ # available.
13
+ #
14
+ # source://thor//lib/thor/shell/lcs_diff.rb#6
15
+ def show_diff(destination, content); end
16
+
17
+ private
18
+
19
+ # Check if Diff::LCS is loaded. If it is, use it to create pretty output
20
+ # for diff.
21
+ #
22
+ # @return [Boolean]
23
+ #
24
+ # source://thor//lib/thor/shell/lcs_diff.rb#37
25
+ def diff_lcs_loaded?; end
26
+
27
+ # source://thor//lib/thor/shell/lcs_diff.rb#21
28
+ def output_diff_line(diff); end
29
+ end
30
+
31
+ # source://thor//lib/thor/command.rb#1
32
+ class Thor
33
+ include ::Thor::Base
34
+ include ::Thor::Invocation
35
+ include ::Thor::Shell
36
+ extend ::Thor::Base::ClassMethods
37
+ extend ::Thor::Invocation::ClassMethods
38
+
39
+ # source://thor//lib/thor.rb#652
40
+ def help(command = T.unsafe(nil), subcommand = T.unsafe(nil)); end
41
+
42
+ class << self
43
+ # Adds and declares option group for required at least one of options in the
44
+ # block of arguments. You can declare options as the outside of the block.
45
+ #
46
+ # If :for is given as option, it allows you to change the options from
47
+ # a previous defined command.
48
+ #
49
+ # ==== Parameters
50
+ # Array[Thor::Option.name]
51
+ # options<Hash>:: :for is applied for previous defined command.
52
+ #
53
+ # ==== Examples
54
+ #
55
+ # at_least_one do
56
+ # option :one
57
+ # option :two
58
+ # end
59
+ #
60
+ # Or
61
+ #
62
+ # option :one
63
+ # option :two
64
+ # at_least_one :one, :two
65
+ #
66
+ # If you do not give "--one" and "--two" AtLeastOneRequiredArgumentError
67
+ # will be raised.
68
+ #
69
+ # You can use at_least_one and exclusive at the same time.
70
+ #
71
+ # exclusive do
72
+ # at_least_one do
73
+ # option :one
74
+ # option :two
75
+ # end
76
+ # end
77
+ #
78
+ # Then it is required either only one of "--one" or "--two".
79
+ #
80
+ # source://thor//lib/thor.rb#246
81
+ def at_least_one(*args, &block); end
82
+
83
+ # Extend check unknown options to accept a hash of conditions.
84
+ #
85
+ # === Parameters
86
+ # options<Hash>: A hash containing :only and/or :except keys
87
+ #
88
+ # source://thor//lib/thor.rb#350
89
+ def check_unknown_options!(options = T.unsafe(nil)); end
90
+
91
+ # Overwrite check_unknown_options? to take subcommands and options into account.
92
+ #
93
+ # @return [Boolean]
94
+ #
95
+ # source://thor//lib/thor.rb#363
96
+ def check_unknown_options?(config); end
97
+
98
+ # Prints help information for the given command.
99
+ #
100
+ # ==== Parameters
101
+ # shell<Thor::Shell>
102
+ # command_name<String>
103
+ #
104
+ # source://thor//lib/thor.rb#258
105
+ def command_help(shell, command_name); end
106
+
107
+ # Sets the default command when thor is executed without an explicit command to be called.
108
+ #
109
+ # ==== Parameters
110
+ # meth<Symbol>:: name of the default command
111
+ #
112
+ # source://thor//lib/thor.rb#21
113
+ def default_command(meth = T.unsafe(nil)); end
114
+
115
+ # Sets the default command when thor is executed without an explicit command to be called.
116
+ #
117
+ # ==== Parameters
118
+ # meth<Symbol>:: name of the default command
119
+ #
120
+ # source://thor//lib/thor.rb#21
121
+ def default_task(meth = T.unsafe(nil)); end
122
+
123
+ # source://thor//lib/thor/base.rb#26
124
+ def deprecation_warning(message); end
125
+
126
+ # Defines the usage and the description of the next command.
127
+ #
128
+ # ==== Parameters
129
+ # usage<String>
130
+ # description<String>
131
+ # options<String>
132
+ #
133
+ # source://thor//lib/thor.rb#54
134
+ def desc(usage, description, options = T.unsafe(nil)); end
135
+
136
+ # Disable the check for required options for the given commands.
137
+ # This is useful if you have a command that does not need the required options
138
+ # to work, like help.
139
+ #
140
+ # ==== Parameters
141
+ # Symbol ...:: A list of commands that should be affected.
142
+ #
143
+ # source://thor//lib/thor.rb#434
144
+ def disable_required_check!(*command_names); end
145
+
146
+ # @return [Boolean]
147
+ #
148
+ # source://thor//lib/thor.rb#438
149
+ def disable_required_check?(command); end
150
+
151
+ # Adds and declares option group for exclusive options in the
152
+ # block and arguments. You can declare options as the outside of the block.
153
+ #
154
+ # If :for is given as option, it allows you to change the options from
155
+ # a previous defined command.
156
+ #
157
+ # ==== Parameters
158
+ # Array[Thor::Option.name]
159
+ # options<Hash>:: :for is applied for previous defined command.
160
+ #
161
+ # ==== Examples
162
+ #
163
+ # exclusive do
164
+ # option :one
165
+ # option :two
166
+ # end
167
+ #
168
+ # Or
169
+ #
170
+ # option :one
171
+ # option :two
172
+ # exclusive :one, :two
173
+ #
174
+ # If you give "--one" and "--two" at the same time ExclusiveArgumentsError
175
+ # will be raised.
176
+ #
177
+ # source://thor//lib/thor.rb#203
178
+ def exclusive(*args, &block); end
179
+
180
+ # Prints help information for this class.
181
+ #
182
+ # ==== Parameters
183
+ # shell<Thor::Shell>
184
+ #
185
+ # source://thor//lib/thor.rb#288
186
+ def help(shell, subcommand = T.unsafe(nil)); end
187
+
188
+ # Defines the long description of the next command.
189
+ #
190
+ # Long description is by default indented, line-wrapped and repeated whitespace merged.
191
+ # In order to print long description verbatim, with indentation and spacing exactly
192
+ # as found in the code, use the +wrap+ option
193
+ #
194
+ # long_desc 'your very long description', wrap: false
195
+ #
196
+ # ==== Parameters
197
+ # long description<String>
198
+ # options<Hash>
199
+ #
200
+ # source://thor//lib/thor.rb#78
201
+ def long_desc(long_description, options = T.unsafe(nil)); end
202
+
203
+ # Maps an input to a command. If you define:
204
+ #
205
+ # map "-T" => "list"
206
+ #
207
+ # Running:
208
+ #
209
+ # thor -T
210
+ #
211
+ # Will invoke the list command.
212
+ #
213
+ # ==== Parameters
214
+ # Hash[String|Array => Symbol]:: Maps the string or the strings in the array to the given command.
215
+ #
216
+ # source://thor//lib/thor.rb#101
217
+ def map(mappings = T.unsafe(nil), **kw); end
218
+
219
+ # Adds and declares option group for required at least one of options in the
220
+ # block of arguments. You can declare options as the outside of the block.
221
+ #
222
+ # If :for is given as option, it allows you to change the options from
223
+ # a previous defined command.
224
+ #
225
+ # ==== Parameters
226
+ # Array[Thor::Option.name]
227
+ # options<Hash>:: :for is applied for previous defined command.
228
+ #
229
+ # ==== Examples
230
+ #
231
+ # at_least_one do
232
+ # option :one
233
+ # option :two
234
+ # end
235
+ #
236
+ # Or
237
+ #
238
+ # option :one
239
+ # option :two
240
+ # at_least_one :one, :two
241
+ #
242
+ # If you do not give "--one" and "--two" AtLeastOneRequiredArgumentError
243
+ # will be raised.
244
+ #
245
+ # You can use at_least_one and exclusive at the same time.
246
+ #
247
+ # exclusive do
248
+ # at_least_one do
249
+ # option :one
250
+ # option :two
251
+ # end
252
+ # end
253
+ #
254
+ # Then it is required either only one of "--one" or "--two".
255
+ #
256
+ # source://thor//lib/thor.rb#246
257
+ def method_at_least_one(*args, &block); end
258
+
259
+ # Adds and declares option group for exclusive options in the
260
+ # block and arguments. You can declare options as the outside of the block.
261
+ #
262
+ # If :for is given as option, it allows you to change the options from
263
+ # a previous defined command.
264
+ #
265
+ # ==== Parameters
266
+ # Array[Thor::Option.name]
267
+ # options<Hash>:: :for is applied for previous defined command.
268
+ #
269
+ # ==== Examples
270
+ #
271
+ # exclusive do
272
+ # option :one
273
+ # option :two
274
+ # end
275
+ #
276
+ # Or
277
+ #
278
+ # option :one
279
+ # option :two
280
+ # exclusive :one, :two
281
+ #
282
+ # If you give "--one" and "--two" at the same time ExclusiveArgumentsError
283
+ # will be raised.
284
+ #
285
+ # source://thor//lib/thor.rb#203
286
+ def method_exclusive(*args, &block); end
287
+
288
+ # Adds an option to the set of method options. If :for is given as option,
289
+ # it allows you to change the options from a previous defined command.
290
+ #
291
+ # def previous_command
292
+ # # magic
293
+ # end
294
+ #
295
+ # method_option :foo, :for => :previous_command
296
+ #
297
+ # def next_command
298
+ # # magic
299
+ # end
300
+ #
301
+ # ==== Parameters
302
+ # name<Symbol>:: The name of the argument.
303
+ # options<Hash>:: Described below.
304
+ #
305
+ # ==== Options
306
+ # :desc - Description for the argument.
307
+ # :required - If the argument is required or not.
308
+ # :default - Default value for this argument. It cannot be required and have default values.
309
+ # :aliases - Aliases for this option.
310
+ # :type - The type of the argument, can be :string, :hash, :array, :numeric or :boolean.
311
+ # :banner - String to show on usage notes.
312
+ # :hide - If you want to hide this option from the help.
313
+ #
314
+ # source://thor//lib/thor.rb#163
315
+ def method_option(name, options = T.unsafe(nil)); end
316
+
317
+ # Declares the options for the next command to be declared.
318
+ #
319
+ # ==== Parameters
320
+ # Hash[Symbol => Object]:: The hash key is the name of the option and the value
321
+ # is the type of the option. Can be :string, :array, :hash, :boolean, :numeric
322
+ # or :required (string). If you give a value, the type of the value is used.
323
+ #
324
+ # source://thor//lib/thor.rb#129
325
+ def method_options(options = T.unsafe(nil)); end
326
+
327
+ # Adds an option to the set of method options. If :for is given as option,
328
+ # it allows you to change the options from a previous defined command.
329
+ #
330
+ # def previous_command
331
+ # # magic
332
+ # end
333
+ #
334
+ # method_option :foo, :for => :previous_command
335
+ #
336
+ # def next_command
337
+ # # magic
338
+ # end
339
+ #
340
+ # ==== Parameters
341
+ # name<Symbol>:: The name of the argument.
342
+ # options<Hash>:: Described below.
343
+ #
344
+ # ==== Options
345
+ # :desc - Description for the argument.
346
+ # :required - If the argument is required or not.
347
+ # :default - Default value for this argument. It cannot be required and have default values.
348
+ # :aliases - Aliases for this option.
349
+ # :type - The type of the argument, can be :string, :hash, :array, :numeric or :boolean.
350
+ # :banner - String to show on usage notes.
351
+ # :hide - If you want to hide this option from the help.
352
+ #
353
+ # source://thor//lib/thor.rb#163
354
+ def option(name, options = T.unsafe(nil)); end
355
+
356
+ # Declares the options for the next command to be declared.
357
+ #
358
+ # ==== Parameters
359
+ # Hash[Symbol => Object]:: The hash key is the name of the option and the value
360
+ # is the type of the option. Can be :string, :array, :hash, :boolean, :numeric
361
+ # or :required (string). If you give a value, the type of the value is used.
362
+ #
363
+ # source://thor//lib/thor.rb#129
364
+ def options(options = T.unsafe(nil)); end
365
+
366
+ # Allows for custom "Command" package naming.
367
+ #
368
+ # === Parameters
369
+ # name<String>
370
+ # options<Hash>
371
+ #
372
+ # source://thor//lib/thor.rb#12
373
+ def package_name(name, _ = T.unsafe(nil)); end
374
+
375
+ # Returns commands ready to be printed.
376
+ #
377
+ # source://thor//lib/thor.rb#309
378
+ def printable_commands(all = T.unsafe(nil), subcommand = T.unsafe(nil)); end
379
+
380
+ # Returns commands ready to be printed.
381
+ #
382
+ # source://thor//lib/thor.rb#309
383
+ def printable_tasks(all = T.unsafe(nil), subcommand = T.unsafe(nil)); end
384
+
385
+ # Registers another Thor subclass as a command.
386
+ #
387
+ # ==== Parameters
388
+ # klass<Class>:: Thor subclass to register
389
+ # command<String>:: Subcommand name to use
390
+ # usage<String>:: Short usage for the subcommand
391
+ # description<String>:: Description for the subcommand
392
+ #
393
+ # source://thor//lib/thor.rb#37
394
+ def register(klass, subcommand_name, usage, description, options = T.unsafe(nil)); end
395
+
396
+ # Stop parsing of options as soon as an unknown option or a regular
397
+ # argument is encountered. All remaining arguments are passed to the command.
398
+ # This is useful if you have a command that can receive arbitrary additional
399
+ # options, and where those additional options should not be handled by
400
+ # Thor.
401
+ #
402
+ # ==== Example
403
+ #
404
+ # To better understand how this is useful, let's consider a command that calls
405
+ # an external command. A user may want to pass arbitrary options and
406
+ # arguments to that command. The command itself also accepts some options,
407
+ # which should be handled by Thor.
408
+ #
409
+ # class_option "verbose", :type => :boolean
410
+ # stop_on_unknown_option! :exec
411
+ # check_unknown_options! :except => :exec
412
+ #
413
+ # desc "exec", "Run a shell command"
414
+ # def exec(*args)
415
+ # puts "diagnostic output" if options[:verbose]
416
+ # Kernel.exec(*args)
417
+ # end
418
+ #
419
+ # Here +exec+ can be called with +--verbose+ to get diagnostic output,
420
+ # e.g.:
421
+ #
422
+ # $ thor exec --verbose echo foo
423
+ # diagnostic output
424
+ # foo
425
+ #
426
+ # But if +--verbose+ is given after +echo+, it is passed to +echo+ instead:
427
+ #
428
+ # $ thor exec echo --verbose foo
429
+ # --verbose foo
430
+ #
431
+ # ==== Parameters
432
+ # Symbol ...:: A list of commands that should be affected.
433
+ #
434
+ # source://thor//lib/thor.rb#420
435
+ def stop_on_unknown_option!(*command_names); end
436
+
437
+ # @return [Boolean]
438
+ #
439
+ # source://thor//lib/thor.rb#424
440
+ def stop_on_unknown_option?(command); end
441
+
442
+ # source://thor//lib/thor.rb#329
443
+ def subcommand(subcommand, subcommand_class); end
444
+
445
+ # source://thor//lib/thor.rb#325
446
+ def subcommand_classes; end
447
+
448
+ # source://thor//lib/thor.rb#320
449
+ def subcommands; end
450
+
451
+ # source://thor//lib/thor.rb#329
452
+ def subtask(subcommand, subcommand_class); end
453
+
454
+ # source://thor//lib/thor.rb#320
455
+ def subtasks; end
456
+
457
+ # Prints help information for the given command.
458
+ #
459
+ # ==== Parameters
460
+ # shell<Thor::Shell>
461
+ # command_name<String>
462
+ #
463
+ # source://thor//lib/thor.rb#258
464
+ def task_help(shell, command_name); end
465
+
466
+ protected
467
+
468
+ # The banner for this class. You can customize it if you are invoking the
469
+ # thor class by another ways which is not the Thor::Runner. It receives
470
+ # the command that is going to be invoked and a boolean which indicates if
471
+ # the namespace should be displayed as arguments.
472
+ #
473
+ # source://thor//lib/thor.rb#535
474
+ def banner(command, namespace = T.unsafe(nil), subcommand = T.unsafe(nil)); end
475
+
476
+ # source://thor//lib/thor.rb#541
477
+ def baseclass; end
478
+
479
+ # source://thor//lib/thor.rb#549
480
+ def create_command(meth); end
481
+
482
+ # source://thor//lib/thor.rb#549
483
+ def create_task(meth); end
484
+
485
+ # help command has the required check disabled by default.
486
+ #
487
+ # source://thor//lib/thor.rb#467
488
+ def disable_required_check; end
489
+
490
+ # The method responsible for dispatching given the args.
491
+ #
492
+ # @yield [instance]
493
+ #
494
+ # source://thor//lib/thor.rb#494
495
+ def dispatch(meth, given_args, given_opts, config); end
496
+
497
+ # source://thor//lib/thor.rb#545
498
+ def dynamic_command_class; end
499
+
500
+ # this is the logic that takes the command name passed in by the user
501
+ # and determines whether it is an unambiguous substrings of a command or
502
+ # alias name.
503
+ #
504
+ # source://thor//lib/thor.rb#615
505
+ def find_command_possibilities(meth); end
506
+
507
+ # this is the logic that takes the command name passed in by the user
508
+ # and determines whether it is an unambiguous substrings of a command or
509
+ # alias name.
510
+ #
511
+ # source://thor//lib/thor.rb#615
512
+ def find_task_possibilities(meth); end
513
+
514
+ # source://thor//lib/thor.rb#575
515
+ def initialize_added; end
516
+
517
+ # Returns this class at least one of required options array set.
518
+ #
519
+ # ==== Returns
520
+ # Array[Array[Thor::Option.name]]
521
+ #
522
+ # source://thor//lib/thor.rb#458
523
+ def method_at_least_one_option_names; end
524
+
525
+ # Returns this class exclusive options array set.
526
+ #
527
+ # ==== Returns
528
+ # Array[Array[Thor::Option.name]]
529
+ #
530
+ # source://thor//lib/thor.rb#449
531
+ def method_exclusive_option_names; end
532
+
533
+ # receives a (possibly nil) command name and returns a name that is in
534
+ # the commands hash. In addition to normalizing aliases, this logic
535
+ # will determine if a shortened command is an unambiguous substring of
536
+ # a command or alias.
537
+ #
538
+ # +normalize_command_name+ also converts names like +animal-prison+
539
+ # into +animal_prison+.
540
+ #
541
+ # @raise [AmbiguousTaskError]
542
+ #
543
+ # source://thor//lib/thor.rb#594
544
+ def normalize_command_name(meth); end
545
+
546
+ # receives a (possibly nil) command name and returns a name that is in
547
+ # the commands hash. In addition to normalizing aliases, this logic
548
+ # will determine if a shortened command is an unambiguous substring of
549
+ # a command or alias.
550
+ #
551
+ # +normalize_command_name+ also converts names like +animal-prison+
552
+ # into +animal_prison+.
553
+ #
554
+ # @raise [AmbiguousTaskError]
555
+ #
556
+ # source://thor//lib/thor.rb#594
557
+ def normalize_task_name(meth); end
558
+
559
+ # source://thor//lib/thor.rb#482
560
+ def print_at_least_one_required_options(shell, command = T.unsafe(nil)); end
561
+
562
+ # source://thor//lib/thor.rb#471
563
+ def print_exclusive_options(shell, command = T.unsafe(nil)); end
564
+
565
+ # Retrieve the command name from given args.
566
+ #
567
+ # source://thor//lib/thor.rb#581
568
+ def retrieve_command_name(args); end
569
+
570
+ # Retrieve the command name from given args.
571
+ #
572
+ # source://thor//lib/thor.rb#581
573
+ def retrieve_task_name(args); end
574
+
575
+ # Sort the commands, lexicographically by default.
576
+ #
577
+ # Can be overridden in the subclass to change the display order of the
578
+ # commands.
579
+ #
580
+ # source://thor//lib/thor.rb#642
581
+ def sort_commands!(list); end
582
+
583
+ # source://thor//lib/thor.rb#462
584
+ def stop_on_unknown_option; end
585
+
586
+ # source://thor//lib/thor.rb#630
587
+ def subcommand_help(cmd); end
588
+
589
+ # source://thor//lib/thor.rb#630
590
+ def subtask_help(cmd); end
591
+ end
592
+ end
593
+
594
+ # source://thor//lib/thor/actions/empty_directory.rb#2
595
+ module Thor::Actions
596
+ mixes_in_class_methods ::Thor::Actions::ClassMethods
597
+
598
+ # Extends initializer to add more configuration options.
599
+ #
600
+ # ==== Configuration
601
+ # behavior<Symbol>:: The actions default behavior. Can be :invoke or :revoke.
602
+ # It also accepts :force, :skip and :pretend to set the behavior
603
+ # and the respective option.
604
+ #
605
+ # destination_root<String>:: The root directory needed for some actions.
606
+ #
607
+ # source://thor//lib/thor/actions.rb#72
608
+ def initialize(args = T.unsafe(nil), options = T.unsafe(nil), config = T.unsafe(nil)); end
609
+
610
+ # Wraps an action object and call it accordingly to the thor class behavior.
611
+ #
612
+ # source://thor//lib/thor/actions.rb#89
613
+ def action(instance); end
614
+
615
+ # Create a new file relative to the destination root with the given data,
616
+ # which is the return value of a block or a data string.
617
+ #
618
+ # ==== Parameters
619
+ # destination<String>:: the relative path to the destination root.
620
+ # data<String|NilClass>:: the data to append to the file.
621
+ # config<Hash>:: give :verbose => false to not log the status.
622
+ #
623
+ # ==== Examples
624
+ #
625
+ # create_file "lib/fun_party.rb" do
626
+ # hostname = ask("What is the virtual hostname I should use?")
627
+ # "vhost.name = #{hostname}"
628
+ # end
629
+ #
630
+ # create_file "config/apache.conf", "your apache config"
631
+ #
632
+ # source://thor//lib/thor/actions/create_file.rb#22
633
+ def add_file(destination, *args, &block); end
634
+
635
+ # Create a new file relative to the destination root from the given source.
636
+ #
637
+ # ==== Parameters
638
+ # destination<String>:: the relative path to the destination root.
639
+ # source<String|NilClass>:: the relative path to the source root.
640
+ # config<Hash>:: give :verbose => false to not log the status.
641
+ # :: give :symbolic => false for hard link.
642
+ #
643
+ # ==== Examples
644
+ #
645
+ # create_link "config/apache.conf", "/etc/apache.conf"
646
+ #
647
+ # source://thor//lib/thor/actions/create_link.rb#17
648
+ def add_link(destination, *args); end
649
+
650
+ # Append text to a file. Since it depends on insert_into_file, it's reversible.
651
+ #
652
+ # ==== Parameters
653
+ # path<String>:: path of the file to be changed
654
+ # data<String>:: the data to append to the file, can be also given as a block.
655
+ # config<Hash>:: give :verbose => false to not log the status.
656
+ #
657
+ # ==== Example
658
+ #
659
+ # append_to_file 'config/environments/test.rb', 'config.gem "rspec"'
660
+ #
661
+ # append_to_file 'config/environments/test.rb' do
662
+ # 'config.gem "rspec"'
663
+ # end
664
+ #
665
+ # source://thor//lib/thor/actions/file_manipulation.rb#192
666
+ def append_file(path, *args, &block); end
667
+
668
+ # Append text to a file. Since it depends on insert_into_file, it's reversible.
669
+ #
670
+ # ==== Parameters
671
+ # path<String>:: path of the file to be changed
672
+ # data<String>:: the data to append to the file, can be also given as a block.
673
+ # config<Hash>:: give :verbose => false to not log the status.
674
+ #
675
+ # ==== Example
676
+ #
677
+ # append_to_file 'config/environments/test.rb', 'config.gem "rspec"'
678
+ #
679
+ # append_to_file 'config/environments/test.rb' do
680
+ # 'config.gem "rspec"'
681
+ # end
682
+ #
683
+ # source://thor//lib/thor/actions/file_manipulation.rb#192
684
+ def append_to_file(path, *args, &block); end
685
+
686
+ # Loads an external file and execute it in the instance binding.
687
+ #
688
+ # ==== Parameters
689
+ # path<String>:: The path to the file to execute. Can be a web address or
690
+ # a relative path from the source root.
691
+ #
692
+ # ==== Examples
693
+ #
694
+ # apply "http://gist.github.com/103208"
695
+ #
696
+ # apply "recipes/jquery.rb"
697
+ #
698
+ # source://thor//lib/thor/actions.rb#216
699
+ def apply(path, config = T.unsafe(nil)); end
700
+
701
+ # Returns the value of attribute behavior.
702
+ #
703
+ # source://thor//lib/thor/actions.rb#10
704
+ def behavior; end
705
+
706
+ # Sets the attribute behavior
707
+ #
708
+ # @param value the value to set the attribute behavior to.
709
+ #
710
+ # source://thor//lib/thor/actions.rb#10
711
+ def behavior=(_arg0); end
712
+
713
+ # Changes the mode of the given file or directory.
714
+ #
715
+ # ==== Parameters
716
+ # mode<Integer>:: the file mode
717
+ # path<String>:: the name of the file to change mode
718
+ # config<Hash>:: give :verbose => false to not log the status.
719
+ #
720
+ # ==== Example
721
+ #
722
+ # chmod "script/server", 0755
723
+ #
724
+ # source://thor//lib/thor/actions/file_manipulation.rb#145
725
+ def chmod(path, mode, config = T.unsafe(nil)); end
726
+
727
+ # Comment all lines matching a given regex. It will leave the space
728
+ # which existed before the beginning of the line in tact and will insert
729
+ # a single space after the comment hash.
730
+ #
731
+ # ==== Parameters
732
+ # path<String>:: path of the file to be changed
733
+ # flag<Regexp|String>:: the regexp or string used to decide which lines to comment
734
+ # config<Hash>:: give :verbose => false to not log the status.
735
+ #
736
+ # ==== Example
737
+ #
738
+ # comment_lines 'config/initializers/session_store.rb', /cookie_store/
739
+ #
740
+ # source://thor//lib/thor/actions/file_manipulation.rb#308
741
+ def comment_lines(path, flag, *args); end
742
+
743
+ # Copies the file from the relative source to the relative destination. If
744
+ # the destination is not given it's assumed to be equal to the source.
745
+ #
746
+ # ==== Parameters
747
+ # source<String>:: the relative path to the source root.
748
+ # destination<String>:: the relative path to the destination root.
749
+ # config<Hash>:: give :verbose => false to not log the status, and
750
+ # :mode => :preserve, to preserve the file mode from the source.
751
+ #
752
+ # ==== Examples
753
+ #
754
+ # copy_file "README", "doc/README"
755
+ #
756
+ # copy_file "doc/README"
757
+ #
758
+ # source://thor//lib/thor/actions/file_manipulation.rb#20
759
+ def copy_file(source, *args, &block); end
760
+
761
+ # Create a new file relative to the destination root with the given data,
762
+ # which is the return value of a block or a data string.
763
+ #
764
+ # ==== Parameters
765
+ # destination<String>:: the relative path to the destination root.
766
+ # data<String|NilClass>:: the data to append to the file.
767
+ # config<Hash>:: give :verbose => false to not log the status.
768
+ #
769
+ # ==== Examples
770
+ #
771
+ # create_file "lib/fun_party.rb" do
772
+ # hostname = ask("What is the virtual hostname I should use?")
773
+ # "vhost.name = #{hostname}"
774
+ # end
775
+ #
776
+ # create_file "config/apache.conf", "your apache config"
777
+ #
778
+ # source://thor//lib/thor/actions/create_file.rb#22
779
+ def create_file(destination, *args, &block); end
780
+
781
+ # Create a new file relative to the destination root from the given source.
782
+ #
783
+ # ==== Parameters
784
+ # destination<String>:: the relative path to the destination root.
785
+ # source<String|NilClass>:: the relative path to the source root.
786
+ # config<Hash>:: give :verbose => false to not log the status.
787
+ # :: give :symbolic => false for hard link.
788
+ #
789
+ # ==== Examples
790
+ #
791
+ # create_link "config/apache.conf", "/etc/apache.conf"
792
+ #
793
+ # source://thor//lib/thor/actions/create_link.rb#17
794
+ def create_link(destination, *args); end
795
+
796
+ # Returns the root for this thor class (also aliased as destination root).
797
+ #
798
+ # source://thor//lib/thor/actions.rb#99
799
+ def destination_root; end
800
+
801
+ # Sets the root for this thor class. Relatives path are added to the
802
+ # directory where the script was invoked and expanded.
803
+ #
804
+ # source://thor//lib/thor/actions.rb#106
805
+ def destination_root=(root); end
806
+
807
+ # Copies recursively the files from source directory to root directory.
808
+ # If any of the files finishes with .tt, it's considered to be a template
809
+ # and is placed in the destination without the extension .tt. If any
810
+ # empty directory is found, it's copied and all .empty_directory files are
811
+ # ignored. If any file name is wrapped within % signs, the text within
812
+ # the % signs will be executed as a method and replaced with the returned
813
+ # value. Let's suppose a doc directory with the following files:
814
+ #
815
+ # doc/
816
+ # components/.empty_directory
817
+ # README
818
+ # rdoc.rb.tt
819
+ # %app_name%.rb
820
+ #
821
+ # When invoked as:
822
+ #
823
+ # directory "doc"
824
+ #
825
+ # It will create a doc directory in the destination with the following
826
+ # files (assuming that the `app_name` method returns the value "blog"):
827
+ #
828
+ # doc/
829
+ # components/
830
+ # README
831
+ # rdoc.rb
832
+ # blog.rb
833
+ #
834
+ # <b>Encoded path note:</b> Since Thor internals use Object#respond_to? to check if it can
835
+ # expand %something%, this `something` should be a public method in the class calling
836
+ # #directory. If a method is private, Thor stack raises PrivateMethodEncodedError.
837
+ #
838
+ # ==== Parameters
839
+ # source<String>:: the relative path to the source root.
840
+ # destination<String>:: the relative path to the destination root.
841
+ # config<Hash>:: give :verbose => false to not log the status.
842
+ # If :recursive => false, does not look for paths recursively.
843
+ # If :mode => :preserve, preserve the file mode from the source.
844
+ # If :exclude_pattern => /regexp/, prevents copying files that match that regexp.
845
+ #
846
+ # ==== Examples
847
+ #
848
+ # directory "doc"
849
+ # directory "doc", "docs", :recursive => false
850
+ #
851
+ # source://thor//lib/thor/actions/directory.rb#49
852
+ def directory(source, *args, &block); end
853
+
854
+ # Creates an empty directory.
855
+ #
856
+ # ==== Parameters
857
+ # destination<String>:: the relative path to the destination root.
858
+ # config<Hash>:: give :verbose => false to not log the status.
859
+ #
860
+ # ==== Examples
861
+ #
862
+ # empty_directory "doc"
863
+ #
864
+ # source://thor//lib/thor/actions/empty_directory.rb#13
865
+ def empty_directory(destination, config = T.unsafe(nil)); end
866
+
867
+ # Receives a file or directory and search for it in the source paths.
868
+ #
869
+ # @raise [Error]
870
+ #
871
+ # source://thor//lib/thor/actions.rb#133
872
+ def find_in_source_paths(file); end
873
+
874
+ # Gets the content at the given address and places it at the given relative
875
+ # destination. If a block is given instead of destination, the content of
876
+ # the url is yielded and used as location.
877
+ #
878
+ # +get+ relies on open-uri, so passing application user input would provide
879
+ # a command injection attack vector.
880
+ #
881
+ # ==== Parameters
882
+ # source<String>:: the address of the given content.
883
+ # destination<String>:: the relative path to the destination root.
884
+ # config<Hash>:: give :verbose => false to not log the status, and
885
+ # :http_headers => <Hash> to add headers to an http request.
886
+ #
887
+ # ==== Examples
888
+ #
889
+ # get "http://gist.github.com/103208", "doc/README"
890
+ #
891
+ # get "http://gist.github.com/103208", "doc/README", :http_headers => {"Content-Type" => "application/json"}
892
+ #
893
+ # get "http://gist.github.com/103208" do |content|
894
+ # content.split("\n").first
895
+ # end
896
+ #
897
+ # source://thor//lib/thor/actions/file_manipulation.rb#81
898
+ def get(source, *args, &block); end
899
+
900
+ # Run a regular expression replacement on a file.
901
+ #
902
+ # ==== Parameters
903
+ # path<String>:: path of the file to be changed
904
+ # flag<Regexp|String>:: the regexp or string to be replaced
905
+ # replacement<String>:: the replacement, can be also given as a block
906
+ # config<Hash>:: give :verbose => false to not log the status, and
907
+ # :force => true, to force the replacement regardless of runner behavior.
908
+ #
909
+ # ==== Example
910
+ #
911
+ # gsub_file 'app/controllers/application_controller.rb', /#\s*(filter_parameter_logging :password)/, '\1'
912
+ #
913
+ # gsub_file 'README', /rake/, :green do |match|
914
+ # match << " no more. Use thor!"
915
+ # end
916
+ #
917
+ # source://thor//lib/thor/actions/file_manipulation.rb#262
918
+ def gsub_file(path, flag, *args, &block); end
919
+
920
+ # Goes to the root and execute the given block.
921
+ #
922
+ # source://thor//lib/thor/actions.rb#200
923
+ def in_root; end
924
+
925
+ # Injects text right after the class definition. Since it depends on
926
+ # insert_into_file, it's reversible.
927
+ #
928
+ # ==== Parameters
929
+ # path<String>:: path of the file to be changed
930
+ # klass<String|Class>:: the class to be manipulated
931
+ # data<String>:: the data to append to the class, can be also given as a block.
932
+ # config<Hash>:: give :verbose => false to not log the status.
933
+ #
934
+ # ==== Examples
935
+ #
936
+ # inject_into_class "app/controllers/application_controller.rb", "ApplicationController", " filter_parameter :password\n"
937
+ #
938
+ # inject_into_class "app/controllers/application_controller.rb", "ApplicationController" do
939
+ # " filter_parameter :password\n"
940
+ # end
941
+ #
942
+ # source://thor//lib/thor/actions/file_manipulation.rb#216
943
+ def inject_into_class(path, klass, *args, &block); end
944
+
945
+ # source://thor//lib/thor/actions/inject_into_file.rb#26
946
+ def inject_into_file(destination, *args, &block); end
947
+
948
+ # Injects text right after the module definition. Since it depends on
949
+ # insert_into_file, it's reversible.
950
+ #
951
+ # ==== Parameters
952
+ # path<String>:: path of the file to be changed
953
+ # module_name<String|Class>:: the module to be manipulated
954
+ # data<String>:: the data to append to the class, can be also given as a block.
955
+ # config<Hash>:: give :verbose => false to not log the status.
956
+ #
957
+ # ==== Examples
958
+ #
959
+ # inject_into_module "app/helpers/application_helper.rb", "ApplicationHelper", " def help; 'help'; end\n"
960
+ #
961
+ # inject_into_module "app/helpers/application_helper.rb", "ApplicationHelper" do
962
+ # " def help; 'help'; end\n"
963
+ # end
964
+ #
965
+ # source://thor//lib/thor/actions/file_manipulation.rb#239
966
+ def inject_into_module(path, module_name, *args, &block); end
967
+
968
+ # source://thor//lib/thor/actions/inject_into_file.rb#26
969
+ def insert_into_file(destination, *args, &block); end
970
+
971
+ # Do something in the root or on a provided subfolder. If a relative path
972
+ # is given it's referenced from the current root. The full path is yielded
973
+ # to the block you provide. The path is set back to the previous path when
974
+ # the method exits.
975
+ #
976
+ # Returns the value yielded by the block.
977
+ #
978
+ # ==== Parameters
979
+ # dir<String>:: the directory to move to.
980
+ # config<Hash>:: give :verbose => true to log and use padding.
981
+ #
982
+ # source://thor//lib/thor/actions.rb#170
983
+ def inside(dir = T.unsafe(nil), config = T.unsafe(nil), &block); end
984
+
985
+ # Links the file from the relative source to the relative destination. If
986
+ # the destination is not given it's assumed to be equal to the source.
987
+ #
988
+ # ==== Parameters
989
+ # source<String>:: the relative path to the source root.
990
+ # destination<String>:: the relative path to the destination root.
991
+ # config<Hash>:: give :verbose => false to not log the status.
992
+ #
993
+ # ==== Examples
994
+ #
995
+ # link_file "README", "doc/README"
996
+ #
997
+ # link_file "doc/README"
998
+ #
999
+ # source://thor//lib/thor/actions/file_manipulation.rb#50
1000
+ def link_file(source, *args); end
1001
+
1002
+ # Prepend text to a file. Since it depends on insert_into_file, it's reversible.
1003
+ #
1004
+ # ==== Parameters
1005
+ # path<String>:: path of the file to be changed
1006
+ # data<String>:: the data to prepend to the file, can be also given as a block.
1007
+ # config<Hash>:: give :verbose => false to not log the status.
1008
+ #
1009
+ # ==== Example
1010
+ #
1011
+ # prepend_to_file 'config/environments/test.rb', 'config.gem "rspec"'
1012
+ #
1013
+ # prepend_to_file 'config/environments/test.rb' do
1014
+ # 'config.gem "rspec"'
1015
+ # end
1016
+ #
1017
+ # source://thor//lib/thor/actions/file_manipulation.rb#170
1018
+ def prepend_file(path, *args, &block); end
1019
+
1020
+ # Prepend text to a file. Since it depends on insert_into_file, it's reversible.
1021
+ #
1022
+ # ==== Parameters
1023
+ # path<String>:: path of the file to be changed
1024
+ # data<String>:: the data to prepend to the file, can be also given as a block.
1025
+ # config<Hash>:: give :verbose => false to not log the status.
1026
+ #
1027
+ # ==== Example
1028
+ #
1029
+ # prepend_to_file 'config/environments/test.rb', 'config.gem "rspec"'
1030
+ #
1031
+ # prepend_to_file 'config/environments/test.rb' do
1032
+ # 'config.gem "rspec"'
1033
+ # end
1034
+ #
1035
+ # source://thor//lib/thor/actions/file_manipulation.rb#170
1036
+ def prepend_to_file(path, *args, &block); end
1037
+
1038
+ # Returns the given path relative to the absolute root (ie, root where
1039
+ # the script started).
1040
+ #
1041
+ # source://thor//lib/thor/actions.rb#114
1042
+ def relative_to_original_destination_root(path, remove_dot = T.unsafe(nil)); end
1043
+
1044
+ # Removes a file at the given location.
1045
+ #
1046
+ # ==== Parameters
1047
+ # path<String>:: path of the file to be changed
1048
+ # config<Hash>:: give :verbose => false to not log the status.
1049
+ #
1050
+ # ==== Example
1051
+ #
1052
+ # remove_file 'README'
1053
+ # remove_file 'app/controllers/application_controller.rb'
1054
+ #
1055
+ # source://thor//lib/thor/actions/file_manipulation.rb#325
1056
+ def remove_dir(path, config = T.unsafe(nil)); end
1057
+
1058
+ # Removes a file at the given location.
1059
+ #
1060
+ # ==== Parameters
1061
+ # path<String>:: path of the file to be changed
1062
+ # config<Hash>:: give :verbose => false to not log the status.
1063
+ #
1064
+ # ==== Example
1065
+ #
1066
+ # remove_file 'README'
1067
+ # remove_file 'app/controllers/application_controller.rb'
1068
+ #
1069
+ # source://thor//lib/thor/actions/file_manipulation.rb#325
1070
+ def remove_file(path, config = T.unsafe(nil)); end
1071
+
1072
+ # Executes a command returning the contents of the command.
1073
+ #
1074
+ # ==== Parameters
1075
+ # command<String>:: the command to be executed.
1076
+ # config<Hash>:: give :verbose => false to not log the status, :capture => true to hide to output. Specify :with
1077
+ # to append an executable to command execution.
1078
+ #
1079
+ # ==== Example
1080
+ #
1081
+ # inside('vendor') do
1082
+ # run('ln -s ~/edge rails')
1083
+ # end
1084
+ #
1085
+ # source://thor//lib/thor/actions.rb#248
1086
+ def run(command, config = T.unsafe(nil)); end
1087
+
1088
+ # Executes a ruby script (taking into account WIN32 platform quirks).
1089
+ #
1090
+ # ==== Parameters
1091
+ # command<String>:: the command to be executed.
1092
+ # config<Hash>:: give :verbose => false to not log the status.
1093
+ #
1094
+ # source://thor//lib/thor/actions.rb#285
1095
+ def run_ruby_script(command, config = T.unsafe(nil)); end
1096
+
1097
+ # Holds source paths in instance so they can be manipulated.
1098
+ #
1099
+ # source://thor//lib/thor/actions.rb#127
1100
+ def source_paths; end
1101
+
1102
+ # Gets an ERB template at the relative source, executes it and makes a copy
1103
+ # at the relative destination. If the destination is not given it's assumed
1104
+ # to be equal to the source removing .tt from the filename.
1105
+ #
1106
+ # ==== Parameters
1107
+ # source<String>:: the relative path to the source root.
1108
+ # destination<String>:: the relative path to the destination root.
1109
+ # config<Hash>:: give :verbose => false to not log the status.
1110
+ #
1111
+ # ==== Examples
1112
+ #
1113
+ # template "README", "doc/README"
1114
+ #
1115
+ # template "doc/README"
1116
+ #
1117
+ # source://thor//lib/thor/actions/file_manipulation.rb#117
1118
+ def template(source, *args, &block); end
1119
+
1120
+ # Run a thor command. A hash of options can be given and it's converted to
1121
+ # switches.
1122
+ #
1123
+ # ==== Parameters
1124
+ # command<String>:: the command to be invoked
1125
+ # args<Array>:: arguments to the command
1126
+ # config<Hash>:: give :verbose => false to not log the status, :capture => true to hide to output.
1127
+ # Other options are given as parameter to Thor.
1128
+ #
1129
+ #
1130
+ # ==== Examples
1131
+ #
1132
+ # thor :install, "http://gist.github.com/103208"
1133
+ # #=> thor install http://gist.github.com/103208
1134
+ #
1135
+ # thor :list, :all => true, :substring => 'rails'
1136
+ # #=> thor list --all --substring=rails
1137
+ #
1138
+ # source://thor//lib/thor/actions.rb#308
1139
+ def thor(command, *args); end
1140
+
1141
+ # Uncomment all lines matching a given regex. Preserves indentation before
1142
+ # the comment hash and removes the hash and any immediate following space.
1143
+ #
1144
+ # ==== Parameters
1145
+ # path<String>:: path of the file to be changed
1146
+ # flag<Regexp|String>:: the regexp or string used to decide which lines to uncomment
1147
+ # config<Hash>:: give :verbose => false to not log the status.
1148
+ #
1149
+ # ==== Example
1150
+ #
1151
+ # uncomment_lines 'config/initializers/session_store.rb', /active_record/
1152
+ #
1153
+ # source://thor//lib/thor/actions/file_manipulation.rb#289
1154
+ def uncomment_lines(path, flag, *args); end
1155
+
1156
+ protected
1157
+
1158
+ # source://thor//lib/thor/actions.rb#329
1159
+ def _cleanup_options_and_set(options, key); end
1160
+
1161
+ # Allow current root to be shared between invocations.
1162
+ #
1163
+ # source://thor//lib/thor/actions.rb#325
1164
+ def _shared_configuration; end
1165
+
1166
+ private
1167
+
1168
+ # source://thor//lib/thor/actions/file_manipulation.rb#346
1169
+ def capture(*args); end
1170
+
1171
+ # source://thor//lib/thor/actions/file_manipulation.rb#342
1172
+ def concat(string); end
1173
+
1174
+ # Returns the value of attribute output_buffer.
1175
+ #
1176
+ # source://thor//lib/thor/actions/file_manipulation.rb#337
1177
+ def output_buffer; end
1178
+
1179
+ # Sets the attribute output_buffer
1180
+ #
1181
+ # @param value the value to set the attribute output_buffer to.
1182
+ #
1183
+ # source://thor//lib/thor/actions/file_manipulation.rb#337
1184
+ def output_buffer=(_arg0); end
1185
+
1186
+ # source://thor//lib/thor/actions/file_manipulation.rb#350
1187
+ def with_output_buffer(buf = T.unsafe(nil)); end
1188
+
1189
+ class << self
1190
+ # source://thor//lib/thor/actions.rb#12
1191
+ def included(base); end
1192
+ end
1193
+ end
1194
+
1195
+ # Thor::Actions#capture depends on what kind of buffer is used in ERB.
1196
+ # Thus CapturableERB fixes ERB to use String buffer.
1197
+ #
1198
+ # source://thor//lib/thor/actions/file_manipulation.rb#362
1199
+ class Thor::Actions::CapturableERB < ::ERB
1200
+ # source://thor//lib/thor/actions/file_manipulation.rb#363
1201
+ def set_eoutvar(compiler, eoutvar = T.unsafe(nil)); end
1202
+ end
1203
+
1204
+ # source://thor//lib/thor/actions.rb#17
1205
+ module Thor::Actions::ClassMethods
1206
+ # Add runtime options that help actions execution.
1207
+ #
1208
+ # source://thor//lib/thor/actions.rb#48
1209
+ def add_runtime_options!; end
1210
+
1211
+ # Hold source paths for one Thor instance. source_paths_for_search is the
1212
+ # method responsible to gather source_paths from this current class,
1213
+ # inherited paths and the source root.
1214
+ #
1215
+ # source://thor//lib/thor/actions.rb#22
1216
+ def source_paths; end
1217
+
1218
+ # Returns the source paths in the following order:
1219
+ #
1220
+ # 1) This class source paths
1221
+ # 2) Source root
1222
+ # 3) Parents source paths
1223
+ #
1224
+ # source://thor//lib/thor/actions.rb#38
1225
+ def source_paths_for_search; end
1226
+
1227
+ # Stores and return the source root for this class
1228
+ #
1229
+ # source://thor//lib/thor/actions.rb#27
1230
+ def source_root(path = T.unsafe(nil)); end
1231
+ end
1232
+
1233
+ # CreateFile is a subset of Template, which instead of rendering a file with
1234
+ # ERB, it gets the content from the user.
1235
+ #
1236
+ # source://thor//lib/thor/actions/create_file.rb#32
1237
+ class Thor::Actions::CreateFile < ::Thor::Actions::EmptyDirectory
1238
+ # @return [CreateFile] a new instance of CreateFile
1239
+ #
1240
+ # source://thor//lib/thor/actions/create_file.rb#35
1241
+ def initialize(base, destination, data, config = T.unsafe(nil)); end
1242
+
1243
+ # source://thor//lib/thor/actions/create_file.rb#33
1244
+ def data; end
1245
+
1246
+ # Checks if the content of the file at the destination is identical to the rendered result.
1247
+ #
1248
+ # ==== Returns
1249
+ # Boolean:: true if it is identical, false otherwise.
1250
+ #
1251
+ # @return [Boolean]
1252
+ #
1253
+ # source://thor//lib/thor/actions/create_file.rb#45
1254
+ def identical?; end
1255
+
1256
+ # source://thor//lib/thor/actions/create_file.rb#60
1257
+ def invoke!; end
1258
+
1259
+ # Holds the content to be added to the file.
1260
+ #
1261
+ # source://thor//lib/thor/actions/create_file.rb#52
1262
+ def render; end
1263
+
1264
+ protected
1265
+
1266
+ # Shows the file collision menu to the user and gets the result.
1267
+ #
1268
+ # @return [Boolean]
1269
+ #
1270
+ # source://thor//lib/thor/actions/create_file.rb#100
1271
+ def force_on_collision?; end
1272
+
1273
+ # If force is true, run the action, otherwise check if it's not being
1274
+ # skipped. If both are false, show the file_collision menu, if the menu
1275
+ # returns true, force it, otherwise skip.
1276
+ #
1277
+ # source://thor//lib/thor/actions/create_file.rb#86
1278
+ def force_or_skip_or_conflict(force, skip, &block); end
1279
+
1280
+ # Now on conflict we check if the file is identical or not.
1281
+ #
1282
+ # source://thor//lib/thor/actions/create_file.rb#73
1283
+ def on_conflict_behavior(&block); end
1284
+ end
1285
+
1286
+ # CreateLink is a subset of CreateFile, which instead of taking a block of
1287
+ # data, just takes a source string from the user.
1288
+ #
1289
+ # source://thor//lib/thor/actions/create_link.rb#27
1290
+ class Thor::Actions::CreateLink < ::Thor::Actions::CreateFile
1291
+ # source://thor//lib/thor/actions/create_link.rb#28
1292
+ def data; end
1293
+
1294
+ # @return [Boolean]
1295
+ #
1296
+ # source://thor//lib/thor/actions/create_link.rb#56
1297
+ def exists?; end
1298
+
1299
+ # Checks if the content of the file at the destination is identical to the rendered result.
1300
+ #
1301
+ # ==== Returns
1302
+ # Boolean:: true if it is identical, false otherwise.
1303
+ #
1304
+ # @return [Boolean]
1305
+ #
1306
+ # source://thor//lib/thor/actions/create_link.rb#35
1307
+ def identical?; end
1308
+
1309
+ # source://thor//lib/thor/actions/create_link.rb#40
1310
+ def invoke!; end
1311
+ end
1312
+
1313
+ # source://thor//lib/thor/actions/directory.rb#55
1314
+ class Thor::Actions::Directory < ::Thor::Actions::EmptyDirectory
1315
+ # @return [Directory] a new instance of Directory
1316
+ #
1317
+ # source://thor//lib/thor/actions/directory.rb#58
1318
+ def initialize(base, source, destination = T.unsafe(nil), config = T.unsafe(nil), &block); end
1319
+
1320
+ # source://thor//lib/thor/actions/directory.rb#64
1321
+ def invoke!; end
1322
+
1323
+ # source://thor//lib/thor/actions/directory.rb#69
1324
+ def revoke!; end
1325
+
1326
+ # Returns the value of attribute source.
1327
+ #
1328
+ # source://thor//lib/thor/actions/directory.rb#56
1329
+ def source; end
1330
+
1331
+ protected
1332
+
1333
+ # source://thor//lib/thor/actions/directory.rb#75
1334
+ def execute!; end
1335
+
1336
+ # source://thor//lib/thor/actions/directory.rb#99
1337
+ def file_level_lookup(previous_lookup); end
1338
+
1339
+ # source://thor//lib/thor/actions/directory.rb#103
1340
+ def files(lookup); end
1341
+ end
1342
+
1343
+ # source://thor//lib/thor/actions/empty_directory.rb#23
1344
+ class Thor::Actions::EmptyDirectory
1345
+ # Initializes given the source and destination.
1346
+ #
1347
+ # ==== Parameters
1348
+ # base<Thor::Base>:: A Thor::Base instance
1349
+ # source<String>:: Relative path to the source of this file
1350
+ # destination<String>:: Relative path to the destination of this file
1351
+ # config<Hash>:: give :verbose => false to not log the status.
1352
+ #
1353
+ # @return [EmptyDirectory] a new instance of EmptyDirectory
1354
+ #
1355
+ # source://thor//lib/thor/actions/empty_directory.rb#34
1356
+ def initialize(base, destination, config = T.unsafe(nil)); end
1357
+
1358
+ # source://thor//lib/thor/actions/empty_directory.rb#24
1359
+ def base; end
1360
+
1361
+ # source://thor//lib/thor/actions/empty_directory.rb#24
1362
+ def config; end
1363
+
1364
+ # source://thor//lib/thor/actions/empty_directory.rb#24
1365
+ def destination; end
1366
+
1367
+ # Checks if the destination file already exists.
1368
+ #
1369
+ # ==== Returns
1370
+ # Boolean:: true if the file exists, false otherwise.
1371
+ #
1372
+ # @return [Boolean]
1373
+ #
1374
+ # source://thor//lib/thor/actions/empty_directory.rb#45
1375
+ def exists?; end
1376
+
1377
+ # source://thor//lib/thor/actions/empty_directory.rb#24
1378
+ def given_destination; end
1379
+
1380
+ # source://thor//lib/thor/actions/empty_directory.rb#49
1381
+ def invoke!; end
1382
+
1383
+ # source://thor//lib/thor/actions/empty_directory.rb#24
1384
+ def relative_destination; end
1385
+
1386
+ # source://thor//lib/thor/actions/empty_directory.rb#56
1387
+ def revoke!; end
1388
+
1389
+ protected
1390
+
1391
+ # Filenames in the encoded form are converted. If you have a file:
1392
+ #
1393
+ # %file_name%.rb
1394
+ #
1395
+ # It calls #file_name from the base and replaces %-string with the
1396
+ # return value (should be String) of #file_name:
1397
+ #
1398
+ # user.rb
1399
+ #
1400
+ # The method referenced can be either public or private.
1401
+ #
1402
+ # source://thor//lib/thor/actions/empty_directory.rb#103
1403
+ def convert_encoded_instructions(filename); end
1404
+
1405
+ # Sets the absolute destination value from a relative destination value.
1406
+ # It also stores the given and relative destination. Let's suppose our
1407
+ # script is being executed on "dest", it sets the destination root to
1408
+ # "dest". The destination, given_destination and relative_destination
1409
+ # are related in the following way:
1410
+ #
1411
+ # inside "bar" do
1412
+ # empty_directory "baz"
1413
+ # end
1414
+ #
1415
+ # destination #=> dest/bar/baz
1416
+ # relative_destination #=> bar/baz
1417
+ # given_destination #=> baz
1418
+ #
1419
+ # source://thor//lib/thor/actions/empty_directory.rb#85
1420
+ def destination=(destination); end
1421
+
1422
+ # Receives a hash of options and just execute the block if some
1423
+ # conditions are met.
1424
+ #
1425
+ # source://thor//lib/thor/actions/empty_directory.rb#113
1426
+ def invoke_with_conflict_check(&block); end
1427
+
1428
+ # What to do when the destination file already exists.
1429
+ #
1430
+ # source://thor//lib/thor/actions/empty_directory.rb#132
1431
+ def on_conflict_behavior; end
1432
+
1433
+ # source://thor//lib/thor/actions/empty_directory.rb#126
1434
+ def on_file_clash_behavior; end
1435
+
1436
+ # Shortcut for pretend.
1437
+ #
1438
+ # @return [Boolean]
1439
+ #
1440
+ # source://thor//lib/thor/actions/empty_directory.rb#67
1441
+ def pretend?; end
1442
+
1443
+ # Shortcut to say_status shell method.
1444
+ #
1445
+ # source://thor//lib/thor/actions/empty_directory.rb#138
1446
+ def say_status(status, color); end
1447
+ end
1448
+
1449
+ # source://thor//lib/thor/actions/inject_into_file.rb#36
1450
+ class Thor::Actions::InjectIntoFile < ::Thor::Actions::EmptyDirectory
1451
+ # @return [InjectIntoFile] a new instance of InjectIntoFile
1452
+ #
1453
+ # source://thor//lib/thor/actions/inject_into_file.rb#39
1454
+ def initialize(base, destination, data, config); end
1455
+
1456
+ # Returns the value of attribute behavior.
1457
+ #
1458
+ # source://thor//lib/thor/actions/inject_into_file.rb#37
1459
+ def behavior; end
1460
+
1461
+ # Returns the value of attribute flag.
1462
+ #
1463
+ # source://thor//lib/thor/actions/inject_into_file.rb#37
1464
+ def flag; end
1465
+
1466
+ # source://thor//lib/thor/actions/inject_into_file.rb#52
1467
+ def invoke!; end
1468
+
1469
+ # Returns the value of attribute replacement.
1470
+ #
1471
+ # source://thor//lib/thor/actions/inject_into_file.rb#37
1472
+ def replacement; end
1473
+
1474
+ # source://thor//lib/thor/actions/inject_into_file.rb#74
1475
+ def revoke!; end
1476
+
1477
+ protected
1478
+
1479
+ # source://thor//lib/thor/actions/inject_into_file.rb#110
1480
+ def content; end
1481
+
1482
+ # Adds the content to the file.
1483
+ #
1484
+ # source://thor//lib/thor/actions/inject_into_file.rb#120
1485
+ def replace!(regexp, string, force); end
1486
+
1487
+ # @return [Boolean]
1488
+ #
1489
+ # source://thor//lib/thor/actions/inject_into_file.rb#114
1490
+ def replacement_present?; end
1491
+
1492
+ # source://thor//lib/thor/actions/inject_into_file.rb#90
1493
+ def say_status(behavior, warning: T.unsafe(nil), color: T.unsafe(nil)); end
1494
+ end
1495
+
1496
+ # Injects the given content into a file. Different from gsub_file, this
1497
+ # method is reversible.
1498
+ #
1499
+ # ==== Parameters
1500
+ # destination<String>:: Relative path to the destination root
1501
+ # data<String>:: Data to add to the file. Can be given as a block.
1502
+ # config<Hash>:: give :verbose => false to not log the status and the flag
1503
+ # for injection (:after or :before) or :force => true for
1504
+ # insert two or more times the same content.
1505
+ #
1506
+ # ==== Examples
1507
+ #
1508
+ # insert_into_file "config/environment.rb", "config.gem :thor", :after => "Rails::Initializer.run do |config|\n"
1509
+ #
1510
+ # insert_into_file "config/environment.rb", :after => "Rails::Initializer.run do |config|\n" do
1511
+ # gems = ask "Which gems would you like to add?"
1512
+ # gems.split(" ").map{ |gem| " config.gem :#{gem}" }.join("\n")
1513
+ # end
1514
+ #
1515
+ # source://thor//lib/thor/actions/inject_into_file.rb#24
1516
+ Thor::Actions::WARNINGS = T.let(T.unsafe(nil), Hash)
1517
+
1518
+ # source://thor//lib/thor/error.rb#57
1519
+ class Thor::AmbiguousCommandError < ::Thor::Error; end
1520
+
1521
+ # source://thor//lib/thor/error.rb#59
1522
+ Thor::AmbiguousTaskError = Thor::AmbiguousCommandError
1523
+
1524
+ # source://thor//lib/thor/parser/argument.rb#2
1525
+ class Thor::Argument
1526
+ # @raise [ArgumentError]
1527
+ # @return [Argument] a new instance of Argument
1528
+ #
1529
+ # source://thor//lib/thor/parser/argument.rb#8
1530
+ def initialize(name, options = T.unsafe(nil)); end
1531
+
1532
+ # Returns the value of attribute banner.
1533
+ #
1534
+ # source://thor//lib/thor/parser/argument.rb#5
1535
+ def banner; end
1536
+
1537
+ # Returns the value of attribute default.
1538
+ #
1539
+ # source://thor//lib/thor/parser/argument.rb#5
1540
+ def default; end
1541
+
1542
+ # Returns the value of attribute description.
1543
+ #
1544
+ # source://thor//lib/thor/parser/argument.rb#5
1545
+ def description; end
1546
+
1547
+ # Returns the value of attribute enum.
1548
+ #
1549
+ # source://thor//lib/thor/parser/argument.rb#5
1550
+ def enum; end
1551
+
1552
+ # source://thor//lib/thor/parser/argument.rb#52
1553
+ def enum_to_s; end
1554
+
1555
+ # Returns the value of attribute name.
1556
+ #
1557
+ # source://thor//lib/thor/parser/argument.rb#5
1558
+ def human_name; end
1559
+
1560
+ # Returns the value of attribute name.
1561
+ #
1562
+ # source://thor//lib/thor/parser/argument.rb#5
1563
+ def name; end
1564
+
1565
+ # source://thor//lib/thor/parser/argument.rb#27
1566
+ def print_default; end
1567
+
1568
+ # Returns the value of attribute required.
1569
+ #
1570
+ # source://thor//lib/thor/parser/argument.rb#5
1571
+ def required; end
1572
+
1573
+ # @return [Boolean]
1574
+ #
1575
+ # source://thor//lib/thor/parser/argument.rb#39
1576
+ def required?; end
1577
+
1578
+ # @return [Boolean]
1579
+ #
1580
+ # source://thor//lib/thor/parser/argument.rb#43
1581
+ def show_default?; end
1582
+
1583
+ # Returns the value of attribute type.
1584
+ #
1585
+ # source://thor//lib/thor/parser/argument.rb#5
1586
+ def type; end
1587
+
1588
+ # source://thor//lib/thor/parser/argument.rb#35
1589
+ def usage; end
1590
+
1591
+ protected
1592
+
1593
+ # source://thor//lib/thor/parser/argument.rb#71
1594
+ def default_banner; end
1595
+
1596
+ # @return [Boolean]
1597
+ #
1598
+ # source://thor//lib/thor/parser/argument.rb#67
1599
+ def valid_type?(type); end
1600
+
1601
+ # @raise [ArgumentError]
1602
+ #
1603
+ # source://thor//lib/thor/parser/argument.rb#62
1604
+ def validate!; end
1605
+ end
1606
+
1607
+ # source://thor//lib/thor/parser/argument.rb#3
1608
+ Thor::Argument::VALID_TYPES = T.let(T.unsafe(nil), Array)
1609
+
1610
+ # source://thor//lib/thor/parser/arguments.rb#2
1611
+ class Thor::Arguments
1612
+ # Takes an array of Thor::Argument objects.
1613
+ #
1614
+ # @return [Arguments] a new instance of Arguments
1615
+ #
1616
+ # source://thor//lib/thor/parser/arguments.rb#26
1617
+ def initialize(arguments = T.unsafe(nil)); end
1618
+
1619
+ # source://thor//lib/thor/parser/arguments.rb#40
1620
+ def parse(args); end
1621
+
1622
+ # source://thor//lib/thor/parser/arguments.rb#53
1623
+ def remaining; end
1624
+
1625
+ private
1626
+
1627
+ # Raises an error if @non_assigned_required array is not empty.
1628
+ #
1629
+ # @raise [RequiredArgumentMissingError]
1630
+ #
1631
+ # source://thor//lib/thor/parser/arguments.rb#186
1632
+ def check_requirement!; end
1633
+
1634
+ # @return [Boolean]
1635
+ #
1636
+ # source://thor//lib/thor/parser/arguments.rb#84
1637
+ def current_is_value?; end
1638
+
1639
+ # @return [Boolean]
1640
+ #
1641
+ # source://thor//lib/thor/parser/arguments.rb#64
1642
+ def last?; end
1643
+
1644
+ # @return [Boolean]
1645
+ #
1646
+ # source://thor//lib/thor/parser/arguments.rb#59
1647
+ def no_or_skip?(arg); end
1648
+
1649
+ # Runs through the argument array getting all strings until no string is
1650
+ # found or a switch is found.
1651
+ #
1652
+ # ["a", "b", "c"]
1653
+ #
1654
+ # And returns it as an array:
1655
+ #
1656
+ # ["a", "b", "c"]
1657
+ #
1658
+ # source://thor//lib/thor/parser/arguments.rb#118
1659
+ def parse_array(name); end
1660
+
1661
+ # Runs through the argument array getting strings that contains ":" and
1662
+ # mark it as a hash:
1663
+ #
1664
+ # [ "name:string", "age:integer" ]
1665
+ #
1666
+ # Becomes:
1667
+ #
1668
+ # { "name" => "string", "age" => "integer" }
1669
+ #
1670
+ # source://thor//lib/thor/parser/arguments.rb#97
1671
+ def parse_hash(name); end
1672
+
1673
+ # Check if the peek is numeric format and return a Float or Integer.
1674
+ # Check if the peek is included in enum if enum is provided.
1675
+ # Otherwise raises an error.
1676
+ #
1677
+ # source://thor//lib/thor/parser/arguments.rb#139
1678
+ def parse_numeric(name); end
1679
+
1680
+ # Parse string:
1681
+ # for --string-arg, just return the current value in the pile
1682
+ # for --no-string-arg, nil
1683
+ # Check if the peek is included in enum if enum is provided. Otherwise raises an error.
1684
+ #
1685
+ # source://thor//lib/thor/parser/arguments.rb#158
1686
+ def parse_string(name); end
1687
+
1688
+ # source://thor//lib/thor/parser/arguments.rb#68
1689
+ def peek; end
1690
+
1691
+ # source://thor//lib/thor/parser/arguments.rb#72
1692
+ def shift; end
1693
+
1694
+ # source://thor//lib/thor/parser/arguments.rb#76
1695
+ def unshift(arg); end
1696
+
1697
+ # Raises an error if the switch is an enum and the values aren't included on it.
1698
+ #
1699
+ # source://thor//lib/thor/parser/arguments.rb#172
1700
+ def validate_enum_value!(name, value, message); end
1701
+
1702
+ class << self
1703
+ # source://thor//lib/thor/parser/arguments.rb#19
1704
+ def parse(*args); end
1705
+
1706
+ # Receives an array of args and returns two arrays, one with arguments
1707
+ # and one with switches.
1708
+ #
1709
+ # source://thor//lib/thor/parser/arguments.rb#8
1710
+ def split(args); end
1711
+ end
1712
+ end
1713
+
1714
+ # source://thor//lib/thor/parser/arguments.rb#3
1715
+ Thor::Arguments::NUMERIC = T.let(T.unsafe(nil), Regexp)
1716
+
1717
+ # source://thor//lib/thor/error.rb#104
1718
+ class Thor::AtLeastOneRequiredArgumentError < ::Thor::InvocationError; end
1719
+
1720
+ # source://thor//lib/thor/shell.rb#4
1721
+ module Thor::Base
1722
+ include ::Thor::Invocation
1723
+ include ::Thor::Shell
1724
+
1725
+ mixes_in_class_methods ::Thor::Base::ClassMethods
1726
+ mixes_in_class_methods ::Thor::Invocation::ClassMethods
1727
+
1728
+ # It receives arguments in an Array and two hashes, one for options and
1729
+ # other for configuration.
1730
+ #
1731
+ # Notice that it does not check if all required arguments were supplied.
1732
+ # It should be done by the parser.
1733
+ #
1734
+ # ==== Parameters
1735
+ # args<Array[Object]>:: An array of objects. The objects are applied to their
1736
+ # respective accessors declared with <tt>argument</tt>.
1737
+ #
1738
+ # options<Hash>:: An options hash that will be available as self.options.
1739
+ # The hash given is converted to a hash with indifferent
1740
+ # access, magic predicates (options.skip?) and then frozen.
1741
+ #
1742
+ # config<Hash>:: Configuration for this Thor class.
1743
+ #
1744
+ # source://thor//lib/thor/base.rb#53
1745
+ def initialize(args = T.unsafe(nil), local_options = T.unsafe(nil), config = T.unsafe(nil)); end
1746
+
1747
+ # Returns the value of attribute args.
1748
+ #
1749
+ # source://thor//lib/thor/base.rb#35
1750
+ def args; end
1751
+
1752
+ # Sets the attribute args
1753
+ #
1754
+ # @param value the value to set the attribute args to.
1755
+ #
1756
+ # source://thor//lib/thor/base.rb#35
1757
+ def args=(_arg0); end
1758
+
1759
+ # Returns the value of attribute options.
1760
+ #
1761
+ # source://thor//lib/thor/base.rb#35
1762
+ def options; end
1763
+
1764
+ # Sets the attribute options
1765
+ #
1766
+ # @param value the value to set the attribute options to.
1767
+ #
1768
+ # source://thor//lib/thor/base.rb#35
1769
+ def options=(_arg0); end
1770
+
1771
+ # Returns the value of attribute parent_options.
1772
+ #
1773
+ # source://thor//lib/thor/base.rb#35
1774
+ def parent_options; end
1775
+
1776
+ # Sets the attribute parent_options
1777
+ #
1778
+ # @param value the value to set the attribute parent_options to.
1779
+ #
1780
+ # source://thor//lib/thor/base.rb#35
1781
+ def parent_options=(_arg0); end
1782
+
1783
+ class << self
1784
+ # source://thor//lib/thor/base.rb#116
1785
+ def included(base); end
1786
+
1787
+ # Whenever a class inherits from Thor or Thor::Group, we should track the
1788
+ # class and the file on Thor::Base. This is the method responsible for it.
1789
+ #
1790
+ # source://thor//lib/thor/base.rb#144
1791
+ def register_klass_file(klass); end
1792
+
1793
+ # Returns the shell used in all Thor classes. If you are in a Unix platform
1794
+ # it will use a colored log, otherwise it will use a basic one without color.
1795
+ #
1796
+ # source://thor//lib/thor/shell.rb#11
1797
+ def shell; end
1798
+
1799
+ # Sets the attribute shell
1800
+ #
1801
+ # @param value the value to set the attribute shell to.
1802
+ #
1803
+ # source://thor//lib/thor/shell.rb#6
1804
+ def shell=(_arg0); end
1805
+
1806
+ # Returns the files where the subclasses are kept.
1807
+ #
1808
+ # ==== Returns
1809
+ # Hash[path<String> => Class]
1810
+ #
1811
+ # source://thor//lib/thor/base.rb#137
1812
+ def subclass_files; end
1813
+
1814
+ # Returns the classes that inherits from Thor or Thor::Group.
1815
+ #
1816
+ # ==== Returns
1817
+ # Array[Class]
1818
+ #
1819
+ # source://thor//lib/thor/base.rb#128
1820
+ def subclasses; end
1821
+ end
1822
+ end
1823
+
1824
+ # source://thor//lib/thor/base.rb#153
1825
+ module Thor::Base::ClassMethods
1826
+ # Returns the commands for this Thor class and all subclasses.
1827
+ #
1828
+ # ==== Returns
1829
+ # Hash:: An ordered hash with commands names as keys and Thor::Command
1830
+ # objects as values.
1831
+ #
1832
+ # source://thor//lib/thor/base.rb#482
1833
+ def all_commands; end
1834
+
1835
+ # Returns the commands for this Thor class and all subclasses.
1836
+ #
1837
+ # ==== Returns
1838
+ # Hash:: An ordered hash with commands names as keys and Thor::Command
1839
+ # objects as values.
1840
+ #
1841
+ # source://thor//lib/thor/base.rb#482
1842
+ def all_tasks; end
1843
+
1844
+ # If you want to use defaults that don't match the type of an option,
1845
+ # either specify `check_default_type: false` or call `allow_incompatible_default_type!`
1846
+ #
1847
+ # source://thor//lib/thor/base.rb#189
1848
+ def allow_incompatible_default_type!; end
1849
+
1850
+ # Adds an argument to the class and creates an attr_accessor for it.
1851
+ #
1852
+ # Arguments are different from options in several aspects. The first one
1853
+ # is how they are parsed from the command line, arguments are retrieved
1854
+ # from position:
1855
+ #
1856
+ # thor command NAME
1857
+ #
1858
+ # Instead of:
1859
+ #
1860
+ # thor command --name=NAME
1861
+ #
1862
+ # Besides, arguments are used inside your code as an accessor (self.argument),
1863
+ # while options are all kept in a hash (self.options).
1864
+ #
1865
+ # Finally, arguments cannot have type :default or :boolean but can be
1866
+ # optional (supplying :optional => :true or :required => false), although
1867
+ # you cannot have a required argument after a non-required argument. If you
1868
+ # try it, an error is raised.
1869
+ #
1870
+ # ==== Parameters
1871
+ # name<Symbol>:: The name of the argument.
1872
+ # options<Hash>:: Described below.
1873
+ #
1874
+ # ==== Options
1875
+ # :desc - Description for the argument.
1876
+ # :required - If the argument is required or not.
1877
+ # :optional - If the argument is optional or not.
1878
+ # :type - The type of the argument, can be :string, :hash, :array, :numeric.
1879
+ # :default - Default value for this argument. It cannot be required and have default values.
1880
+ # :banner - String to show on usage notes.
1881
+ #
1882
+ # ==== Errors
1883
+ # ArgumentError:: Raised if you supply a required argument after a non required one.
1884
+ #
1885
+ # source://thor//lib/thor/base.rb#261
1886
+ def argument(name, options = T.unsafe(nil)); end
1887
+
1888
+ # Returns this class arguments, looking up in the ancestors chain.
1889
+ #
1890
+ # ==== Returns
1891
+ # Array[Thor::Argument]
1892
+ #
1893
+ # source://thor//lib/thor/base.rb#293
1894
+ def arguments; end
1895
+
1896
+ # source://thor//lib/thor/base.rb#162
1897
+ def attr_accessor(*_arg0); end
1898
+
1899
+ # source://thor//lib/thor/base.rb#154
1900
+ def attr_reader(*_arg0); end
1901
+
1902
+ # source://thor//lib/thor/base.rb#158
1903
+ def attr_writer(*_arg0); end
1904
+
1905
+ # source://thor//lib/thor/base.rb#193
1906
+ def check_default_type; end
1907
+
1908
+ # If you want to raise an error when the default value of an option does not match
1909
+ # the type call check_default_type!
1910
+ # This will be the default; for compatibility a deprecation warning is issued if necessary.
1911
+ #
1912
+ # source://thor//lib/thor/base.rb#183
1913
+ def check_default_type!; end
1914
+
1915
+ # source://thor//lib/thor/base.rb#172
1916
+ def check_unknown_options; end
1917
+
1918
+ # If you want to raise an error for unknown options, call check_unknown_options!
1919
+ # This is disabled by default to allow dynamic invocations.
1920
+ #
1921
+ # source://thor//lib/thor/base.rb#168
1922
+ def check_unknown_options!; end
1923
+
1924
+ # @return [Boolean]
1925
+ #
1926
+ # source://thor//lib/thor/base.rb#176
1927
+ def check_unknown_options?(config); end
1928
+
1929
+ # Adds and declares option group for required at least one of options in the
1930
+ # block and arguments. You can declare options as the outside of the block.
1931
+ #
1932
+ # ==== Examples
1933
+ #
1934
+ # class_at_least_one do
1935
+ # class_option :one
1936
+ # class_option :two
1937
+ # end
1938
+ #
1939
+ # Or
1940
+ #
1941
+ # class_option :one
1942
+ # class_option :two
1943
+ # class_at_least_one :one, :two
1944
+ #
1945
+ # If you do not give "--one" and "--two" AtLeastOneRequiredArgumentError
1946
+ # will be raised.
1947
+ #
1948
+ # You can use class_at_least_one and class_exclusive at the same time.
1949
+ #
1950
+ # class_exclusive do
1951
+ # class_at_least_one do
1952
+ # class_option :one
1953
+ # class_option :two
1954
+ # end
1955
+ # end
1956
+ #
1957
+ # Then it is required either only one of "--one" or "--two".
1958
+ #
1959
+ # source://thor//lib/thor/base.rb#392
1960
+ def class_at_least_one(*args, &block); end
1961
+
1962
+ # Returns this class at least one of required options array set, looking up in the ancestors chain.
1963
+ #
1964
+ # ==== Returns
1965
+ # Array[Array[Thor::Option.name]]
1966
+ #
1967
+ # source://thor//lib/thor/base.rb#411
1968
+ def class_at_least_one_option_names; end
1969
+
1970
+ # Adds and declares option group for exclusive options in the
1971
+ # block and arguments. You can declare options as the outside of the block.
1972
+ #
1973
+ # ==== Parameters
1974
+ # Array[Thor::Option.name]
1975
+ #
1976
+ # ==== Examples
1977
+ #
1978
+ # class_exclusive do
1979
+ # class_option :one
1980
+ # class_option :two
1981
+ # end
1982
+ #
1983
+ # Or
1984
+ #
1985
+ # class_option :one
1986
+ # class_option :two
1987
+ # class_exclusive :one, :two
1988
+ #
1989
+ # If you give "--one" and "--two" at the same time ExclusiveArgumentsError
1990
+ # will be raised.
1991
+ #
1992
+ # source://thor//lib/thor/base.rb#357
1993
+ def class_exclusive(*args, &block); end
1994
+
1995
+ # Returns this class exclusive options array set, looking up in the ancestors chain.
1996
+ #
1997
+ # ==== Returns
1998
+ # Array[Array[Thor::Option.name]]
1999
+ #
2000
+ # source://thor//lib/thor/base.rb#402
2001
+ def class_exclusive_option_names; end
2002
+
2003
+ # Adds an option to the set of class options
2004
+ #
2005
+ # ==== Parameters
2006
+ # name<Symbol>:: The name of the argument.
2007
+ # options<Hash>:: Described below.
2008
+ #
2009
+ # ==== Options
2010
+ # :desc:: -- Description for the argument.
2011
+ # :required:: -- If the argument is required or not.
2012
+ # :default:: -- Default value for this argument.
2013
+ # :group:: -- The group for this options. Use by class options to output options in different levels.
2014
+ # :aliases:: -- Aliases for this option. <b>Note:</b> Thor follows a convention of one-dash-one-letter options. Thus aliases like "-something" wouldn't be parsed; use either "\--something" or "-s" instead.
2015
+ # :type:: -- The type of the argument, can be :string, :hash, :array, :numeric or :boolean.
2016
+ # :banner:: -- String to show on usage notes.
2017
+ # :hide:: -- If you want to hide this option from the help.
2018
+ #
2019
+ # source://thor//lib/thor/base.rb#328
2020
+ def class_option(name, options = T.unsafe(nil)); end
2021
+
2022
+ # Adds a bunch of options to the set of class options.
2023
+ #
2024
+ # class_options :foo => false, :bar => :required, :baz => :string
2025
+ #
2026
+ # If you prefer more detailed declaration, check class_option.
2027
+ #
2028
+ # ==== Parameters
2029
+ # Hash[Symbol => Object]
2030
+ #
2031
+ # source://thor//lib/thor/base.rb#306
2032
+ def class_options(options = T.unsafe(nil)); end
2033
+
2034
+ # Returns the commands for this Thor class.
2035
+ #
2036
+ # ==== Returns
2037
+ # Hash:: An ordered hash with commands names as keys and Thor::Command
2038
+ # objects as values.
2039
+ #
2040
+ # source://thor//lib/thor/base.rb#471
2041
+ def commands; end
2042
+
2043
+ # If true, option set will not suspend the execution of the command when
2044
+ # a required option is not provided.
2045
+ #
2046
+ # @return [Boolean]
2047
+ #
2048
+ # source://thor//lib/thor/base.rb#207
2049
+ def disable_required_check?(command_name); end
2050
+
2051
+ # A flag that makes the process exit with status 1 if any error happens.
2052
+ #
2053
+ # @return [Boolean]
2054
+ #
2055
+ # source://thor//lib/thor/base.rb#628
2056
+ def exit_on_failure?; end
2057
+
2058
+ # Defines the group. This is used when thor list is invoked so you can specify
2059
+ # that only commands from a pre-defined group will be shown. Defaults to standard.
2060
+ #
2061
+ # ==== Parameters
2062
+ # name<String|Symbol>
2063
+ #
2064
+ # source://thor//lib/thor/base.rb#457
2065
+ def group(name = T.unsafe(nil)); end
2066
+
2067
+ # @raise [InvocationError]
2068
+ #
2069
+ # source://thor//lib/thor/base.rb#618
2070
+ def handle_argument_error(command, error, args, arity); end
2071
+
2072
+ # @raise [UndefinedCommandError]
2073
+ #
2074
+ # source://thor//lib/thor/base.rb#613
2075
+ def handle_no_command_error(command, has_namespace = T.unsafe(nil)); end
2076
+
2077
+ # @raise [UndefinedCommandError]
2078
+ #
2079
+ # source://thor//lib/thor/base.rb#613
2080
+ def handle_no_task_error(command, has_namespace = T.unsafe(nil)); end
2081
+
2082
+ # Sets the namespace for the Thor or Thor::Group class. By default the
2083
+ # namespace is retrieved from the class name. If your Thor class is named
2084
+ # Scripts::MyScript, the help method, for example, will be called as:
2085
+ #
2086
+ # thor scripts:my_script -h
2087
+ #
2088
+ # If you change the namespace:
2089
+ #
2090
+ # namespace :my_scripts
2091
+ #
2092
+ # You change how your commands are invoked:
2093
+ #
2094
+ # thor my_scripts -h
2095
+ #
2096
+ # Finally, if you change your namespace to default:
2097
+ #
2098
+ # namespace :default
2099
+ #
2100
+ # Your commands can be invoked with a shortcut. Instead of:
2101
+ #
2102
+ # thor :my_command
2103
+ #
2104
+ # source://thor//lib/thor/base.rb#566
2105
+ def namespace(name = T.unsafe(nil)); end
2106
+
2107
+ # All methods defined inside the given block are not added as commands.
2108
+ #
2109
+ # So you can do:
2110
+ #
2111
+ # class MyScript < Thor
2112
+ # no_commands do
2113
+ # def this_is_not_a_command
2114
+ # end
2115
+ # end
2116
+ # end
2117
+ #
2118
+ # You can also add the method and remove it from the command list:
2119
+ #
2120
+ # class MyScript < Thor
2121
+ # def this_is_not_a_command
2122
+ # end
2123
+ # remove_command :this_is_not_a_command
2124
+ # end
2125
+ #
2126
+ # source://thor//lib/thor/base.rb#530
2127
+ def no_commands(&block); end
2128
+
2129
+ # @return [Boolean]
2130
+ #
2131
+ # source://thor//lib/thor/base.rb#540
2132
+ def no_commands?; end
2133
+
2134
+ # source://thor//lib/thor/base.rb#536
2135
+ def no_commands_context; end
2136
+
2137
+ # All methods defined inside the given block are not added as commands.
2138
+ #
2139
+ # So you can do:
2140
+ #
2141
+ # class MyScript < Thor
2142
+ # no_commands do
2143
+ # def this_is_not_a_command
2144
+ # end
2145
+ # end
2146
+ # end
2147
+ #
2148
+ # You can also add the method and remove it from the command list:
2149
+ #
2150
+ # class MyScript < Thor
2151
+ # def this_is_not_a_command
2152
+ # end
2153
+ # remove_command :this_is_not_a_command
2154
+ # end
2155
+ #
2156
+ # source://thor//lib/thor/base.rb#530
2157
+ def no_tasks(&block); end
2158
+
2159
+ # Allows to use private methods from parent in child classes as commands.
2160
+ #
2161
+ # ==== Parameters
2162
+ # names<Array>:: Method names to be used as commands
2163
+ #
2164
+ # ==== Examples
2165
+ #
2166
+ # public_command :foo
2167
+ # public_command :foo, :bar, :baz
2168
+ #
2169
+ # source://thor//lib/thor/base.rb#606
2170
+ def public_command(*names); end
2171
+
2172
+ # Allows to use private methods from parent in child classes as commands.
2173
+ #
2174
+ # ==== Parameters
2175
+ # names<Array>:: Method names to be used as commands
2176
+ #
2177
+ # ==== Examples
2178
+ #
2179
+ # public_command :foo
2180
+ # public_command :foo, :bar, :baz
2181
+ #
2182
+ # source://thor//lib/thor/base.rb#606
2183
+ def public_task(*names); end
2184
+
2185
+ # Removes a previous defined argument. If :undefine is given, undefine
2186
+ # accessors as well.
2187
+ #
2188
+ # ==== Parameters
2189
+ # names<Array>:: Arguments to be removed
2190
+ #
2191
+ # ==== Examples
2192
+ #
2193
+ # remove_argument :foo
2194
+ # remove_argument :foo, :bar, :baz, :undefine => true
2195
+ #
2196
+ # source://thor//lib/thor/base.rb#426
2197
+ def remove_argument(*names); end
2198
+
2199
+ # Removes a previous defined class option.
2200
+ #
2201
+ # ==== Parameters
2202
+ # names<Array>:: Class options to be removed
2203
+ #
2204
+ # ==== Examples
2205
+ #
2206
+ # remove_class_option :foo
2207
+ # remove_class_option :foo, :bar, :baz
2208
+ #
2209
+ # source://thor//lib/thor/base.rb#445
2210
+ def remove_class_option(*names); end
2211
+
2212
+ # Removes a given command from this Thor class. This is usually done if you
2213
+ # are inheriting from another class and don't want it to be available
2214
+ # anymore.
2215
+ #
2216
+ # By default it only remove the mapping to the command. But you can supply
2217
+ # :undefine => true to undefine the method from the class as well.
2218
+ #
2219
+ # ==== Parameters
2220
+ # name<Symbol|String>:: The name of the command to be removed
2221
+ # options<Hash>:: You can give :undefine => true if you want commands the method
2222
+ # to be undefined from the class as well.
2223
+ #
2224
+ # source://thor//lib/thor/base.rb#500
2225
+ def remove_command(*names); end
2226
+
2227
+ # Removes a given command from this Thor class. This is usually done if you
2228
+ # are inheriting from another class and don't want it to be available
2229
+ # anymore.
2230
+ #
2231
+ # By default it only remove the mapping to the command. But you can supply
2232
+ # :undefine => true to undefine the method from the class as well.
2233
+ #
2234
+ # ==== Parameters
2235
+ # name<Symbol|String>:: The name of the command to be removed
2236
+ # options<Hash>:: You can give :undefine => true if you want commands the method
2237
+ # to be undefined from the class as well.
2238
+ #
2239
+ # source://thor//lib/thor/base.rb#500
2240
+ def remove_task(*names); end
2241
+
2242
+ # Parses the command and options from the given args, instantiate the class
2243
+ # and invoke the command. This method is used when the arguments must be parsed
2244
+ # from an array. If you are inside Ruby and want to use a Thor class, you
2245
+ # can simply initialize it:
2246
+ #
2247
+ # script = MyScript.new(args, options, config)
2248
+ # script.invoke(:command, first_arg, second_arg, third_arg)
2249
+ #
2250
+ # source://thor//lib/thor/base.rb#582
2251
+ def start(given_args = T.unsafe(nil), config = T.unsafe(nil)); end
2252
+
2253
+ # If true, option parsing is suspended as soon as an unknown option or a
2254
+ # regular argument is encountered. All remaining arguments are passed to
2255
+ # the command as regular arguments.
2256
+ #
2257
+ # @return [Boolean]
2258
+ #
2259
+ # source://thor//lib/thor/base.rb#201
2260
+ def stop_on_unknown_option?(command_name); end
2261
+
2262
+ # source://thor//lib/thor/base.rb#218
2263
+ def strict_args_position; end
2264
+
2265
+ # If you want only strict string args (useful when cascading thor classes),
2266
+ # call strict_args_position! This is disabled by default to allow dynamic
2267
+ # invocations.
2268
+ #
2269
+ # source://thor//lib/thor/base.rb#214
2270
+ def strict_args_position!; end
2271
+
2272
+ # @return [Boolean]
2273
+ #
2274
+ # source://thor//lib/thor/base.rb#222
2275
+ def strict_args_position?(config); end
2276
+
2277
+ # Returns the commands for this Thor class.
2278
+ #
2279
+ # ==== Returns
2280
+ # Hash:: An ordered hash with commands names as keys and Thor::Command
2281
+ # objects as values.
2282
+ #
2283
+ # source://thor//lib/thor/base.rb#471
2284
+ def tasks; end
2285
+
2286
+ protected
2287
+
2288
+ # SIGNATURE: Sets the baseclass. This is where the superclass lookup
2289
+ # finishes.
2290
+ #
2291
+ # source://thor//lib/thor/base.rb#777
2292
+ def baseclass; end
2293
+
2294
+ # The basename of the program invoking the thor class.
2295
+ #
2296
+ # source://thor//lib/thor/base.rb#771
2297
+ def basename; end
2298
+
2299
+ # Build an option and adds it to the given scope.
2300
+ #
2301
+ # ==== Parameters
2302
+ # name<Symbol>:: The name of the argument.
2303
+ # options<Hash>:: Described in both class_option and method_option.
2304
+ # scope<Hash>:: Options hash that is being built up
2305
+ #
2306
+ # source://thor//lib/thor/base.rb#688
2307
+ def build_option(name, options, scope); end
2308
+
2309
+ # Receives a hash of options, parse them and add to the scope. This is a
2310
+ # fast way to set a bunch of options:
2311
+ #
2312
+ # build_options :foo => true, :bar => :required, :baz => :string
2313
+ #
2314
+ # ==== Parameters
2315
+ # Hash[Symbol => Object]
2316
+ #
2317
+ # source://thor//lib/thor/base.rb#699
2318
+ def build_options(options, scope); end
2319
+
2320
+ # Get target(method_options or class_options) options
2321
+ # of before and after by block evaluation.
2322
+ #
2323
+ # source://thor//lib/thor/base.rb#808
2324
+ def built_option_names(target, opt = T.unsafe(nil), &block); end
2325
+
2326
+ # Prints the class options per group. If an option does not belong to
2327
+ # any group, it's printed as Class option.
2328
+ #
2329
+ # source://thor//lib/thor/base.rb#638
2330
+ def class_options_help(shell, groups = T.unsafe(nil)); end
2331
+
2332
+ # Get command scope member by name.
2333
+ #
2334
+ # source://thor//lib/thor/base.rb#816
2335
+ def command_scope_member(name, options = T.unsafe(nil)); end
2336
+
2337
+ # SIGNATURE: Creates a new command if valid_command? is true. This method is
2338
+ # called when a new method is added to the class.
2339
+ #
2340
+ # source://thor//lib/thor/base.rb#782
2341
+ def create_command(meth); end
2342
+
2343
+ # SIGNATURE: Creates a new command if valid_command? is true. This method is
2344
+ # called when a new method is added to the class.
2345
+ #
2346
+ # source://thor//lib/thor/base.rb#782
2347
+ def create_task(meth); end
2348
+
2349
+ # SIGNATURE: The hook invoked by start.
2350
+ #
2351
+ # @raise [NotImplementedError]
2352
+ #
2353
+ # source://thor//lib/thor/base.rb#792
2354
+ def dispatch(command, given_args, given_opts, config); end
2355
+
2356
+ # Finds a command with the given name. If the command belongs to the current
2357
+ # class, just return it, otherwise dup it and add the fresh copy to the
2358
+ # current command hash.
2359
+ #
2360
+ # source://thor//lib/thor/base.rb#708
2361
+ def find_and_refresh_command(name); end
2362
+
2363
+ # Finds a command with the given name. If the command belongs to the current
2364
+ # class, just return it, otherwise dup it and add the fresh copy to the
2365
+ # current command hash.
2366
+ #
2367
+ # source://thor//lib/thor/base.rb#708
2368
+ def find_and_refresh_task(name); end
2369
+
2370
+ # Retrieves a value from superclass. If it reaches the baseclass,
2371
+ # returns default.
2372
+ #
2373
+ # source://thor//lib/thor/base.rb#749
2374
+ def from_superclass(method, default = T.unsafe(nil)); end
2375
+
2376
+ # Every time someone inherits from a Thor class, register the klass
2377
+ # and file into baseclass.
2378
+ #
2379
+ # source://thor//lib/thor/base.rb#721
2380
+ def inherited(klass); end
2381
+
2382
+ # SIGNATURE: Defines behavior when the initialize method is added to the
2383
+ # class.
2384
+ #
2385
+ # source://thor//lib/thor/base.rb#788
2386
+ def initialize_added; end
2387
+
2388
+ # Raises an error if the word given is a Thor reserved word.
2389
+ #
2390
+ # @return [Boolean]
2391
+ #
2392
+ # source://thor//lib/thor/base.rb#677
2393
+ def is_thor_reserved_word?(word, type); end
2394
+
2395
+ # Fire this callback whenever a method is added. Added methods are
2396
+ # tracked as commands by invoking the create_command method.
2397
+ #
2398
+ # source://thor//lib/thor/base.rb#729
2399
+ def method_added(meth); end
2400
+
2401
+ # Receives a set of options and print them.
2402
+ #
2403
+ # source://thor//lib/thor/base.rb#656
2404
+ def print_options(shell, options, group_name = T.unsafe(nil)); end
2405
+
2406
+ # Register a relation of options for target(method_option/class_option)
2407
+ # by args and block.
2408
+ #
2409
+ # source://thor//lib/thor/base.rb#798
2410
+ def register_options_relation_for(target, relation, *args, &block); end
2411
+ end
2412
+
2413
+ # source://thor//lib/thor/command.rb#2
2414
+ class Thor::Command < ::Struct
2415
+ # @return [Command] a new instance of Command
2416
+ #
2417
+ # source://thor//lib/thor/command.rb#5
2418
+ def initialize(name, description, long_description, wrap_long_description, usage, options = T.unsafe(nil), options_relation = T.unsafe(nil)); end
2419
+
2420
+ # Returns the formatted usage by injecting given required arguments
2421
+ # and required options into the given usage.
2422
+ #
2423
+ # source://thor//lib/thor/command.rb#42
2424
+ def formatted_usage(klass, namespace = T.unsafe(nil), subcommand = T.unsafe(nil)); end
2425
+
2426
+ # @return [Boolean]
2427
+ #
2428
+ # source://thor//lib/thor/command.rb#15
2429
+ def hidden?; end
2430
+
2431
+ # source://thor//lib/thor/command.rb#70
2432
+ def method_at_least_one_option_names; end
2433
+
2434
+ # source://thor//lib/thor/command.rb#66
2435
+ def method_exclusive_option_names; end
2436
+
2437
+ # By default, a command invokes a method in the thor class. You can change this
2438
+ # implementation to create custom commands.
2439
+ #
2440
+ # source://thor//lib/thor/command.rb#21
2441
+ def run(instance, args = T.unsafe(nil)); end
2442
+
2443
+ protected
2444
+
2445
+ # @return [Boolean]
2446
+ #
2447
+ # source://thor//lib/thor/command.rb#114
2448
+ def handle_argument_error?(instance, error, caller); end
2449
+
2450
+ # @return [Boolean]
2451
+ #
2452
+ # source://thor//lib/thor/command.rb#121
2453
+ def handle_no_method_error?(instance, error, caller); end
2454
+
2455
+ # @return [Boolean]
2456
+ #
2457
+ # source://thor//lib/thor/command.rb#104
2458
+ def local_method?(instance, name); end
2459
+
2460
+ # @return [Boolean]
2461
+ #
2462
+ # source://thor//lib/thor/command.rb#87
2463
+ def not_debugging?(instance); end
2464
+
2465
+ # @return [Boolean]
2466
+ #
2467
+ # source://thor//lib/thor/command.rb#100
2468
+ def private_method?(instance); end
2469
+
2470
+ # Given a target, checks if this class name is a public method.
2471
+ #
2472
+ # @return [Boolean]
2473
+ #
2474
+ # source://thor//lib/thor/command.rb#96
2475
+ def public_method?(instance); end
2476
+
2477
+ # Add usage with required arguments
2478
+ #
2479
+ # source://thor//lib/thor/command.rb#77
2480
+ def required_arguments_for(klass, usage); end
2481
+
2482
+ # source://thor//lib/thor/command.rb#91
2483
+ def required_options; end
2484
+
2485
+ # source://thor//lib/thor/command.rb#109
2486
+ def sans_backtrace(backtrace, caller); end
2487
+
2488
+ private
2489
+
2490
+ # source://thor//lib/thor/command.rb#9
2491
+ def initialize_copy(other); end
2492
+ end
2493
+
2494
+ # source://thor//lib/thor/command.rb#3
2495
+ Thor::Command::FILE_REGEXP = T.let(T.unsafe(nil), Regexp)
2496
+
2497
+ # source://thor//lib/thor/core_ext/hash_with_indifferent_access.rb#2
2498
+ module Thor::CoreExt; end
2499
+
2500
+ # A hash with indifferent access and magic predicates.
2501
+ #
2502
+ # hash = Thor::CoreExt::HashWithIndifferentAccess.new 'foo' => 'bar', 'baz' => 'bee', 'force' => true
2503
+ #
2504
+ # hash[:foo] #=> 'bar'
2505
+ # hash['foo'] #=> 'bar'
2506
+ # hash.foo? #=> true
2507
+ #
2508
+ # source://thor//lib/thor/core_ext/hash_with_indifferent_access.rb#11
2509
+ class Thor::CoreExt::HashWithIndifferentAccess < ::Hash
2510
+ # @return [HashWithIndifferentAccess] a new instance of HashWithIndifferentAccess
2511
+ #
2512
+ # source://thor//lib/thor/core_ext/hash_with_indifferent_access.rb#12
2513
+ def initialize(hash = T.unsafe(nil)); end
2514
+
2515
+ # source://thor//lib/thor/core_ext/hash_with_indifferent_access.rb#19
2516
+ def [](key); end
2517
+
2518
+ # source://thor//lib/thor/core_ext/hash_with_indifferent_access.rb#23
2519
+ def []=(key, value); end
2520
+
2521
+ # source://thor//lib/thor/core_ext/hash_with_indifferent_access.rb#27
2522
+ def delete(key); end
2523
+
2524
+ # source://thor//lib/thor/core_ext/hash_with_indifferent_access.rb#31
2525
+ def except(*keys); end
2526
+
2527
+ # source://thor//lib/thor/core_ext/hash_with_indifferent_access.rb#37
2528
+ def fetch(key, *args); end
2529
+
2530
+ # @return [Boolean]
2531
+ #
2532
+ # source://thor//lib/thor/core_ext/hash_with_indifferent_access.rb#45
2533
+ def key?(key); end
2534
+
2535
+ # source://thor//lib/thor/core_ext/hash_with_indifferent_access.rb#53
2536
+ def merge(other); end
2537
+
2538
+ # source://thor//lib/thor/core_ext/hash_with_indifferent_access.rb#57
2539
+ def merge!(other); end
2540
+
2541
+ # source://thor//lib/thor/core_ext/hash_with_indifferent_access.rb#72
2542
+ def replace(other_hash); end
2543
+
2544
+ # source://thor//lib/thor/core_ext/hash_with_indifferent_access.rb#64
2545
+ def reverse_merge(other); end
2546
+
2547
+ # source://thor//lib/thor/core_ext/hash_with_indifferent_access.rb#68
2548
+ def reverse_merge!(other_hash); end
2549
+
2550
+ # source://thor//lib/thor/core_ext/hash_with_indifferent_access.rb#41
2551
+ def slice(*keys); end
2552
+
2553
+ # Convert to a Hash with String keys.
2554
+ #
2555
+ # source://thor//lib/thor/core_ext/hash_with_indifferent_access.rb#77
2556
+ def to_hash; end
2557
+
2558
+ # source://thor//lib/thor/core_ext/hash_with_indifferent_access.rb#49
2559
+ def values_at(*indices); end
2560
+
2561
+ protected
2562
+
2563
+ # source://thor//lib/thor/core_ext/hash_with_indifferent_access.rb#83
2564
+ def convert_key(key); end
2565
+
2566
+ # Magic predicates. For instance:
2567
+ #
2568
+ # options.force? # => !!options['force']
2569
+ # options.shebang # => "/usr/lib/local/ruby"
2570
+ # options.test_framework?(:rspec) # => options[:test_framework] == :rspec
2571
+ #
2572
+ # source://thor//lib/thor/core_ext/hash_with_indifferent_access.rb#93
2573
+ def method_missing(method, *args); end
2574
+ end
2575
+
2576
+ # source://thor//lib/thor/error.rb#3
2577
+ module Thor::Correctable
2578
+ # source://thor//lib/thor/error.rb#8
2579
+ def corrections; end
2580
+
2581
+ # source://thor//lib/thor/error.rb#4
2582
+ def to_s; end
2583
+ end
2584
+
2585
+ # A dynamic command that handles method missing scenarios.
2586
+ #
2587
+ # source://thor//lib/thor/command.rb#137
2588
+ class Thor::DynamicCommand < ::Thor::Command
2589
+ # @return [DynamicCommand] a new instance of DynamicCommand
2590
+ #
2591
+ # source://thor//lib/thor/command.rb#138
2592
+ def initialize(name, options = T.unsafe(nil)); end
2593
+
2594
+ # source://thor//lib/thor/command.rb#142
2595
+ def run(instance, args = T.unsafe(nil)); end
2596
+ end
2597
+
2598
+ # source://thor//lib/thor/command.rb#150
2599
+ Thor::DynamicTask = Thor::DynamicCommand
2600
+
2601
+ # Thor::Error is raised when it's caused by wrong usage of thor classes. Those
2602
+ # errors have their backtrace suppressed and are nicely shown to the user.
2603
+ #
2604
+ # Errors that are caused by the developer, like declaring a method which
2605
+ # overwrites a thor keyword, SHOULD NOT raise a Thor::Error. This way, we
2606
+ # ensure that developer errors are shown with full backtrace.
2607
+ #
2608
+ # source://thor//lib/thor/error.rb#20
2609
+ class Thor::Error < ::StandardError; end
2610
+
2611
+ # source://thor//lib/thor/error.rb#101
2612
+ class Thor::ExclusiveArgumentError < ::Thor::InvocationError; end
2613
+
2614
+ # Thor has a special class called Thor::Group. The main difference to Thor class
2615
+ # is that it invokes all commands at once. It also include some methods that allows
2616
+ # invocations to be done at the class method, which are not available to Thor
2617
+ # commands.
2618
+ #
2619
+ # source://thor//lib/thor/group.rb#7
2620
+ class Thor::Group
2621
+ include ::Thor::Base
2622
+ include ::Thor::Invocation
2623
+ include ::Thor::Shell
2624
+ extend ::Thor::Base::ClassMethods
2625
+ extend ::Thor::Invocation::ClassMethods
2626
+
2627
+ protected
2628
+
2629
+ # Shortcut to invoke with padding and block handling. Use internally by
2630
+ # invoke and invoke_from_option class methods.
2631
+ #
2632
+ # source://thor//lib/thor/group.rb#265
2633
+ def _invoke_for_class_method(klass, command = T.unsafe(nil), *args, &block); end
2634
+
2635
+ class << self
2636
+ # Overwrite class options help to allow invoked generators options to be
2637
+ # shown recursively when invoking a generator.
2638
+ #
2639
+ # source://thor//lib/thor/group.rb#161
2640
+ def class_options_help(shell, groups = T.unsafe(nil)); end
2641
+
2642
+ # The description for this Thor::Group. If none is provided, but a source root
2643
+ # exists, tries to find the USAGE one folder above it, otherwise searches
2644
+ # in the superclass.
2645
+ #
2646
+ # ==== Parameters
2647
+ # description<String>:: The description for this Thor::Group.
2648
+ #
2649
+ # source://thor//lib/thor/group.rb#16
2650
+ def desc(description = T.unsafe(nil)); end
2651
+
2652
+ # Get invocations array and merge options from invocations. Those
2653
+ # options are added to group_options hash. Options that already exists
2654
+ # in base_options are not added twice.
2655
+ #
2656
+ # source://thor//lib/thor/group.rb#172
2657
+ def get_options_from_invocations(group_options, base_options); end
2658
+
2659
+ # @raise [error]
2660
+ #
2661
+ # source://thor//lib/thor/group.rb#207
2662
+ def handle_argument_error(command, error, _args, arity); end
2663
+
2664
+ # Prints help information.
2665
+ #
2666
+ # ==== Options
2667
+ # short:: When true, shows only usage.
2668
+ #
2669
+ # source://thor//lib/thor/group.rb#29
2670
+ def help(shell); end
2671
+
2672
+ # Stores invocation blocks used on invoke_from_option.
2673
+ #
2674
+ # source://thor//lib/thor/group.rb#45
2675
+ def invocation_blocks; end
2676
+
2677
+ # Stores invocations for this class merging with superclass values.
2678
+ #
2679
+ # source://thor//lib/thor/group.rb#39
2680
+ def invocations; end
2681
+
2682
+ # Invoke the given namespace or class given. It adds an instance
2683
+ # method that will invoke the klass and command. You can give a block to
2684
+ # configure how it will be invoked.
2685
+ #
2686
+ # The namespace/class given will have its options showed on the help
2687
+ # usage. Check invoke_from_option for more information.
2688
+ #
2689
+ # source://thor//lib/thor/group.rb#56
2690
+ def invoke(*names, &block); end
2691
+
2692
+ # Invoke a thor class based on the value supplied by the user to the
2693
+ # given option named "name". A class option must be created before this
2694
+ # method is invoked for each name given.
2695
+ #
2696
+ # ==== Examples
2697
+ #
2698
+ # class GemGenerator < Thor::Group
2699
+ # class_option :test_framework, :type => :string
2700
+ # invoke_from_option :test_framework
2701
+ # end
2702
+ #
2703
+ # ==== Boolean options
2704
+ #
2705
+ # In some cases, you want to invoke a thor class if some option is true or
2706
+ # false. This is automatically handled by invoke_from_option. Then the
2707
+ # option name is used to invoke the generator.
2708
+ #
2709
+ # ==== Preparing for invocation
2710
+ #
2711
+ # In some cases you want to customize how a specified hook is going to be
2712
+ # invoked. You can do that by overwriting the class method
2713
+ # prepare_for_invocation. The class method must necessarily return a klass
2714
+ # and an optional command.
2715
+ #
2716
+ # ==== Custom invocations
2717
+ #
2718
+ # You can also supply a block to customize how the option is going to be
2719
+ # invoked. The block receives two parameters, an instance of the current
2720
+ # class and the klass to be invoked.
2721
+ #
2722
+ # source://thor//lib/thor/group.rb#110
2723
+ def invoke_from_option(*names, &block); end
2724
+
2725
+ # Returns commands ready to be printed.
2726
+ #
2727
+ # source://thor//lib/thor/group.rb#199
2728
+ def printable_commands(*_arg0); end
2729
+
2730
+ # Returns commands ready to be printed.
2731
+ #
2732
+ # source://thor//lib/thor/group.rb#199
2733
+ def printable_tasks(*_arg0); end
2734
+
2735
+ # Remove a previously added invocation.
2736
+ #
2737
+ # ==== Examples
2738
+ #
2739
+ # remove_invocation :test_framework
2740
+ #
2741
+ # source://thor//lib/thor/group.rb#149
2742
+ def remove_invocation(*names); end
2743
+
2744
+ protected
2745
+
2746
+ # The banner for this class. You can customize it if you are invoking the
2747
+ # thor class by another ways which is not the Thor::Runner.
2748
+ #
2749
+ # source://thor//lib/thor/group.rb#238
2750
+ def banner; end
2751
+
2752
+ # source://thor//lib/thor/group.rb#248
2753
+ def baseclass; end
2754
+
2755
+ # source://thor//lib/thor/group.rb#252
2756
+ def create_command(meth); end
2757
+
2758
+ # source://thor//lib/thor/group.rb#252
2759
+ def create_task(meth); end
2760
+
2761
+ # The method responsible for dispatching given the args.
2762
+ #
2763
+ # @yield [instance]
2764
+ #
2765
+ # source://thor//lib/thor/group.rb#217
2766
+ def dispatch(command, given_args, given_opts, config); end
2767
+
2768
+ # Represents the whole class as a command.
2769
+ #
2770
+ # source://thor//lib/thor/group.rb#243
2771
+ def self_command; end
2772
+
2773
+ # Represents the whole class as a command.
2774
+ #
2775
+ # source://thor//lib/thor/group.rb#243
2776
+ def self_task; end
2777
+ end
2778
+ end
2779
+
2780
+ # Shortcuts for help.
2781
+ #
2782
+ # source://thor//lib/thor/base.rb#17
2783
+ Thor::HELP_MAPPINGS = T.let(T.unsafe(nil), Array)
2784
+
2785
+ # A command that is hidden in help messages but still invocable.
2786
+ #
2787
+ # source://thor//lib/thor/command.rb#129
2788
+ class Thor::HiddenCommand < ::Thor::Command
2789
+ # @return [Boolean]
2790
+ #
2791
+ # source://thor//lib/thor/command.rb#130
2792
+ def hidden?; end
2793
+ end
2794
+
2795
+ # source://thor//lib/thor/command.rb#134
2796
+ Thor::HiddenTask = Thor::HiddenCommand
2797
+
2798
+ # source://thor//lib/thor/invocation.rb#2
2799
+ module Thor::Invocation
2800
+ mixes_in_class_methods ::Thor::Invocation::ClassMethods
2801
+
2802
+ # Make initializer aware of invocations and the initialization args.
2803
+ #
2804
+ # source://thor//lib/thor/invocation.rb#23
2805
+ def initialize(args = T.unsafe(nil), options = T.unsafe(nil), config = T.unsafe(nil), &block); end
2806
+
2807
+ # Make the current command chain accessible with in a Thor-(sub)command
2808
+ #
2809
+ # source://thor//lib/thor/invocation.rb#30
2810
+ def current_command_chain; end
2811
+
2812
+ # Receives a name and invokes it. The name can be a string (either "command" or
2813
+ # "namespace:command"), a Thor::Command, a Class or a Thor instance. If the
2814
+ # command cannot be guessed by name, it can also be supplied as second argument.
2815
+ #
2816
+ # You can also supply the arguments, options and configuration values for
2817
+ # the command to be invoked, if none is given, the same values used to
2818
+ # initialize the invoker are used to initialize the invoked.
2819
+ #
2820
+ # When no name is given, it will invoke the default command of the current class.
2821
+ #
2822
+ # ==== Examples
2823
+ #
2824
+ # class A < Thor
2825
+ # def foo
2826
+ # invoke :bar
2827
+ # invoke "b:hello", ["Erik"]
2828
+ # end
2829
+ #
2830
+ # def bar
2831
+ # invoke "b:hello", ["Erik"]
2832
+ # end
2833
+ # end
2834
+ #
2835
+ # class B < Thor
2836
+ # def hello(name)
2837
+ # puts "hello #{name}"
2838
+ # end
2839
+ # end
2840
+ #
2841
+ # You can notice that the method "foo" above invokes two commands: "bar",
2842
+ # which belongs to the same class and "hello" which belongs to the class B.
2843
+ #
2844
+ # By using an invocation system you ensure that a command is invoked only once.
2845
+ # In the example above, invoking "foo" will invoke "b:hello" just once, even
2846
+ # if it's invoked later by "bar" method.
2847
+ #
2848
+ # When class A invokes class B, all arguments used on A initialization are
2849
+ # supplied to B. This allows lazy parse of options. Let's suppose you have
2850
+ # some rspec commands:
2851
+ #
2852
+ # class Rspec < Thor::Group
2853
+ # class_option :mock_framework, :type => :string, :default => :rr
2854
+ #
2855
+ # def invoke_mock_framework
2856
+ # invoke "rspec:#{options[:mock_framework]}"
2857
+ # end
2858
+ # end
2859
+ #
2860
+ # As you noticed, it invokes the given mock framework, which might have its
2861
+ # own options:
2862
+ #
2863
+ # class Rspec::RR < Thor::Group
2864
+ # class_option :style, :type => :string, :default => :mock
2865
+ # end
2866
+ #
2867
+ # Since it's not rspec concern to parse mock framework options, when RR
2868
+ # is invoked all options are parsed again, so RR can extract only the options
2869
+ # that it's going to use.
2870
+ #
2871
+ # If you want Rspec::RR to be initialized with its own set of options, you
2872
+ # have to do that explicitly:
2873
+ #
2874
+ # invoke "rspec:rr", [], :style => :foo
2875
+ #
2876
+ # Besides giving an instance, you can also give a class to invoke:
2877
+ #
2878
+ # invoke Rspec::RR, [], :style => :foo
2879
+ #
2880
+ # source://thor//lib/thor/invocation.rb#102
2881
+ def invoke(name = T.unsafe(nil), *args); end
2882
+
2883
+ # Invoke all commands for the current instance.
2884
+ #
2885
+ # source://thor//lib/thor/invocation.rb#133
2886
+ def invoke_all; end
2887
+
2888
+ # Invoke the given command if the given args.
2889
+ #
2890
+ # source://thor//lib/thor/invocation.rb#122
2891
+ def invoke_command(command, *args); end
2892
+
2893
+ # Invoke the given command if the given args.
2894
+ #
2895
+ # source://thor//lib/thor/invocation.rb#122
2896
+ def invoke_task(command, *args); end
2897
+
2898
+ # Invokes using shell padding.
2899
+ #
2900
+ # source://thor//lib/thor/invocation.rb#138
2901
+ def invoke_with_padding(*args); end
2902
+
2903
+ protected
2904
+
2905
+ # Initialize klass using values stored in the @_initializer.
2906
+ #
2907
+ # source://thor//lib/thor/invocation.rb#166
2908
+ def _parse_initialization_options(args, opts, config); end
2909
+
2910
+ # This method simply retrieves the class and command to be invoked.
2911
+ # If the name is nil or the given name is a command in the current class,
2912
+ # use the given name and return self as class. Otherwise, call
2913
+ # prepare_for_invocation in the current class.
2914
+ #
2915
+ # source://thor//lib/thor/invocation.rb#153
2916
+ def _retrieve_class_and_command(name, sent_command = T.unsafe(nil)); end
2917
+
2918
+ # This method simply retrieves the class and command to be invoked.
2919
+ # If the name is nil or the given name is a command in the current class,
2920
+ # use the given name and return self as class. Otherwise, call
2921
+ # prepare_for_invocation in the current class.
2922
+ #
2923
+ # source://thor//lib/thor/invocation.rb#153
2924
+ def _retrieve_class_and_task(name, sent_command = T.unsafe(nil)); end
2925
+
2926
+ # Configuration values that are shared between invocations.
2927
+ #
2928
+ # source://thor//lib/thor/invocation.rb#145
2929
+ def _shared_configuration; end
2930
+
2931
+ class << self
2932
+ # source://thor//lib/thor/invocation.rb#3
2933
+ def included(base); end
2934
+ end
2935
+ end
2936
+
2937
+ # source://thor//lib/thor/invocation.rb#8
2938
+ module Thor::Invocation::ClassMethods
2939
+ # This method is responsible for receiving a name and find the proper
2940
+ # class and command for it. The key is an optional parameter which is
2941
+ # available only in class methods invocations (i.e. in Thor::Group).
2942
+ #
2943
+ # source://thor//lib/thor/invocation.rb#12
2944
+ def prepare_for_invocation(key, name); end
2945
+ end
2946
+
2947
+ # Raised when a command was found, but not invoked properly.
2948
+ #
2949
+ # source://thor//lib/thor/error.rb#62
2950
+ class Thor::InvocationError < ::Thor::Error; end
2951
+
2952
+ # source://thor//lib/thor/line_editor/basic.rb#2
2953
+ module Thor::LineEditor
2954
+ class << self
2955
+ # source://thor//lib/thor/line_editor.rb#10
2956
+ def best_available; end
2957
+
2958
+ # source://thor//lib/thor/line_editor.rb#6
2959
+ def readline(prompt, options = T.unsafe(nil)); end
2960
+ end
2961
+ end
2962
+
2963
+ # source://thor//lib/thor/line_editor/basic.rb#3
2964
+ class Thor::LineEditor::Basic
2965
+ # @return [Basic] a new instance of Basic
2966
+ #
2967
+ # source://thor//lib/thor/line_editor/basic.rb#10
2968
+ def initialize(prompt, options); end
2969
+
2970
+ # Returns the value of attribute options.
2971
+ #
2972
+ # source://thor//lib/thor/line_editor/basic.rb#4
2973
+ def options; end
2974
+
2975
+ # Returns the value of attribute prompt.
2976
+ #
2977
+ # source://thor//lib/thor/line_editor/basic.rb#4
2978
+ def prompt; end
2979
+
2980
+ # source://thor//lib/thor/line_editor/basic.rb#15
2981
+ def readline; end
2982
+
2983
+ private
2984
+
2985
+ # @return [Boolean]
2986
+ #
2987
+ # source://thor//lib/thor/line_editor/basic.rb#32
2988
+ def echo?; end
2989
+
2990
+ # source://thor//lib/thor/line_editor/basic.rb#22
2991
+ def get_input; end
2992
+
2993
+ class << self
2994
+ # @return [Boolean]
2995
+ #
2996
+ # source://thor//lib/thor/line_editor/basic.rb#6
2997
+ def available?; end
2998
+ end
2999
+ end
3000
+
3001
+ # source://thor//lib/thor/line_editor/readline.rb#3
3002
+ class Thor::LineEditor::Readline < ::Thor::LineEditor::Basic
3003
+ # source://thor//lib/thor/line_editor/readline.rb#13
3004
+ def readline; end
3005
+
3006
+ private
3007
+
3008
+ # @return [Boolean]
3009
+ #
3010
+ # source://thor//lib/thor/line_editor/readline.rb#28
3011
+ def add_to_history?; end
3012
+
3013
+ # source://thor//lib/thor/line_editor/readline.rb#42
3014
+ def completion_options; end
3015
+
3016
+ # source://thor//lib/thor/line_editor/readline.rb#32
3017
+ def completion_proc; end
3018
+
3019
+ # @return [Boolean]
3020
+ #
3021
+ # source://thor//lib/thor/line_editor/readline.rb#46
3022
+ def use_path_completion?; end
3023
+
3024
+ class << self
3025
+ # @return [Boolean]
3026
+ #
3027
+ # source://thor//lib/thor/line_editor/readline.rb#4
3028
+ def available?; end
3029
+ end
3030
+ end
3031
+
3032
+ # source://thor//lib/thor/line_editor/readline.rb#50
3033
+ class Thor::LineEditor::Readline::PathCompletion
3034
+ # @return [PathCompletion] a new instance of PathCompletion
3035
+ #
3036
+ # source://thor//lib/thor/line_editor/readline.rb#54
3037
+ def initialize(text); end
3038
+
3039
+ # source://thor//lib/thor/line_editor/readline.rb#58
3040
+ def matches; end
3041
+
3042
+ private
3043
+
3044
+ # source://thor//lib/thor/line_editor/readline.rb#68
3045
+ def absolute_matches; end
3046
+
3047
+ # source://thor//lib/thor/line_editor/readline.rb#82
3048
+ def base_path; end
3049
+
3050
+ # source://thor//lib/thor/line_editor/readline.rb#78
3051
+ def glob_pattern; end
3052
+
3053
+ # source://thor//lib/thor/line_editor/readline.rb#64
3054
+ def relative_matches; end
3055
+
3056
+ # Returns the value of attribute text.
3057
+ #
3058
+ # source://thor//lib/thor/line_editor/readline.rb#51
3059
+ def text; end
3060
+ end
3061
+
3062
+ # source://thor//lib/thor/error.rb#98
3063
+ class Thor::MalformattedArgumentError < ::Thor::InvocationError; end
3064
+
3065
+ # source://thor//lib/thor/nested_context.rb#2
3066
+ class Thor::NestedContext
3067
+ # @return [NestedContext] a new instance of NestedContext
3068
+ #
3069
+ # source://thor//lib/thor/nested_context.rb#3
3070
+ def initialize; end
3071
+
3072
+ # source://thor//lib/thor/nested_context.rb#7
3073
+ def enter; end
3074
+
3075
+ # @return [Boolean]
3076
+ #
3077
+ # source://thor//lib/thor/nested_context.rb#15
3078
+ def entered?; end
3079
+
3080
+ private
3081
+
3082
+ # source://thor//lib/thor/nested_context.rb#25
3083
+ def pop; end
3084
+
3085
+ # source://thor//lib/thor/nested_context.rb#21
3086
+ def push; end
3087
+ end
3088
+
3089
+ # source://thor//lib/thor/parser/option.rb#2
3090
+ class Thor::Option < ::Thor::Argument
3091
+ # @return [Option] a new instance of Option
3092
+ #
3093
+ # source://thor//lib/thor/parser/option.rb#7
3094
+ def initialize(name, options = T.unsafe(nil)); end
3095
+
3096
+ # Returns the value of attribute aliases.
3097
+ #
3098
+ # source://thor//lib/thor/parser/option.rb#3
3099
+ def aliases; end
3100
+
3101
+ # source://thor//lib/thor/parser/option.rb#99
3102
+ def aliases_for_usage; end
3103
+
3104
+ # source://thor//lib/thor/parser/option.rb#118
3105
+ def array?; end
3106
+
3107
+ # source://thor//lib/thor/parser/option.rb#118
3108
+ def boolean?; end
3109
+
3110
+ # Returns the value of attribute group.
3111
+ #
3112
+ # source://thor//lib/thor/parser/option.rb#3
3113
+ def group; end
3114
+
3115
+ # source://thor//lib/thor/parser/option.rb#118
3116
+ def hash?; end
3117
+
3118
+ # Returns the value of attribute hide.
3119
+ #
3120
+ # source://thor//lib/thor/parser/option.rb#3
3121
+ def hide; end
3122
+
3123
+ # source://thor//lib/thor/parser/option.rb#79
3124
+ def human_name; end
3125
+
3126
+ # Returns the value of attribute lazy_default.
3127
+ #
3128
+ # source://thor//lib/thor/parser/option.rb#3
3129
+ def lazy_default; end
3130
+
3131
+ # source://thor//lib/thor/parser/option.rb#118
3132
+ def numeric?; end
3133
+
3134
+ # Returns the value of attribute repeatable.
3135
+ #
3136
+ # source://thor//lib/thor/parser/option.rb#3
3137
+ def repeatable; end
3138
+
3139
+ # @return [Boolean]
3140
+ #
3141
+ # source://thor//lib/thor/parser/option.rb#107
3142
+ def show_default?; end
3143
+
3144
+ # source://thor//lib/thor/parser/option.rb#118
3145
+ def string?; end
3146
+
3147
+ # source://thor//lib/thor/parser/option.rb#75
3148
+ def switch_name; end
3149
+
3150
+ # source://thor//lib/thor/parser/option.rb#83
3151
+ def usage(padding = T.unsafe(nil)); end
3152
+
3153
+ protected
3154
+
3155
+ # source://thor//lib/thor/parser/option.rb#168
3156
+ def dasherize(str); end
3157
+
3158
+ # @return [Boolean]
3159
+ #
3160
+ # source://thor//lib/thor/parser/option.rb#160
3161
+ def dasherized?; end
3162
+
3163
+ # source://thor//lib/thor/parser/option.rb#164
3164
+ def undasherize(str); end
3165
+
3166
+ # @raise [ArgumentError]
3167
+ #
3168
+ # source://thor//lib/thor/parser/option.rb#126
3169
+ def validate!; end
3170
+
3171
+ # source://thor//lib/thor/parser/option.rb#131
3172
+ def validate_default_type!; end
3173
+
3174
+ private
3175
+
3176
+ # source://thor//lib/thor/parser/option.rb#174
3177
+ def normalize_aliases(aliases); end
3178
+
3179
+ class << self
3180
+ # This parse quick options given as method_options. It makes several
3181
+ # assumptions, but you can be more specific using the option method.
3182
+ #
3183
+ # parse :foo => "bar"
3184
+ # #=> Option foo with default value bar
3185
+ #
3186
+ # parse [:foo, :baz] => "bar"
3187
+ # #=> Option foo with default value bar and alias :baz
3188
+ #
3189
+ # parse :foo => :required
3190
+ # #=> Required option foo without default value
3191
+ #
3192
+ # parse :foo => 2
3193
+ # #=> Option foo with default value 2 and type numeric
3194
+ #
3195
+ # parse :foo => :numeric
3196
+ # #=> Option foo without default value and type numeric
3197
+ #
3198
+ # parse :foo => true
3199
+ # #=> Option foo with default value true and type boolean
3200
+ #
3201
+ # The valid types are :boolean, :numeric, :hash, :array and :string. If none
3202
+ # is given a default type is assumed. This default type accepts arguments as
3203
+ # string (--foo=value) or booleans (just --foo).
3204
+ #
3205
+ # By default all options are optional, unless :required is given.
3206
+ #
3207
+ # source://thor//lib/thor/parser/option.rb#45
3208
+ def parse(key, value); end
3209
+ end
3210
+ end
3211
+
3212
+ # source://thor//lib/thor/parser/option.rb#5
3213
+ Thor::Option::VALID_TYPES = T.let(T.unsafe(nil), Array)
3214
+
3215
+ # source://thor//lib/thor/parser/options.rb#2
3216
+ class Thor::Options < ::Thor::Arguments
3217
+ # Takes a hash of Thor::Option and a hash with defaults.
3218
+ #
3219
+ # If +stop_on_unknown+ is true, #parse will stop as soon as it encounters
3220
+ # an unknown option or a regular argument.
3221
+ #
3222
+ # @return [Options] a new instance of Options
3223
+ #
3224
+ # source://thor//lib/thor/parser/options.rb#32
3225
+ def initialize(hash_options = T.unsafe(nil), defaults = T.unsafe(nil), stop_on_unknown = T.unsafe(nil), disable_required_check = T.unsafe(nil), relations = T.unsafe(nil)); end
3226
+
3227
+ # source://thor//lib/thor/parser/options.rb#156
3228
+ def check_at_least_one!; end
3229
+
3230
+ # source://thor//lib/thor/parser/options.rb#144
3231
+ def check_exclusive!; end
3232
+
3233
+ # @raise [UnknownArgumentError]
3234
+ #
3235
+ # source://thor//lib/thor/parser/options.rb#168
3236
+ def check_unknown!; end
3237
+
3238
+ # source://thor//lib/thor/parser/options.rb#89
3239
+ def parse(args); end
3240
+
3241
+ # source://thor//lib/thor/parser/options.rb#65
3242
+ def peek; end
3243
+
3244
+ # source://thor//lib/thor/parser/options.rb#61
3245
+ def remaining; end
3246
+
3247
+ # source://thor//lib/thor/parser/options.rb#79
3248
+ def shift; end
3249
+
3250
+ # source://thor//lib/thor/parser/options.rb#84
3251
+ def unshift(arg, is_value: T.unsafe(nil)); end
3252
+
3253
+ protected
3254
+
3255
+ # source://thor//lib/thor/parser/options.rb#189
3256
+ def assign_result!(option, result); end
3257
+
3258
+ # Check if the current value in peek is a registered switch.
3259
+ #
3260
+ # Two booleans are returned. The first is true if the current value
3261
+ # starts with a hyphen; the second is true if it is a registered switch.
3262
+ #
3263
+ # @return [Boolean]
3264
+ #
3265
+ # source://thor//lib/thor/parser/options.rb#203
3266
+ def current_is_switch?; end
3267
+
3268
+ # @return [Boolean]
3269
+ #
3270
+ # source://thor//lib/thor/parser/options.rb#215
3271
+ def current_is_switch_formatted?; end
3272
+
3273
+ # @return [Boolean]
3274
+ #
3275
+ # source://thor//lib/thor/parser/options.rb#225
3276
+ def current_is_value?; end
3277
+
3278
+ # Option names changes to swith name or human name
3279
+ #
3280
+ # source://thor//lib/thor/parser/options.rb#179
3281
+ def names_to_switch_names(names = T.unsafe(nil)); end
3282
+
3283
+ # Check if the given argument is actually a shortcut.
3284
+ #
3285
+ # source://thor//lib/thor/parser/options.rb#244
3286
+ def normalize_switch(arg); end
3287
+
3288
+ # Parse boolean values which can be given as --foo=true or --foo for true values, or
3289
+ # --foo=false, --no-foo or --skip-foo for false values.
3290
+ #
3291
+ # source://thor//lib/thor/parser/options.rb#256
3292
+ def parse_boolean(switch); end
3293
+
3294
+ # Parse the value at the peek analyzing if it requires an input or not.
3295
+ #
3296
+ # source://thor//lib/thor/parser/options.rb#274
3297
+ def parse_peek(switch, option); end
3298
+
3299
+ # @return [Boolean]
3300
+ #
3301
+ # source://thor//lib/thor/parser/options.rb#248
3302
+ def parsing_options?; end
3303
+
3304
+ # @return [Boolean]
3305
+ #
3306
+ # source://thor//lib/thor/parser/options.rb#230
3307
+ def switch?(arg); end
3308
+
3309
+ # source://thor//lib/thor/parser/options.rb#234
3310
+ def switch_option(arg); end
3311
+
3312
+ class << self
3313
+ # Receives a hash and makes it switches.
3314
+ #
3315
+ # source://thor//lib/thor/parser/options.rb#11
3316
+ def to_switches(options); end
3317
+ end
3318
+ end
3319
+
3320
+ # source://thor//lib/thor/parser/options.rb#5
3321
+ Thor::Options::EQ_RE = T.let(T.unsafe(nil), Regexp)
3322
+
3323
+ # source://thor//lib/thor/parser/options.rb#3
3324
+ Thor::Options::LONG_RE = T.let(T.unsafe(nil), Regexp)
3325
+
3326
+ # source://thor//lib/thor/parser/options.rb#8
3327
+ Thor::Options::OPTS_END = T.let(T.unsafe(nil), String)
3328
+
3329
+ # source://thor//lib/thor/parser/options.rb#7
3330
+ Thor::Options::SHORT_NUM = T.let(T.unsafe(nil), Regexp)
3331
+
3332
+ # source://thor//lib/thor/parser/options.rb#4
3333
+ Thor::Options::SHORT_RE = T.let(T.unsafe(nil), Regexp)
3334
+
3335
+ # Allow either -x -v or -xv style for single char args
3336
+ #
3337
+ # source://thor//lib/thor/parser/options.rb#6
3338
+ Thor::Options::SHORT_SQ_RE = T.let(T.unsafe(nil), Regexp)
3339
+
3340
+ # Adds a compatibility layer to your Thor classes which allows you to use
3341
+ # rake package tasks. For example, to use rspec rake tasks, one can do:
3342
+ #
3343
+ # require 'thor/rake_compat'
3344
+ # require 'rspec/core/rake_task'
3345
+ #
3346
+ # class Default < Thor
3347
+ # include Thor::RakeCompat
3348
+ #
3349
+ # RSpec::Core::RakeTask.new(:spec) do |t|
3350
+ # t.spec_opts = ['--options', './.rspec']
3351
+ # t.spec_files = FileList['spec/**/*_spec.rb']
3352
+ # end
3353
+ # end
3354
+ #
3355
+ # source://thor//lib/thor/rake_compat.rb#20
3356
+ module Thor::RakeCompat
3357
+ include ::FileUtils::StreamUtils_
3358
+ include ::FileUtils
3359
+ include ::Rake::FileUtilsExt
3360
+ include ::Rake::DSL
3361
+
3362
+ class << self
3363
+ # @private
3364
+ #
3365
+ # source://thor//lib/thor/rake_compat.rb#27
3366
+ def included(base); end
3367
+
3368
+ # source://thor//lib/thor/rake_compat.rb#23
3369
+ def rake_classes; end
3370
+ end
3371
+ end
3372
+
3373
+ # source://thor//lib/thor/error.rb#95
3374
+ class Thor::RequiredArgumentMissingError < ::Thor::InvocationError; end
3375
+
3376
+ # source://thor//lib/thor/util.rb#4
3377
+ module Thor::Sandbox; end
3378
+
3379
+ # source://thor//lib/thor/shell.rb#23
3380
+ module Thor::Shell
3381
+ # Add shell to initialize config values.
3382
+ #
3383
+ # ==== Configuration
3384
+ # shell<Object>:: An instance of the shell to be used.
3385
+ #
3386
+ # ==== Examples
3387
+ #
3388
+ # class MyScript < Thor
3389
+ # argument :first, :type => :numeric
3390
+ # end
3391
+ #
3392
+ # MyScript.new [1.0], { :foo => :bar }, :shell => Thor::Shell::Basic.new
3393
+ #
3394
+ # source://thor//lib/thor/shell.rb#44
3395
+ def initialize(args = T.unsafe(nil), options = T.unsafe(nil), config = T.unsafe(nil)); end
3396
+
3397
+ # source://thor//lib/thor/shell.rb#59
3398
+ def ask(*args, &block); end
3399
+
3400
+ # source://thor//lib/thor/shell.rb#59
3401
+ def error(*args, &block); end
3402
+
3403
+ # source://thor//lib/thor/shell.rb#59
3404
+ def file_collision(*args, &block); end
3405
+
3406
+ # source://thor//lib/thor/shell.rb#59
3407
+ def no?(*args, &block); end
3408
+
3409
+ # source://thor//lib/thor/shell.rb#59
3410
+ def print_in_columns(*args, &block); end
3411
+
3412
+ # source://thor//lib/thor/shell.rb#59
3413
+ def print_table(*args, &block); end
3414
+
3415
+ # source://thor//lib/thor/shell.rb#59
3416
+ def print_wrapped(*args, &block); end
3417
+
3418
+ # source://thor//lib/thor/shell.rb#59
3419
+ def say(*args, &block); end
3420
+
3421
+ # source://thor//lib/thor/shell.rb#59
3422
+ def say_error(*args, &block); end
3423
+
3424
+ # source://thor//lib/thor/shell.rb#59
3425
+ def say_status(*args, &block); end
3426
+
3427
+ # source://thor//lib/thor/shell.rb#59
3428
+ def set_color(*args, &block); end
3429
+
3430
+ # Holds the shell for the given Thor instance. If no shell is given,
3431
+ # it gets a default shell from Thor::Base.shell.
3432
+ #
3433
+ # source://thor//lib/thor/shell.rb#52
3434
+ def shell; end
3435
+
3436
+ # Sets the attribute shell
3437
+ #
3438
+ # @param value the value to set the attribute shell to.
3439
+ #
3440
+ # source://thor//lib/thor/shell.rb#25
3441
+ def shell=(_arg0); end
3442
+
3443
+ # source://thor//lib/thor/shell.rb#59
3444
+ def terminal_width(*args, &block); end
3445
+
3446
+ # Yields the given block with padding.
3447
+ #
3448
+ # source://thor//lib/thor/shell.rb#66
3449
+ def with_padding; end
3450
+
3451
+ # source://thor//lib/thor/shell.rb#59
3452
+ def yes?(*args, &block); end
3453
+
3454
+ protected
3455
+
3456
+ # Allow shell to be shared between invocations.
3457
+ #
3458
+ # source://thor//lib/thor/shell.rb#77
3459
+ def _shared_configuration; end
3460
+ end
3461
+
3462
+ # source://thor//lib/thor/shell/basic.rb#7
3463
+ class Thor::Shell::Basic
3464
+ # Initialize base, mute and padding to nil.
3465
+ #
3466
+ # @return [Basic] a new instance of Basic
3467
+ #
3468
+ # source://thor//lib/thor/shell/basic.rb#13
3469
+ def initialize; end
3470
+
3471
+ # Asks something to the user and receives a response.
3472
+ #
3473
+ # If a default value is specified it will be presented to the user
3474
+ # and allows them to select that value with an empty response. This
3475
+ # option is ignored when limited answers are supplied.
3476
+ #
3477
+ # If asked to limit the correct responses, you can pass in an
3478
+ # array of acceptable answers. If one of those is not supplied,
3479
+ # they will be shown a message stating that one of those answers
3480
+ # must be given and re-asked the question.
3481
+ #
3482
+ # If asking for sensitive information, the :echo option can be set
3483
+ # to false to mask user input from $stdin.
3484
+ #
3485
+ # If the required input is a path, then set the path option to
3486
+ # true. This will enable tab completion for file paths relative
3487
+ # to the current working directory on systems that support
3488
+ # Readline.
3489
+ #
3490
+ # ==== Example
3491
+ # ask("What is your name?")
3492
+ #
3493
+ # ask("What is the planet furthest from the sun?", :default => "Neptune")
3494
+ #
3495
+ # ask("What is your favorite Neopolitan flavor?", :limited_to => ["strawberry", "chocolate", "vanilla"])
3496
+ #
3497
+ # ask("What is your password?", :echo => false)
3498
+ #
3499
+ # ask("Where should the file be saved?", :path => true)
3500
+ #
3501
+ # source://thor//lib/thor/shell/basic.rb#80
3502
+ def ask(statement, *args); end
3503
+
3504
+ # Returns the value of attribute base.
3505
+ #
3506
+ # source://thor//lib/thor/shell/basic.rb#8
3507
+ def base; end
3508
+
3509
+ # Sets the attribute base
3510
+ #
3511
+ # @param value the value to set the attribute base to.
3512
+ #
3513
+ # source://thor//lib/thor/shell/basic.rb#8
3514
+ def base=(_arg0); end
3515
+
3516
+ # Called if something goes wrong during the execution. This is used by Thor
3517
+ # internally and should not be used inside your scripts. If something went
3518
+ # wrong, you can always raise an exception. If you raise a Thor::Error, it
3519
+ # will be rescued and wrapped in the method below.
3520
+ #
3521
+ # source://thor//lib/thor/shell/basic.rb#251
3522
+ def error(statement); end
3523
+
3524
+ # Deals with file collision and returns true if the file should be
3525
+ # overwritten and false otherwise. If a block is given, it uses the block
3526
+ # response as the content for the diff.
3527
+ #
3528
+ # ==== Parameters
3529
+ # destination<String>:: the destination file to solve conflicts
3530
+ # block<Proc>:: an optional block that returns the value to be used in diff and merge
3531
+ #
3532
+ # source://thor//lib/thor/shell/basic.rb#207
3533
+ def file_collision(destination); end
3534
+
3535
+ # Sets the output padding while executing a block and resets it.
3536
+ #
3537
+ # source://thor//lib/thor/shell/basic.rb#43
3538
+ def indent(count = T.unsafe(nil)); end
3539
+
3540
+ # Mute everything that's inside given block
3541
+ #
3542
+ # source://thor//lib/thor/shell/basic.rb#22
3543
+ def mute; end
3544
+
3545
+ # Check if base is muted
3546
+ #
3547
+ # @return [Boolean]
3548
+ #
3549
+ # source://thor//lib/thor/shell/basic.rb#31
3550
+ def mute?; end
3551
+
3552
+ # Asks the user a question and returns true if the user replies "n" or
3553
+ # "no".
3554
+ #
3555
+ # @return [Boolean]
3556
+ #
3557
+ # source://thor//lib/thor/shell/basic.rb#156
3558
+ def no?(statement, color = T.unsafe(nil)); end
3559
+
3560
+ # Returns the value of attribute padding.
3561
+ #
3562
+ # source://thor//lib/thor/shell/basic.rb#9
3563
+ def padding; end
3564
+
3565
+ # Sets the output padding, not allowing less than zero values.
3566
+ #
3567
+ # source://thor//lib/thor/shell/basic.rb#37
3568
+ def padding=(value); end
3569
+
3570
+ # Prints values in columns
3571
+ #
3572
+ # ==== Parameters
3573
+ # Array[String, String, ...]
3574
+ #
3575
+ # source://thor//lib/thor/shell/basic.rb#165
3576
+ def print_in_columns(array); end
3577
+
3578
+ # Prints a table.
3579
+ #
3580
+ # ==== Parameters
3581
+ # Array[Array[String, String, ...]]
3582
+ #
3583
+ # ==== Options
3584
+ # indent<Integer>:: Indent the first column by indent value.
3585
+ # colwidth<Integer>:: Force the first column to colwidth spaces wide.
3586
+ # borders<Boolean>:: Adds ascii borders.
3587
+ #
3588
+ # source://thor//lib/thor/shell/basic.rb#180
3589
+ def print_table(array, options = T.unsafe(nil)); end
3590
+
3591
+ # Prints a long string, word-wrapping the text to the current width of the
3592
+ # terminal display. Ideal for printing heredocs.
3593
+ #
3594
+ # ==== Parameters
3595
+ # String
3596
+ #
3597
+ # ==== Options
3598
+ # indent<Integer>:: Indent each line of the printed paragraph by indent value.
3599
+ #
3600
+ # source://thor//lib/thor/shell/basic.rb#194
3601
+ def print_wrapped(message, options = T.unsafe(nil)); end
3602
+
3603
+ # Say (print) something to the user. If the sentence ends with a whitespace
3604
+ # or tab character, a new line is not appended (print + flush). Otherwise
3605
+ # are passed straight to puts (behavior got from Highline).
3606
+ #
3607
+ # ==== Example
3608
+ # say("I know you knew that.")
3609
+ #
3610
+ # source://thor//lib/thor/shell/basic.rb#98
3611
+ def say(message = T.unsafe(nil), color = T.unsafe(nil), force_new_line = T.unsafe(nil)); end
3612
+
3613
+ # Say (print) an error to the user. If the sentence ends with a whitespace
3614
+ # or tab character, a new line is not appended (print + flush). Otherwise
3615
+ # are passed straight to puts (behavior got from Highline).
3616
+ #
3617
+ # ==== Example
3618
+ # say_error("error: something went wrong")
3619
+ #
3620
+ # source://thor//lib/thor/shell/basic.rb#115
3621
+ def say_error(message = T.unsafe(nil), color = T.unsafe(nil), force_new_line = T.unsafe(nil)); end
3622
+
3623
+ # Say a status with the given color and appends the message. Since this
3624
+ # method is used frequently by actions, it allows nil or false to be given
3625
+ # in log_status, avoiding the message from being shown. If a Symbol is
3626
+ # given in log_status, it's used as the color.
3627
+ #
3628
+ # source://thor//lib/thor/shell/basic.rb#130
3629
+ def say_status(status, message, log_status = T.unsafe(nil)); end
3630
+
3631
+ # Apply color to the given string with optional bold. Disabled in the
3632
+ # Thor::Shell::Basic class.
3633
+ #
3634
+ # source://thor//lib/thor/shell/basic.rb#258
3635
+ def set_color(string, *_arg1); end
3636
+
3637
+ # Asks the user a question and returns true if the user replies "y" or
3638
+ # "yes".
3639
+ #
3640
+ # @return [Boolean]
3641
+ #
3642
+ # source://thor//lib/thor/shell/basic.rb#149
3643
+ def yes?(statement, color = T.unsafe(nil)); end
3644
+
3645
+ protected
3646
+
3647
+ # source://thor//lib/thor/shell/basic.rb#362
3648
+ def answer_match(possibilities, answer, case_insensitive); end
3649
+
3650
+ # source://thor//lib/thor/shell/basic.rb#349
3651
+ def ask_filtered(statement, color, options); end
3652
+
3653
+ # source://thor//lib/thor/shell/basic.rb#332
3654
+ def ask_simply(statement, color, options); end
3655
+
3656
+ # @return [Boolean]
3657
+ #
3658
+ # source://thor//lib/thor/shell/basic.rb#269
3659
+ def can_display_colors?; end
3660
+
3661
+ # source://thor//lib/thor/shell/basic.rb#296
3662
+ def file_collision_help(block_given); end
3663
+
3664
+ # source://thor//lib/thor/shell/basic.rb#383
3665
+ def git_merge_tool; end
3666
+
3667
+ # @return [Boolean]
3668
+ #
3669
+ # source://thor//lib/thor/shell/basic.rb#286
3670
+ def is?(value); end
3671
+
3672
+ # source://thor//lib/thor/shell/basic.rb#273
3673
+ def lookup_color(color); end
3674
+
3675
+ # source://thor//lib/thor/shell/basic.rb#370
3676
+ def merge(destination, content); end
3677
+
3678
+ # source://thor//lib/thor/shell/basic.rb#379
3679
+ def merge_tool; end
3680
+
3681
+ # source://thor//lib/thor/shell/basic.rb#264
3682
+ def prepare_message(message, *color); end
3683
+
3684
+ # @return [Boolean]
3685
+ #
3686
+ # source://thor//lib/thor/shell/basic.rb#324
3687
+ def quiet?; end
3688
+
3689
+ # source://thor//lib/thor/shell/basic.rb#313
3690
+ def show_diff(destination, content); end
3691
+
3692
+ # source://thor//lib/thor/shell/basic.rb#282
3693
+ def stderr; end
3694
+
3695
+ # source://thor//lib/thor/shell/basic.rb#278
3696
+ def stdout; end
3697
+
3698
+ # @return [Boolean]
3699
+ #
3700
+ # source://thor//lib/thor/shell/basic.rb#328
3701
+ def unix?; end
3702
+ end
3703
+
3704
+ # Inherit from Thor::Shell::Basic and add set_color behavior. Check
3705
+ # Thor::Shell::Basic to see all available methods.
3706
+ #
3707
+ # source://thor//lib/thor/shell/color.rb#9
3708
+ class Thor::Shell::Color < ::Thor::Shell::Basic
3709
+ include ::LCSDiff
3710
+
3711
+ # Set color by using a string or one of the defined constants. If a third
3712
+ # option is set to true, it also adds bold to the string. This is based
3713
+ # on Highline implementation and it automatically appends CLEAR to the end
3714
+ # of the returned String.
3715
+ #
3716
+ # Pass foreground, background and bold options to this method as
3717
+ # symbols.
3718
+ #
3719
+ # Example:
3720
+ #
3721
+ # set_color "Hi!", :red, :on_white, :bold
3722
+ #
3723
+ # The available colors are:
3724
+ #
3725
+ # :bold
3726
+ # :black
3727
+ # :red
3728
+ # :green
3729
+ # :yellow
3730
+ # :blue
3731
+ # :magenta
3732
+ # :cyan
3733
+ # :white
3734
+ # :on_black
3735
+ # :on_red
3736
+ # :on_green
3737
+ # :on_yellow
3738
+ # :on_blue
3739
+ # :on_magenta
3740
+ # :on_cyan
3741
+ # :on_white
3742
+ #
3743
+ # source://thor//lib/thor/shell/color.rb#82
3744
+ def set_color(string, *colors); end
3745
+
3746
+ protected
3747
+
3748
+ # @return [Boolean]
3749
+ #
3750
+ # source://thor//lib/thor/shell/color.rb#110
3751
+ def are_colors_disabled?; end
3752
+
3753
+ # @return [Boolean]
3754
+ #
3755
+ # source://thor//lib/thor/shell/color.rb#106
3756
+ def are_colors_supported?; end
3757
+
3758
+ # @return [Boolean]
3759
+ #
3760
+ # source://thor//lib/thor/shell/color.rb#102
3761
+ def can_display_colors?; end
3762
+ end
3763
+
3764
+ # Set the terminal's foreground ANSI color to black.
3765
+ #
3766
+ # source://thor//lib/thor/shell/color.rb#18
3767
+ Thor::Shell::Color::BLACK = T.let(T.unsafe(nil), String)
3768
+
3769
+ # Set the terminal's foreground ANSI color to blue.
3770
+ #
3771
+ # source://thor//lib/thor/shell/color.rb#26
3772
+ Thor::Shell::Color::BLUE = T.let(T.unsafe(nil), String)
3773
+
3774
+ # The start of an ANSI bold sequence.
3775
+ #
3776
+ # source://thor//lib/thor/shell/color.rb#15
3777
+ Thor::Shell::Color::BOLD = T.let(T.unsafe(nil), String)
3778
+
3779
+ # Embed in a String to clear all previous ANSI sequences.
3780
+ #
3781
+ # source://thor//lib/thor/shell/color.rb#13
3782
+ Thor::Shell::Color::CLEAR = T.let(T.unsafe(nil), String)
3783
+
3784
+ # Set the terminal's foreground ANSI color to cyan.
3785
+ #
3786
+ # source://thor//lib/thor/shell/color.rb#30
3787
+ Thor::Shell::Color::CYAN = T.let(T.unsafe(nil), String)
3788
+
3789
+ # Set the terminal's foreground ANSI color to green.
3790
+ #
3791
+ # source://thor//lib/thor/shell/color.rb#22
3792
+ Thor::Shell::Color::GREEN = T.let(T.unsafe(nil), String)
3793
+
3794
+ # Set the terminal's foreground ANSI color to magenta.
3795
+ #
3796
+ # source://thor//lib/thor/shell/color.rb#28
3797
+ Thor::Shell::Color::MAGENTA = T.let(T.unsafe(nil), String)
3798
+
3799
+ # Set the terminal's background ANSI color to black.
3800
+ #
3801
+ # source://thor//lib/thor/shell/color.rb#35
3802
+ Thor::Shell::Color::ON_BLACK = T.let(T.unsafe(nil), String)
3803
+
3804
+ # Set the terminal's background ANSI color to blue.
3805
+ #
3806
+ # source://thor//lib/thor/shell/color.rb#43
3807
+ Thor::Shell::Color::ON_BLUE = T.let(T.unsafe(nil), String)
3808
+
3809
+ # Set the terminal's background ANSI color to cyan.
3810
+ #
3811
+ # source://thor//lib/thor/shell/color.rb#47
3812
+ Thor::Shell::Color::ON_CYAN = T.let(T.unsafe(nil), String)
3813
+
3814
+ # Set the terminal's background ANSI color to green.
3815
+ #
3816
+ # source://thor//lib/thor/shell/color.rb#39
3817
+ Thor::Shell::Color::ON_GREEN = T.let(T.unsafe(nil), String)
3818
+
3819
+ # Set the terminal's background ANSI color to magenta.
3820
+ #
3821
+ # source://thor//lib/thor/shell/color.rb#45
3822
+ Thor::Shell::Color::ON_MAGENTA = T.let(T.unsafe(nil), String)
3823
+
3824
+ # Set the terminal's background ANSI color to red.
3825
+ #
3826
+ # source://thor//lib/thor/shell/color.rb#37
3827
+ Thor::Shell::Color::ON_RED = T.let(T.unsafe(nil), String)
3828
+
3829
+ # Set the terminal's background ANSI color to white.
3830
+ #
3831
+ # source://thor//lib/thor/shell/color.rb#49
3832
+ Thor::Shell::Color::ON_WHITE = T.let(T.unsafe(nil), String)
3833
+
3834
+ # Set the terminal's background ANSI color to yellow.
3835
+ #
3836
+ # source://thor//lib/thor/shell/color.rb#41
3837
+ Thor::Shell::Color::ON_YELLOW = T.let(T.unsafe(nil), String)
3838
+
3839
+ # Set the terminal's foreground ANSI color to red.
3840
+ #
3841
+ # source://thor//lib/thor/shell/color.rb#20
3842
+ Thor::Shell::Color::RED = T.let(T.unsafe(nil), String)
3843
+
3844
+ # Set the terminal's foreground ANSI color to white.
3845
+ #
3846
+ # source://thor//lib/thor/shell/color.rb#32
3847
+ Thor::Shell::Color::WHITE = T.let(T.unsafe(nil), String)
3848
+
3849
+ # Set the terminal's foreground ANSI color to yellow.
3850
+ #
3851
+ # source://thor//lib/thor/shell/color.rb#24
3852
+ Thor::Shell::Color::YELLOW = T.let(T.unsafe(nil), String)
3853
+
3854
+ # source://thor//lib/thor/shell/column_printer.rb#5
3855
+ class Thor::Shell::ColumnPrinter
3856
+ # @return [ColumnPrinter] a new instance of ColumnPrinter
3857
+ #
3858
+ # source://thor//lib/thor/shell/column_printer.rb#8
3859
+ def initialize(stdout, options = T.unsafe(nil)); end
3860
+
3861
+ # Returns the value of attribute options.
3862
+ #
3863
+ # source://thor//lib/thor/shell/column_printer.rb#6
3864
+ def options; end
3865
+
3866
+ # source://thor//lib/thor/shell/column_printer.rb#14
3867
+ def print(array); end
3868
+
3869
+ # Returns the value of attribute stdout.
3870
+ #
3871
+ # source://thor//lib/thor/shell/column_printer.rb#6
3872
+ def stdout; end
3873
+ end
3874
+
3875
+ # Inherit from Thor::Shell::Basic and add set_color behavior. Check
3876
+ # Thor::Shell::Basic to see all available methods.
3877
+ #
3878
+ # source://thor//lib/thor/shell/html.rb#9
3879
+ class Thor::Shell::HTML < ::Thor::Shell::Basic
3880
+ include ::LCSDiff
3881
+
3882
+ # Ask something to the user and receives a response.
3883
+ #
3884
+ # ==== Example
3885
+ # ask("What is your name?")
3886
+ #
3887
+ # TODO: Implement #ask for Thor::Shell::HTML
3888
+ #
3889
+ # @raise [NotImplementedError]
3890
+ #
3891
+ # source://thor//lib/thor/shell/html.rb#73
3892
+ def ask(statement, color = T.unsafe(nil)); end
3893
+
3894
+ # Set color by using a string or one of the defined constants. If a third
3895
+ # option is set to true, it also adds bold to the string. This is based
3896
+ # on Highline implementation and it automatically appends CLEAR to the end
3897
+ # of the returned String.
3898
+ #
3899
+ # source://thor//lib/thor/shell/html.rb#54
3900
+ def set_color(string, *colors); end
3901
+
3902
+ protected
3903
+
3904
+ # @return [Boolean]
3905
+ #
3906
+ # source://thor//lib/thor/shell/html.rb#79
3907
+ def can_display_colors?; end
3908
+ end
3909
+
3910
+ # Set the terminal's foreground HTML color to black.
3911
+ #
3912
+ # source://thor//lib/thor/shell/html.rb#16
3913
+ Thor::Shell::HTML::BLACK = T.let(T.unsafe(nil), String)
3914
+
3915
+ # Set the terminal's foreground HTML color to blue.
3916
+ #
3917
+ # source://thor//lib/thor/shell/html.rb#24
3918
+ Thor::Shell::HTML::BLUE = T.let(T.unsafe(nil), String)
3919
+
3920
+ # The start of an HTML bold sequence.
3921
+ #
3922
+ # source://thor//lib/thor/shell/html.rb#13
3923
+ Thor::Shell::HTML::BOLD = T.let(T.unsafe(nil), String)
3924
+
3925
+ # Set the terminal's foreground HTML color to cyan.
3926
+ #
3927
+ # source://thor//lib/thor/shell/html.rb#28
3928
+ Thor::Shell::HTML::CYAN = T.let(T.unsafe(nil), String)
3929
+
3930
+ # Set the terminal's foreground HTML color to green.
3931
+ #
3932
+ # source://thor//lib/thor/shell/html.rb#20
3933
+ Thor::Shell::HTML::GREEN = T.let(T.unsafe(nil), String)
3934
+
3935
+ # Set the terminal's foreground HTML color to magenta.
3936
+ #
3937
+ # source://thor//lib/thor/shell/html.rb#26
3938
+ Thor::Shell::HTML::MAGENTA = T.let(T.unsafe(nil), String)
3939
+
3940
+ # Set the terminal's background HTML color to black.
3941
+ #
3942
+ # source://thor//lib/thor/shell/html.rb#33
3943
+ Thor::Shell::HTML::ON_BLACK = T.let(T.unsafe(nil), String)
3944
+
3945
+ # Set the terminal's background HTML color to blue.
3946
+ #
3947
+ # source://thor//lib/thor/shell/html.rb#41
3948
+ Thor::Shell::HTML::ON_BLUE = T.let(T.unsafe(nil), String)
3949
+
3950
+ # Set the terminal's background HTML color to cyan.
3951
+ #
3952
+ # source://thor//lib/thor/shell/html.rb#45
3953
+ Thor::Shell::HTML::ON_CYAN = T.let(T.unsafe(nil), String)
3954
+
3955
+ # Set the terminal's background HTML color to green.
3956
+ #
3957
+ # source://thor//lib/thor/shell/html.rb#37
3958
+ Thor::Shell::HTML::ON_GREEN = T.let(T.unsafe(nil), String)
3959
+
3960
+ # Set the terminal's background HTML color to magenta.
3961
+ #
3962
+ # source://thor//lib/thor/shell/html.rb#43
3963
+ Thor::Shell::HTML::ON_MAGENTA = T.let(T.unsafe(nil), String)
3964
+
3965
+ # Set the terminal's background HTML color to red.
3966
+ #
3967
+ # source://thor//lib/thor/shell/html.rb#35
3968
+ Thor::Shell::HTML::ON_RED = T.let(T.unsafe(nil), String)
3969
+
3970
+ # Set the terminal's background HTML color to white.
3971
+ #
3972
+ # source://thor//lib/thor/shell/html.rb#47
3973
+ Thor::Shell::HTML::ON_WHITE = T.let(T.unsafe(nil), String)
3974
+
3975
+ # Set the terminal's background HTML color to yellow.
3976
+ #
3977
+ # source://thor//lib/thor/shell/html.rb#39
3978
+ Thor::Shell::HTML::ON_YELLOW = T.let(T.unsafe(nil), String)
3979
+
3980
+ # Set the terminal's foreground HTML color to red.
3981
+ #
3982
+ # source://thor//lib/thor/shell/html.rb#18
3983
+ Thor::Shell::HTML::RED = T.let(T.unsafe(nil), String)
3984
+
3985
+ # Set the terminal's foreground HTML color to white.
3986
+ #
3987
+ # source://thor//lib/thor/shell/html.rb#30
3988
+ Thor::Shell::HTML::WHITE = T.let(T.unsafe(nil), String)
3989
+
3990
+ # Set the terminal's foreground HTML color to yellow.
3991
+ #
3992
+ # source://thor//lib/thor/shell/html.rb#22
3993
+ Thor::Shell::HTML::YELLOW = T.let(T.unsafe(nil), String)
3994
+
3995
+ # source://thor//lib/thor/shell.rb#24
3996
+ Thor::Shell::SHELL_DELEGATED_METHODS = T.let(T.unsafe(nil), Array)
3997
+
3998
+ # source://thor//lib/thor/shell/table_printer.rb#6
3999
+ class Thor::Shell::TablePrinter < ::Thor::Shell::ColumnPrinter
4000
+ # @return [TablePrinter] a new instance of TablePrinter
4001
+ #
4002
+ # source://thor//lib/thor/shell/table_printer.rb#9
4003
+ def initialize(stdout, options = T.unsafe(nil)); end
4004
+
4005
+ # source://thor//lib/thor/shell/table_printer.rb#18
4006
+ def print(array); end
4007
+
4008
+ private
4009
+
4010
+ # source://thor//lib/thor/shell/table_printer.rb#72
4011
+ def format_cell(column, row_size, index); end
4012
+
4013
+ # source://thor//lib/thor/shell/table_printer.rb#113
4014
+ def indentation; end
4015
+
4016
+ # source://thor//lib/thor/shell/table_printer.rb#47
4017
+ def prepare(array); end
4018
+
4019
+ # source://thor//lib/thor/shell/table_printer.rb#96
4020
+ def print_border_separator; end
4021
+
4022
+ # source://thor//lib/thor/shell/table_printer.rb#103
4023
+ def truncate(string); end
4024
+ end
4025
+
4026
+ # source://thor//lib/thor/shell/table_printer.rb#7
4027
+ Thor::Shell::TablePrinter::BORDER_SEPARATOR = T.let(T.unsafe(nil), Symbol)
4028
+
4029
+ # source://thor//lib/thor/shell/terminal.rb#3
4030
+ module Thor::Shell::Terminal
4031
+ class << self
4032
+ # source://thor//lib/thor/shell/terminal.rb#9
4033
+ def terminal_width; end
4034
+
4035
+ # @return [Boolean]
4036
+ #
4037
+ # source://thor//lib/thor/shell/terminal.rb#20
4038
+ def unix?; end
4039
+
4040
+ private
4041
+
4042
+ # Calculate the dynamic width of the terminal
4043
+ #
4044
+ # source://thor//lib/thor/shell/terminal.rb#27
4045
+ def dynamic_width; end
4046
+
4047
+ # source://thor//lib/thor/shell/terminal.rb#31
4048
+ def dynamic_width_stty; end
4049
+
4050
+ # source://thor//lib/thor/shell/terminal.rb#35
4051
+ def dynamic_width_tput; end
4052
+ end
4053
+ end
4054
+
4055
+ # source://thor//lib/thor/shell/terminal.rb#4
4056
+ Thor::Shell::Terminal::DEFAULT_TERMINAL_WIDTH = T.let(T.unsafe(nil), Integer)
4057
+
4058
+ # source://thor//lib/thor/shell/wrapped_printer.rb#6
4059
+ class Thor::Shell::WrappedPrinter < ::Thor::Shell::ColumnPrinter
4060
+ # source://thor//lib/thor/shell/wrapped_printer.rb#7
4061
+ def print(message); end
4062
+ end
4063
+
4064
+ # source://thor//lib/thor/base.rb#23
4065
+ Thor::TEMPLATE_EXTNAME = T.let(T.unsafe(nil), String)
4066
+
4067
+ # Thor methods that should not be overwritten by the user.
4068
+ #
4069
+ # source://thor//lib/thor/base.rb#20
4070
+ Thor::THOR_RESERVED_WORDS = T.let(T.unsafe(nil), Array)
4071
+
4072
+ # source://thor//lib/thor/command.rb#126
4073
+ Thor::Task = Thor::Command
4074
+
4075
+ # Raised when a command was not found.
4076
+ #
4077
+ # source://thor//lib/thor/error.rb#24
4078
+ class Thor::UndefinedCommandError < ::Thor::Error
4079
+ include ::Thor::Correctable
4080
+
4081
+ # @return [UndefinedCommandError] a new instance of UndefinedCommandError
4082
+ #
4083
+ # source://thor//lib/thor/error.rb#43
4084
+ def initialize(command, all_commands, namespace); end
4085
+
4086
+ # Returns the value of attribute all_commands.
4087
+ #
4088
+ # source://thor//lib/thor/error.rb#41
4089
+ def all_commands; end
4090
+
4091
+ # Returns the value of attribute command.
4092
+ #
4093
+ # source://thor//lib/thor/error.rb#41
4094
+ def command; end
4095
+ end
4096
+
4097
+ # source://thor//lib/thor/error.rb#25
4098
+ class Thor::UndefinedCommandError::SpellChecker
4099
+ # @return [SpellChecker] a new instance of SpellChecker
4100
+ #
4101
+ # source://thor//lib/thor/error.rb#28
4102
+ def initialize(error); end
4103
+
4104
+ # source://thor//lib/thor/error.rb#32
4105
+ def corrections; end
4106
+
4107
+ # Returns the value of attribute error.
4108
+ #
4109
+ # source://thor//lib/thor/error.rb#26
4110
+ def error; end
4111
+
4112
+ # source://thor//lib/thor/error.rb#36
4113
+ def spell_checker; end
4114
+ end
4115
+
4116
+ # source://thor//lib/thor/error.rb#55
4117
+ Thor::UndefinedTaskError = Thor::UndefinedCommandError
4118
+
4119
+ # source://thor//lib/thor/error.rb#65
4120
+ class Thor::UnknownArgumentError < ::Thor::Error
4121
+ include ::Thor::Correctable
4122
+
4123
+ # @return [UnknownArgumentError] a new instance of UnknownArgumentError
4124
+ #
4125
+ # source://thor//lib/thor/error.rb#85
4126
+ def initialize(switches, unknown); end
4127
+
4128
+ # Returns the value of attribute switches.
4129
+ #
4130
+ # source://thor//lib/thor/error.rb#83
4131
+ def switches; end
4132
+
4133
+ # Returns the value of attribute unknown.
4134
+ #
4135
+ # source://thor//lib/thor/error.rb#83
4136
+ def unknown; end
4137
+ end
4138
+
4139
+ # source://thor//lib/thor/error.rb#66
4140
+ class Thor::UnknownArgumentError::SpellChecker
4141
+ # @return [SpellChecker] a new instance of SpellChecker
4142
+ #
4143
+ # source://thor//lib/thor/error.rb#69
4144
+ def initialize(error); end
4145
+
4146
+ # source://thor//lib/thor/error.rb#73
4147
+ def corrections; end
4148
+
4149
+ # Returns the value of attribute error.
4150
+ #
4151
+ # source://thor//lib/thor/error.rb#67
4152
+ def error; end
4153
+
4154
+ # source://thor//lib/thor/error.rb#78
4155
+ def spell_checker; end
4156
+ end
4157
+
4158
+ # This module holds several utilities:
4159
+ #
4160
+ # 1) Methods to convert thor namespaces to constants and vice-versa.
4161
+ #
4162
+ # Thor::Util.namespace_from_thor_class(Foo::Bar::Baz) #=> "foo:bar:baz"
4163
+ #
4164
+ # 2) Loading thor files and sandboxing:
4165
+ #
4166
+ # Thor::Util.load_thorfile("~/.thor/foo")
4167
+ #
4168
+ # source://thor//lib/thor/util.rb#17
4169
+ module Thor::Util
4170
+ class << self
4171
+ # Receives a string and convert it to camel case. camel_case returns CamelCase.
4172
+ #
4173
+ # ==== Parameters
4174
+ # String
4175
+ #
4176
+ # ==== Returns
4177
+ # String
4178
+ #
4179
+ # source://thor//lib/thor/util.rb#104
4180
+ def camel_case(str); end
4181
+
4182
+ # Returns a string that has had any glob characters escaped.
4183
+ # The glob characters are `* ? { } [ ]`.
4184
+ #
4185
+ # ==== Examples
4186
+ #
4187
+ # Thor::Util.escape_globs('[apps]') # => '\[apps\]'
4188
+ #
4189
+ # ==== Parameters
4190
+ # String
4191
+ #
4192
+ # ==== Returns
4193
+ # String
4194
+ #
4195
+ # source://thor//lib/thor/util.rb#264
4196
+ def escape_globs(path); end
4197
+
4198
+ # Returns a string that has had any HTML characters escaped.
4199
+ #
4200
+ # ==== Examples
4201
+ #
4202
+ # Thor::Util.escape_html('<div>') # => "&lt;div&gt;"
4203
+ #
4204
+ # ==== Parameters
4205
+ # String
4206
+ #
4207
+ # ==== Returns
4208
+ # String
4209
+ #
4210
+ # source://thor//lib/thor/util.rb#280
4211
+ def escape_html(string); end
4212
+
4213
+ # Receives a namespace and search for it in the Thor::Base subclasses.
4214
+ #
4215
+ # ==== Parameters
4216
+ # namespace<String>:: The namespace to search for.
4217
+ #
4218
+ # source://thor//lib/thor/util.rb#24
4219
+ def find_by_namespace(namespace); end
4220
+
4221
+ # Receives a namespace and tries to retrieve a Thor or Thor::Group class
4222
+ # from it. It first searches for a class using the all the given namespace,
4223
+ # if it's not found, removes the highest entry and searches for the class
4224
+ # again. If found, returns the highest entry as the class name.
4225
+ #
4226
+ # ==== Examples
4227
+ #
4228
+ # class Foo::Bar < Thor
4229
+ # def baz
4230
+ # end
4231
+ # end
4232
+ #
4233
+ # class Baz::Foo < Thor::Group
4234
+ # end
4235
+ #
4236
+ # Thor::Util.namespace_to_thor_class("foo:bar") #=> Foo::Bar, nil # will invoke default command
4237
+ # Thor::Util.namespace_to_thor_class("baz:foo") #=> Baz::Foo, nil
4238
+ # Thor::Util.namespace_to_thor_class("foo:bar:baz") #=> Foo::Bar, "baz"
4239
+ #
4240
+ # ==== Parameters
4241
+ # namespace<String>
4242
+ #
4243
+ # source://thor//lib/thor/util.rb#131
4244
+ def find_class_and_command_by_namespace(namespace, fallback = T.unsafe(nil)); end
4245
+
4246
+ # Receives a namespace and tries to retrieve a Thor or Thor::Group class
4247
+ # from it. It first searches for a class using the all the given namespace,
4248
+ # if it's not found, removes the highest entry and searches for the class
4249
+ # again. If found, returns the highest entry as the class name.
4250
+ #
4251
+ # ==== Examples
4252
+ #
4253
+ # class Foo::Bar < Thor
4254
+ # def baz
4255
+ # end
4256
+ # end
4257
+ #
4258
+ # class Baz::Foo < Thor::Group
4259
+ # end
4260
+ #
4261
+ # Thor::Util.namespace_to_thor_class("foo:bar") #=> Foo::Bar, nil # will invoke default command
4262
+ # Thor::Util.namespace_to_thor_class("baz:foo") #=> Baz::Foo, nil
4263
+ # Thor::Util.namespace_to_thor_class("foo:bar:baz") #=> Foo::Bar, "baz"
4264
+ #
4265
+ # ==== Parameters
4266
+ # namespace<String>
4267
+ #
4268
+ # source://thor//lib/thor/util.rb#131
4269
+ def find_class_and_task_by_namespace(namespace, fallback = T.unsafe(nil)); end
4270
+
4271
+ # Where to look for Thor files.
4272
+ #
4273
+ # source://thor//lib/thor/util.rb#213
4274
+ def globs_for(path); end
4275
+
4276
+ # Receives a path and load the thor file in the path. The file is evaluated
4277
+ # inside the sandbox to avoid namespacing conflicts.
4278
+ #
4279
+ # source://thor//lib/thor/util.rb#153
4280
+ def load_thorfile(path, content = T.unsafe(nil), debug = T.unsafe(nil)); end
4281
+
4282
+ # Receives a constant and converts it to a Thor namespace. Since Thor
4283
+ # commands can be added to a sandbox, this method is also responsible for
4284
+ # removing the sandbox namespace.
4285
+ #
4286
+ # This method should not be used in general because it's used to deal with
4287
+ # older versions of Thor. On current versions, if you need to get the
4288
+ # namespace from a class, just call namespace on it.
4289
+ #
4290
+ # ==== Parameters
4291
+ # constant<Object>:: The constant to be converted to the thor path.
4292
+ #
4293
+ # ==== Returns
4294
+ # String:: If we receive Foo::Bar::Baz it returns "foo:bar:baz"
4295
+ #
4296
+ # source://thor//lib/thor/util.rb#43
4297
+ def namespace_from_thor_class(constant); end
4298
+
4299
+ # Given the contents, evaluate it inside the sandbox and returns the
4300
+ # namespaces defined in the sandbox.
4301
+ #
4302
+ # ==== Parameters
4303
+ # contents<String>
4304
+ #
4305
+ # ==== Returns
4306
+ # Array[Object]
4307
+ #
4308
+ # source://thor//lib/thor/util.rb#58
4309
+ def namespaces_in_content(contents, file = T.unsafe(nil)); end
4310
+
4311
+ # Return the path to the ruby interpreter taking into account multiple
4312
+ # installations and windows extensions.
4313
+ #
4314
+ # source://thor//lib/thor/util.rb#221
4315
+ def ruby_command; end
4316
+
4317
+ # Receives a string and convert it to snake case. SnakeCase returns snake_case.
4318
+ #
4319
+ # ==== Parameters
4320
+ # String
4321
+ #
4322
+ # ==== Returns
4323
+ # String
4324
+ #
4325
+ # source://thor//lib/thor/util.rb#90
4326
+ def snake_case(str); end
4327
+
4328
+ # Returns the thor classes declared inside the given class.
4329
+ #
4330
+ # source://thor//lib/thor/util.rb#74
4331
+ def thor_classes_in(klass); end
4332
+
4333
+ # Returns the root where thor files are located, depending on the OS.
4334
+ #
4335
+ # source://thor//lib/thor/util.rb#192
4336
+ def thor_root; end
4337
+
4338
+ # Returns the files in the thor root. On Windows thor_root will be something
4339
+ # like this:
4340
+ #
4341
+ # C:\Documents and Settings\james\.thor
4342
+ #
4343
+ # If we don't #gsub the \ character, Dir.glob will fail.
4344
+ #
4345
+ # source://thor//lib/thor/util.rb#203
4346
+ def thor_root_glob; end
4347
+
4348
+ # source://thor//lib/thor/util.rb#168
4349
+ def user_home; end
4350
+ end
4351
+ end