shopify-ruby-definitions 0.0.1 → 1.0.0

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