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