type_toolkit 0.0.2 → 0.0.3

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