stripe 10.13.0.pre.beta.1 → 10.13.0

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