optimistic-json 0.1.2 → 0.1.3

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