twirbet 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (124) hide show
  1. checksums.yaml +4 -4
  2. data/lib/twirbet/version.rb +1 -1
  3. metadata +1 -122
  4. data/.rspec +0 -3
  5. data/.rubocop.yml +0 -20
  6. data/CHANGELOG.md +0 -5
  7. data/Gemfile +0 -28
  8. data/Gemfile.lock +0 -127
  9. data/Rakefile +0 -17
  10. data/examples/clientcompat/client +0 -28
  11. data/examples/clientcompat/clientcompat.proto +0 -29
  12. data/examples/clientcompat/clientcompat_pb.rb +0 -36
  13. data/examples/clientcompat/clientcompat_twirbet.rb +0 -57
  14. data/examples/ping/Gemfile +0 -11
  15. data/examples/ping/Gemfile.lock +0 -69
  16. data/examples/ping/bin/puma +0 -27
  17. data/examples/ping/bin/pumactl +0 -27
  18. data/examples/ping/bin/srb +0 -27
  19. data/examples/ping/bin/srb-rbi +0 -27
  20. data/examples/ping/bin/tapioca +0 -27
  21. data/examples/ping/client.rb +0 -14
  22. data/examples/ping/config/application.rb +0 -13
  23. data/examples/ping/config/environment.rb +0 -6
  24. data/examples/ping/config.ru +0 -8
  25. data/examples/ping/proto/ping.proto +0 -15
  26. data/examples/ping/proto/ping_pb.rb +0 -20
  27. data/examples/ping/proto/ping_twirbet.rb +0 -47
  28. data/examples/ping/sorbet/config +0 -4
  29. data/examples/ping/sorbet/rbi/dsl/google/protobuf/descriptor_proto/extension_range.rbi +0 -34
  30. data/examples/ping/sorbet/rbi/dsl/google/protobuf/descriptor_proto/reserved_range.rbi +0 -22
  31. data/examples/ping/sorbet/rbi/dsl/google/protobuf/descriptor_proto.rbi +0 -83
  32. data/examples/ping/sorbet/rbi/dsl/google/protobuf/enum_descriptor_proto/enum_reserved_range.rbi +0 -22
  33. data/examples/ping/sorbet/rbi/dsl/google/protobuf/enum_descriptor_proto.rbi +0 -48
  34. data/examples/ping/sorbet/rbi/dsl/google/protobuf/enum_options.rbi +0 -34
  35. data/examples/ping/sorbet/rbi/dsl/google/protobuf/enum_value_descriptor_proto.rbi +0 -34
  36. data/examples/ping/sorbet/rbi/dsl/google/protobuf/enum_value_options.rbi +0 -27
  37. data/examples/ping/sorbet/rbi/dsl/google/protobuf/extension_range_options.rbi +0 -20
  38. data/examples/ping/sorbet/rbi/dsl/google/protobuf/field_descriptor_proto/label.rbi +0 -22
  39. data/examples/ping/sorbet/rbi/dsl/google/protobuf/field_descriptor_proto/type.rbi +0 -37
  40. data/examples/ping/sorbet/rbi/dsl/google/protobuf/field_descriptor_proto.rbi +0 -90
  41. data/examples/ping/sorbet/rbi/dsl/google/protobuf/field_options/c_type.rbi +0 -22
  42. data/examples/ping/sorbet/rbi/dsl/google/protobuf/field_options/js_type.rbi +0 -22
  43. data/examples/ping/sorbet/rbi/dsl/google/protobuf/field_options.rbi +0 -69
  44. data/examples/ping/sorbet/rbi/dsl/google/protobuf/file_descriptor_proto.rbi +0 -97
  45. data/examples/ping/sorbet/rbi/dsl/google/protobuf/file_descriptor_set.rbi +0 -20
  46. data/examples/ping/sorbet/rbi/dsl/google/protobuf/file_options/optimize_mode.rbi +0 -22
  47. data/examples/ping/sorbet/rbi/dsl/google/protobuf/file_options.rbi +0 -160
  48. data/examples/ping/sorbet/rbi/dsl/google/protobuf/generated_code_info/annotation.rbi +0 -41
  49. data/examples/ping/sorbet/rbi/dsl/google/protobuf/generated_code_info.rbi +0 -20
  50. data/examples/ping/sorbet/rbi/dsl/google/protobuf/map.rbi +0 -12
  51. data/examples/ping/sorbet/rbi/dsl/google/protobuf/message_options.rbi +0 -48
  52. data/examples/ping/sorbet/rbi/dsl/google/protobuf/method_descriptor_proto.rbi +0 -55
  53. data/examples/ping/sorbet/rbi/dsl/google/protobuf/method_options/idempotency_level.rbi +0 -22
  54. data/examples/ping/sorbet/rbi/dsl/google/protobuf/method_options.rbi +0 -34
  55. data/examples/ping/sorbet/rbi/dsl/google/protobuf/oneof_descriptor_proto.rbi +0 -22
  56. data/examples/ping/sorbet/rbi/dsl/google/protobuf/oneof_options.rbi +0 -20
  57. data/examples/ping/sorbet/rbi/dsl/google/protobuf/repeated_field.rbi +0 -11
  58. data/examples/ping/sorbet/rbi/dsl/google/protobuf/service_descriptor_proto.rbi +0 -34
  59. data/examples/ping/sorbet/rbi/dsl/google/protobuf/service_options.rbi +0 -27
  60. data/examples/ping/sorbet/rbi/dsl/google/protobuf/source_code_info/location.rbi +0 -48
  61. data/examples/ping/sorbet/rbi/dsl/google/protobuf/source_code_info.rbi +0 -20
  62. data/examples/ping/sorbet/rbi/dsl/google/protobuf/uninterpreted_option/name_part.rbi +0 -22
  63. data/examples/ping/sorbet/rbi/dsl/google/protobuf/uninterpreted_option.rbi +0 -62
  64. data/examples/ping/sorbet/rbi/dsl/ping/ping_request.rbi +0 -16
  65. data/examples/ping/sorbet/rbi/dsl/ping/ping_response.rbi +0 -16
  66. data/examples/ping/sorbet/rbi/gems/ast@2.4.2.rbi +0 -584
  67. data/examples/ping/sorbet/rbi/gems/diff-lcs@1.5.0.rbi +0 -8
  68. data/examples/ping/sorbet/rbi/gems/google-protobuf@3.21.12.rbi +0 -1645
  69. data/examples/ping/sorbet/rbi/gems/netrc@0.11.0.rbi +0 -158
  70. data/examples/ping/sorbet/rbi/gems/nio4r@2.5.8.rbi +0 -8
  71. data/examples/ping/sorbet/rbi/gems/parallel@1.22.1.rbi +0 -277
  72. data/examples/ping/sorbet/rbi/gems/parser@3.1.3.0.rbi +0 -5076
  73. data/examples/ping/sorbet/rbi/gems/puma@6.0.0.rbi +0 -4177
  74. data/examples/ping/sorbet/rbi/gems/rack@3.0.2.rbi +0 -5016
  75. data/examples/ping/sorbet/rbi/gems/rbi@0.0.16.rbi +0 -3008
  76. data/examples/ping/sorbet/rbi/gems/spoom@1.1.15.rbi +0 -2383
  77. data/examples/ping/sorbet/rbi/gems/tapioca@0.10.3.rbi +0 -3032
  78. data/examples/ping/sorbet/rbi/gems/thor@1.2.1.rbi +0 -3919
  79. data/examples/ping/sorbet/rbi/gems/twirbet@0.1.0.rbi +0 -528
  80. data/examples/ping/sorbet/rbi/gems/unparser@0.6.5.rbi +0 -8
  81. data/examples/ping/sorbet/rbi/gems/webrick@1.7.0.rbi +0 -2498
  82. data/examples/ping/sorbet/rbi/gems/yard-sorbet@0.7.0.rbi +0 -391
  83. data/examples/ping/sorbet/rbi/gems/yard@0.9.28.rbi +0 -17022
  84. data/examples/ping/sorbet/tapioca/config.yml +0 -13
  85. data/examples/ping/sorbet/tapioca/require.rb +0 -5
  86. data/sorbet/config +0 -5
  87. data/sorbet/rbi/annotations/rainbow.rbi +0 -269
  88. data/sorbet/rbi/custom/ping.rbi +0 -23
  89. data/sorbet/rbi/gems/ast@2.4.2.rbi +0 -584
  90. data/sorbet/rbi/gems/diff-lcs@1.5.0.rbi +0 -1064
  91. data/sorbet/rbi/gems/google-protobuf@3.21.12.rbi +0 -1645
  92. data/sorbet/rbi/gems/json@2.6.3.rbi +0 -1541
  93. data/sorbet/rbi/gems/netrc@0.11.0.rbi +0 -158
  94. data/sorbet/rbi/gems/parallel@1.22.1.rbi +0 -277
  95. data/sorbet/rbi/gems/parser@3.1.3.0.rbi +0 -6878
  96. data/sorbet/rbi/gems/rack@3.0.2.rbi +0 -5163
  97. data/sorbet/rbi/gems/rainbow@3.1.1.rbi +0 -397
  98. data/sorbet/rbi/gems/rake@13.0.6.rbi +0 -2946
  99. data/sorbet/rbi/gems/rbi@0.0.16.rbi +0 -3008
  100. data/sorbet/rbi/gems/regexp_parser@2.6.1.rbi +0 -3126
  101. data/sorbet/rbi/gems/rexml@3.2.5.rbi +0 -4660
  102. data/sorbet/rbi/gems/rspec-core@3.12.0.rbi +0 -10492
  103. data/sorbet/rbi/gems/rspec-expectations@3.12.1.rbi +0 -7817
  104. data/sorbet/rbi/gems/rspec-mocks@3.12.1.rbi +0 -4994
  105. data/sorbet/rbi/gems/rspec-support@3.12.0.rbi +0 -1477
  106. data/sorbet/rbi/gems/rspec@3.12.0.rbi +0 -10
  107. data/sorbet/rbi/gems/rubocop-ast@1.24.0.rbi +0 -6790
  108. data/sorbet/rbi/gems/rubocop-rake@0.6.0.rbi +0 -354
  109. data/sorbet/rbi/gems/rubocop-rspec@2.16.0.rbi +0 -7650
  110. data/sorbet/rbi/gems/rubocop-shopify@2.10.1.rbi +0 -8
  111. data/sorbet/rbi/gems/rubocop-sorbet@0.6.11.rbi +0 -1014
  112. data/sorbet/rbi/gems/rubocop@1.40.0.rbi +0 -51560
  113. data/sorbet/rbi/gems/ruby-progressbar@1.11.0.rbi +0 -1212
  114. data/sorbet/rbi/gems/spoom@1.1.15.rbi +0 -2383
  115. data/sorbet/rbi/gems/tapioca@0.10.3.rbi +0 -3032
  116. data/sorbet/rbi/gems/thor@1.2.1.rbi +0 -3950
  117. data/sorbet/rbi/gems/unicode-display_width@2.3.0.rbi +0 -46
  118. data/sorbet/rbi/gems/unparser@0.6.5.rbi +0 -4265
  119. data/sorbet/rbi/gems/webrick@1.7.0.rbi +0 -2498
  120. data/sorbet/rbi/gems/yard-sorbet@0.7.0.rbi +0 -391
  121. data/sorbet/rbi/gems/yard@0.9.28.rbi +0 -17033
  122. data/sorbet/tapioca/config.yml +0 -13
  123. data/sorbet/tapioca/require.rb +0 -4
  124. data/twirbet.gemspec +0 -36
@@ -1,3919 +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 regardles 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#248
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#285
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#308
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#329
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#325
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#60
1301
- class Thor::AmbiguousCommandError < ::Thor::Error; end
1302
-
1303
- # source://thor//lib/thor/error.rb#62
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#679
1986
- def baseclass; end
1987
-
1988
- # The basename of the program invoking the thor class.
1989
- #
1990
- # source://thor//lib/thor/base.rb#673
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#590
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#601
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#684
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#684
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#694
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#610
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#610
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#651
2057
- def from_superclass(method, default = T.unsafe(nil)); end
2058
-
2059
- # Everytime someone inherits from a Thor class, register the klass
2060
- # and file into baseclass.
2061
- #
2062
- # source://thor//lib/thor/base.rb#623
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#690
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#579
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#631
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#2
2245
- Thor::Correctable = DidYouMean::Correctable
2246
-
2247
- # A dynamic command that handles method missing scenarios.
2248
- #
2249
- # source://thor//lib/thor/command.rb#128
2250
- class Thor::DynamicCommand < ::Thor::Command
2251
- # @return [DynamicCommand] a new instance of DynamicCommand
2252
- #
2253
- # source://thor//lib/thor/command.rb#129
2254
- def initialize(name, options = T.unsafe(nil)); end
2255
-
2256
- # source://thor//lib/thor/command.rb#133
2257
- def run(instance, args = T.unsafe(nil)); end
2258
- end
2259
-
2260
- # source://thor//lib/thor/command.rb#141
2261
- Thor::DynamicTask = Thor::DynamicCommand
2262
-
2263
- # Thor::Error is raised when it's caused by wrong usage of thor classes. Those
2264
- # errors have their backtrace suppressed and are nicely shown to the user.
2265
- #
2266
- # Errors that are caused by the developer, like declaring a method which
2267
- # overwrites a thor keyword, SHOULD NOT raise a Thor::Error. This way, we
2268
- # ensure that developer errors are shown with full backtrace.
2269
- #
2270
- # source://thor//lib/thor/error.rb#23
2271
- class Thor::Error < ::StandardError; end
2272
-
2273
- # Thor has a special class called Thor::Group. The main difference to Thor class
2274
- # is that it invokes all commands at once. It also include some methods that allows
2275
- # invocations to be done at the class method, which are not available to Thor
2276
- # commands.
2277
- class Thor::Group
2278
- include ::Thor::Base
2279
- include ::Thor::Invocation
2280
- include ::Thor::Shell
2281
- extend ::Thor::Base::ClassMethods
2282
- extend ::Thor::Invocation::ClassMethods
2283
-
2284
- protected
2285
-
2286
- # Shortcut to invoke with padding and block handling. Use internally by
2287
- # invoke and invoke_from_option class methods.
2288
- #
2289
- # source://thor//lib/thor/group.rb#265
2290
- def _invoke_for_class_method(klass, command = T.unsafe(nil), *args, &block); end
2291
-
2292
- class << self
2293
- # Overwrite class options help to allow invoked generators options to be
2294
- # shown recursively when invoking a generator.
2295
- #
2296
- # source://thor//lib/thor/group.rb#161
2297
- def class_options_help(shell, groups = T.unsafe(nil)); end
2298
-
2299
- # The description for this Thor::Group. If none is provided, but a source root
2300
- # exists, tries to find the USAGE one folder above it, otherwise searches
2301
- # in the superclass.
2302
- #
2303
- # ==== Parameters
2304
- # description<String>:: The description for this Thor::Group.
2305
- #
2306
- # source://thor//lib/thor/group.rb#16
2307
- def desc(description = T.unsafe(nil)); end
2308
-
2309
- # Get invocations array and merge options from invocations. Those
2310
- # options are added to group_options hash. Options that already exists
2311
- # in base_options are not added twice.
2312
- #
2313
- # source://thor//lib/thor/group.rb#172
2314
- def get_options_from_invocations(group_options, base_options); end
2315
-
2316
- # @raise [error]
2317
- #
2318
- # source://thor//lib/thor/group.rb#207
2319
- def handle_argument_error(command, error, _args, arity); end
2320
-
2321
- # Prints help information.
2322
- #
2323
- # ==== Options
2324
- # short:: When true, shows only usage.
2325
- #
2326
- # source://thor//lib/thor/group.rb#29
2327
- def help(shell); end
2328
-
2329
- # Stores invocation blocks used on invoke_from_option.
2330
- #
2331
- # source://thor//lib/thor/group.rb#45
2332
- def invocation_blocks; end
2333
-
2334
- # Stores invocations for this class merging with superclass values.
2335
- #
2336
- # source://thor//lib/thor/group.rb#39
2337
- def invocations; end
2338
-
2339
- # Invoke the given namespace or class given. It adds an instance
2340
- # method that will invoke the klass and command. You can give a block to
2341
- # configure how it will be invoked.
2342
- #
2343
- # The namespace/class given will have its options showed on the help
2344
- # usage. Check invoke_from_option for more information.
2345
- #
2346
- # source://thor//lib/thor/group.rb#56
2347
- def invoke(*names, &block); end
2348
-
2349
- # Invoke a thor class based on the value supplied by the user to the
2350
- # given option named "name". A class option must be created before this
2351
- # method is invoked for each name given.
2352
- #
2353
- # ==== Examples
2354
- #
2355
- # class GemGenerator < Thor::Group
2356
- # class_option :test_framework, :type => :string
2357
- # invoke_from_option :test_framework
2358
- # end
2359
- #
2360
- # ==== Boolean options
2361
- #
2362
- # In some cases, you want to invoke a thor class if some option is true or
2363
- # false. This is automatically handled by invoke_from_option. Then the
2364
- # option name is used to invoke the generator.
2365
- #
2366
- # ==== Preparing for invocation
2367
- #
2368
- # In some cases you want to customize how a specified hook is going to be
2369
- # invoked. You can do that by overwriting the class method
2370
- # prepare_for_invocation. The class method must necessarily return a klass
2371
- # and an optional command.
2372
- #
2373
- # ==== Custom invocations
2374
- #
2375
- # You can also supply a block to customize how the option is going to be
2376
- # invoked. The block receives two parameters, an instance of the current
2377
- # class and the klass to be invoked.
2378
- #
2379
- # source://thor//lib/thor/group.rb#110
2380
- def invoke_from_option(*names, &block); end
2381
-
2382
- # Returns commands ready to be printed.
2383
- #
2384
- # source://thor//lib/thor/group.rb#199
2385
- def printable_commands(*_arg0); end
2386
-
2387
- # Returns commands ready to be printed.
2388
- #
2389
- # source://thor//lib/thor/group.rb#199
2390
- def printable_tasks(*_arg0); end
2391
-
2392
- # Remove a previously added invocation.
2393
- #
2394
- # ==== Examples
2395
- #
2396
- # remove_invocation :test_framework
2397
- #
2398
- # source://thor//lib/thor/group.rb#149
2399
- def remove_invocation(*names); end
2400
-
2401
- protected
2402
-
2403
- # The banner for this class. You can customize it if you are invoking the
2404
- # thor class by another ways which is not the Thor::Runner.
2405
- #
2406
- # source://thor//lib/thor/group.rb#238
2407
- def banner; end
2408
-
2409
- # source://thor//lib/thor/group.rb#248
2410
- def baseclass; end
2411
-
2412
- # source://thor//lib/thor/group.rb#252
2413
- def create_command(meth); end
2414
-
2415
- # source://thor//lib/thor/group.rb#252
2416
- def create_task(meth); end
2417
-
2418
- # The method responsible for dispatching given the args.
2419
- #
2420
- # @yield [instance]
2421
- #
2422
- # source://thor//lib/thor/group.rb#217
2423
- def dispatch(command, given_args, given_opts, config); end
2424
-
2425
- # Represents the whole class as a command.
2426
- #
2427
- # source://thor//lib/thor/group.rb#243
2428
- def self_command; end
2429
-
2430
- # Represents the whole class as a command.
2431
- #
2432
- # source://thor//lib/thor/group.rb#243
2433
- def self_task; end
2434
- end
2435
- end
2436
-
2437
- # Shortcuts for help.
2438
- #
2439
- # source://thor//lib/thor/base.rb#17
2440
- Thor::HELP_MAPPINGS = T.let(T.unsafe(nil), Array)
2441
-
2442
- # A command that is hidden in help messages but still invocable.
2443
- #
2444
- # source://thor//lib/thor/command.rb#120
2445
- class Thor::HiddenCommand < ::Thor::Command
2446
- # @return [Boolean]
2447
- #
2448
- # source://thor//lib/thor/command.rb#121
2449
- def hidden?; end
2450
- end
2451
-
2452
- # source://thor//lib/thor/command.rb#125
2453
- Thor::HiddenTask = Thor::HiddenCommand
2454
-
2455
- # source://thor//lib/thor/invocation.rb#2
2456
- module Thor::Invocation
2457
- mixes_in_class_methods ::Thor::Invocation::ClassMethods
2458
-
2459
- # Make initializer aware of invocations and the initialization args.
2460
- #
2461
- # source://thor//lib/thor/invocation.rb#23
2462
- def initialize(args = T.unsafe(nil), options = T.unsafe(nil), config = T.unsafe(nil), &block); end
2463
-
2464
- # Make the current command chain accessible with in a Thor-(sub)command
2465
- #
2466
- # source://thor//lib/thor/invocation.rb#30
2467
- def current_command_chain; end
2468
-
2469
- # Receives a name and invokes it. The name can be a string (either "command" or
2470
- # "namespace:command"), a Thor::Command, a Class or a Thor instance. If the
2471
- # command cannot be guessed by name, it can also be supplied as second argument.
2472
- #
2473
- # You can also supply the arguments, options and configuration values for
2474
- # the command to be invoked, if none is given, the same values used to
2475
- # initialize the invoker are used to initialize the invoked.
2476
- #
2477
- # When no name is given, it will invoke the default command of the current class.
2478
- #
2479
- # ==== Examples
2480
- #
2481
- # class A < Thor
2482
- # def foo
2483
- # invoke :bar
2484
- # invoke "b:hello", ["Erik"]
2485
- # end
2486
- #
2487
- # def bar
2488
- # invoke "b:hello", ["Erik"]
2489
- # end
2490
- # end
2491
- #
2492
- # class B < Thor
2493
- # def hello(name)
2494
- # puts "hello #{name}"
2495
- # end
2496
- # end
2497
- #
2498
- # You can notice that the method "foo" above invokes two commands: "bar",
2499
- # which belongs to the same class and "hello" which belongs to the class B.
2500
- #
2501
- # By using an invocation system you ensure that a command is invoked only once.
2502
- # In the example above, invoking "foo" will invoke "b:hello" just once, even
2503
- # if it's invoked later by "bar" method.
2504
- #
2505
- # When class A invokes class B, all arguments used on A initialization are
2506
- # supplied to B. This allows lazy parse of options. Let's suppose you have
2507
- # some rspec commands:
2508
- #
2509
- # class Rspec < Thor::Group
2510
- # class_option :mock_framework, :type => :string, :default => :rr
2511
- #
2512
- # def invoke_mock_framework
2513
- # invoke "rspec:#{options[:mock_framework]}"
2514
- # end
2515
- # end
2516
- #
2517
- # As you noticed, it invokes the given mock framework, which might have its
2518
- # own options:
2519
- #
2520
- # class Rspec::RR < Thor::Group
2521
- # class_option :style, :type => :string, :default => :mock
2522
- # end
2523
- #
2524
- # Since it's not rspec concern to parse mock framework options, when RR
2525
- # is invoked all options are parsed again, so RR can extract only the options
2526
- # that it's going to use.
2527
- #
2528
- # If you want Rspec::RR to be initialized with its own set of options, you
2529
- # have to do that explicitly:
2530
- #
2531
- # invoke "rspec:rr", [], :style => :foo
2532
- #
2533
- # Besides giving an instance, you can also give a class to invoke:
2534
- #
2535
- # invoke Rspec::RR, [], :style => :foo
2536
- #
2537
- # source://thor//lib/thor/invocation.rb#102
2538
- def invoke(name = T.unsafe(nil), *args); end
2539
-
2540
- # Invoke all commands for the current instance.
2541
- #
2542
- # source://thor//lib/thor/invocation.rb#133
2543
- def invoke_all; end
2544
-
2545
- # Invoke the given command if the given args.
2546
- #
2547
- # source://thor//lib/thor/invocation.rb#122
2548
- def invoke_command(command, *args); end
2549
-
2550
- # Invoke the given command if the given args.
2551
- #
2552
- # source://thor//lib/thor/invocation.rb#122
2553
- def invoke_task(command, *args); end
2554
-
2555
- # Invokes using shell padding.
2556
- #
2557
- # source://thor//lib/thor/invocation.rb#138
2558
- def invoke_with_padding(*args); end
2559
-
2560
- protected
2561
-
2562
- # Initialize klass using values stored in the @_initializer.
2563
- #
2564
- # source://thor//lib/thor/invocation.rb#166
2565
- def _parse_initialization_options(args, opts, config); end
2566
-
2567
- # This method simply retrieves the class and command to be invoked.
2568
- # If the name is nil or the given name is a command in the current class,
2569
- # use the given name and return self as class. Otherwise, call
2570
- # prepare_for_invocation in the current class.
2571
- #
2572
- # source://thor//lib/thor/invocation.rb#153
2573
- def _retrieve_class_and_command(name, sent_command = T.unsafe(nil)); 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_task(name, sent_command = T.unsafe(nil)); end
2582
-
2583
- # Configuration values that are shared between invocations.
2584
- #
2585
- # source://thor//lib/thor/invocation.rb#145
2586
- def _shared_configuration; end
2587
-
2588
- class << self
2589
- # source://thor//lib/thor/invocation.rb#3
2590
- def included(base); end
2591
- end
2592
- end
2593
-
2594
- # source://thor//lib/thor/invocation.rb#8
2595
- module Thor::Invocation::ClassMethods
2596
- # This method is responsible for receiving a name and find the proper
2597
- # class and command for it. The key is an optional parameter which is
2598
- # available only in class methods invocations (i.e. in Thor::Group).
2599
- #
2600
- # source://thor//lib/thor/invocation.rb#12
2601
- def prepare_for_invocation(key, name); end
2602
- end
2603
-
2604
- # Raised when a command was found, but not invoked properly.
2605
- #
2606
- # source://thor//lib/thor/error.rb#65
2607
- class Thor::InvocationError < ::Thor::Error; end
2608
-
2609
- # source://thor//lib/thor/line_editor/basic.rb#2
2610
- module Thor::LineEditor
2611
- class << self
2612
- # source://thor//lib/thor/line_editor.rb#10
2613
- def best_available; end
2614
-
2615
- # source://thor//lib/thor/line_editor.rb#6
2616
- def readline(prompt, options = T.unsafe(nil)); end
2617
- end
2618
- end
2619
-
2620
- # source://thor//lib/thor/line_editor/basic.rb#3
2621
- class Thor::LineEditor::Basic
2622
- # @return [Basic] a new instance of Basic
2623
- #
2624
- # source://thor//lib/thor/line_editor/basic.rb#10
2625
- def initialize(prompt, options); end
2626
-
2627
- # Returns the value of attribute options.
2628
- #
2629
- # source://thor//lib/thor/line_editor/basic.rb#4
2630
- def options; end
2631
-
2632
- # Returns the value of attribute prompt.
2633
- #
2634
- # source://thor//lib/thor/line_editor/basic.rb#4
2635
- def prompt; end
2636
-
2637
- # source://thor//lib/thor/line_editor/basic.rb#15
2638
- def readline; end
2639
-
2640
- private
2641
-
2642
- # @return [Boolean]
2643
- #
2644
- # source://thor//lib/thor/line_editor/basic.rb#32
2645
- def echo?; end
2646
-
2647
- # source://thor//lib/thor/line_editor/basic.rb#22
2648
- def get_input; end
2649
-
2650
- class << self
2651
- # @return [Boolean]
2652
- #
2653
- # source://thor//lib/thor/line_editor/basic.rb#6
2654
- def available?; end
2655
- end
2656
- end
2657
-
2658
- # source://thor//lib/thor/line_editor/readline.rb#3
2659
- class Thor::LineEditor::Readline < ::Thor::LineEditor::Basic
2660
- # source://thor//lib/thor/line_editor/readline.rb#13
2661
- def readline; end
2662
-
2663
- private
2664
-
2665
- # @return [Boolean]
2666
- #
2667
- # source://thor//lib/thor/line_editor/readline.rb#28
2668
- def add_to_history?; end
2669
-
2670
- # source://thor//lib/thor/line_editor/readline.rb#42
2671
- def completion_options; end
2672
-
2673
- # source://thor//lib/thor/line_editor/readline.rb#32
2674
- def completion_proc; end
2675
-
2676
- # @return [Boolean]
2677
- #
2678
- # source://thor//lib/thor/line_editor/readline.rb#46
2679
- def use_path_completion?; end
2680
-
2681
- class << self
2682
- # @return [Boolean]
2683
- #
2684
- # source://thor//lib/thor/line_editor/readline.rb#4
2685
- def available?; end
2686
- end
2687
- end
2688
-
2689
- # source://thor//lib/thor/line_editor/readline.rb#50
2690
- class Thor::LineEditor::Readline::PathCompletion
2691
- # @return [PathCompletion] a new instance of PathCompletion
2692
- #
2693
- # source://thor//lib/thor/line_editor/readline.rb#54
2694
- def initialize(text); end
2695
-
2696
- # source://thor//lib/thor/line_editor/readline.rb#58
2697
- def matches; end
2698
-
2699
- private
2700
-
2701
- # source://thor//lib/thor/line_editor/readline.rb#68
2702
- def absolute_matches; end
2703
-
2704
- # source://thor//lib/thor/line_editor/readline.rb#82
2705
- def base_path; end
2706
-
2707
- # source://thor//lib/thor/line_editor/readline.rb#78
2708
- def glob_pattern; end
2709
-
2710
- # source://thor//lib/thor/line_editor/readline.rb#64
2711
- def relative_matches; end
2712
-
2713
- # Returns the value of attribute text.
2714
- #
2715
- # source://thor//lib/thor/line_editor/readline.rb#51
2716
- def text; end
2717
- end
2718
-
2719
- # source://thor//lib/thor/error.rb#101
2720
- class Thor::MalformattedArgumentError < ::Thor::InvocationError; end
2721
-
2722
- # source://thor//lib/thor/nested_context.rb#2
2723
- class Thor::NestedContext
2724
- # @return [NestedContext] a new instance of NestedContext
2725
- #
2726
- # source://thor//lib/thor/nested_context.rb#3
2727
- def initialize; end
2728
-
2729
- # source://thor//lib/thor/nested_context.rb#7
2730
- def enter; end
2731
-
2732
- # @return [Boolean]
2733
- #
2734
- # source://thor//lib/thor/nested_context.rb#15
2735
- def entered?; end
2736
-
2737
- private
2738
-
2739
- # source://thor//lib/thor/nested_context.rb#25
2740
- def pop; end
2741
-
2742
- # source://thor//lib/thor/nested_context.rb#21
2743
- def push; end
2744
- end
2745
-
2746
- # source://thor//lib/thor/error.rb#8
2747
- class Thor::NoKwargSpellChecker < ::DidYouMean::SpellChecker
2748
- # source://thor//lib/thor/error.rb#9
2749
- def initialize(dictionary); end
2750
- end
2751
-
2752
- # source://thor//lib/thor/parser/option.rb#2
2753
- class Thor::Option < ::Thor::Argument
2754
- # @return [Option] a new instance of Option
2755
- #
2756
- # source://thor//lib/thor/parser/option.rb#7
2757
- def initialize(name, options = T.unsafe(nil)); end
2758
-
2759
- # Returns the value of attribute aliases.
2760
- #
2761
- # source://thor//lib/thor/parser/option.rb#3
2762
- def aliases; end
2763
-
2764
- # source://thor//lib/thor/parser/option.rb#105
2765
- def array?; end
2766
-
2767
- # source://thor//lib/thor/parser/option.rb#105
2768
- def boolean?; end
2769
-
2770
- # Returns the value of attribute group.
2771
- #
2772
- # source://thor//lib/thor/parser/option.rb#3
2773
- def group; end
2774
-
2775
- # source://thor//lib/thor/parser/option.rb#105
2776
- def hash?; end
2777
-
2778
- # Returns the value of attribute hide.
2779
- #
2780
- # source://thor//lib/thor/parser/option.rb#3
2781
- def hide; end
2782
-
2783
- # source://thor//lib/thor/parser/option.rb#79
2784
- def human_name; end
2785
-
2786
- # Returns the value of attribute lazy_default.
2787
- #
2788
- # source://thor//lib/thor/parser/option.rb#3
2789
- def lazy_default; end
2790
-
2791
- # source://thor//lib/thor/parser/option.rb#105
2792
- def numeric?; end
2793
-
2794
- # Returns the value of attribute repeatable.
2795
- #
2796
- # source://thor//lib/thor/parser/option.rb#3
2797
- def repeatable; end
2798
-
2799
- # source://thor//lib/thor/parser/option.rb#105
2800
- def string?; end
2801
-
2802
- # source://thor//lib/thor/parser/option.rb#75
2803
- def switch_name; end
2804
-
2805
- # source://thor//lib/thor/parser/option.rb#83
2806
- def usage(padding = T.unsafe(nil)); end
2807
-
2808
- protected
2809
-
2810
- # source://thor//lib/thor/parser/option.rb#155
2811
- def dasherize(str); end
2812
-
2813
- # @return [Boolean]
2814
- #
2815
- # source://thor//lib/thor/parser/option.rb#147
2816
- def dasherized?; end
2817
-
2818
- # source://thor//lib/thor/parser/option.rb#151
2819
- def undasherize(str); end
2820
-
2821
- # @raise [ArgumentError]
2822
- #
2823
- # source://thor//lib/thor/parser/option.rb#113
2824
- def validate!; end
2825
-
2826
- # source://thor//lib/thor/parser/option.rb#118
2827
- def validate_default_type!; end
2828
-
2829
- class << self
2830
- # This parse quick options given as method_options. It makes several
2831
- # assumptions, but you can be more specific using the option method.
2832
- #
2833
- # parse :foo => "bar"
2834
- # #=> Option foo with default value bar
2835
- #
2836
- # parse [:foo, :baz] => "bar"
2837
- # #=> Option foo with default value bar and alias :baz
2838
- #
2839
- # parse :foo => :required
2840
- # #=> Required option foo without default value
2841
- #
2842
- # parse :foo => 2
2843
- # #=> Option foo with default value 2 and type numeric
2844
- #
2845
- # parse :foo => :numeric
2846
- # #=> Option foo without default value and type numeric
2847
- #
2848
- # parse :foo => true
2849
- # #=> Option foo with default value true and type boolean
2850
- #
2851
- # The valid types are :boolean, :numeric, :hash, :array and :string. If none
2852
- # is given a default type is assumed. This default type accepts arguments as
2853
- # string (--foo=value) or booleans (just --foo).
2854
- #
2855
- # By default all options are optional, unless :required is given.
2856
- #
2857
- # source://thor//lib/thor/parser/option.rb#45
2858
- def parse(key, value); end
2859
- end
2860
- end
2861
-
2862
- # source://thor//lib/thor/parser/option.rb#5
2863
- Thor::Option::VALID_TYPES = T.let(T.unsafe(nil), Array)
2864
-
2865
- # source://thor//lib/thor/parser/options.rb#2
2866
- class Thor::Options < ::Thor::Arguments
2867
- # Takes a hash of Thor::Option and a hash with defaults.
2868
- #
2869
- # If +stop_on_unknown+ is true, #parse will stop as soon as it encounters
2870
- # an unknown option or a regular argument.
2871
- #
2872
- # @return [Options] a new instance of Options
2873
- #
2874
- # source://thor//lib/thor/parser/options.rb#32
2875
- def initialize(hash_options = T.unsafe(nil), defaults = T.unsafe(nil), stop_on_unknown = T.unsafe(nil), disable_required_check = T.unsafe(nil)); end
2876
-
2877
- # @raise [UnknownArgumentError]
2878
- #
2879
- # source://thor//lib/thor/parser/options.rb#141
2880
- def check_unknown!; end
2881
-
2882
- # source://thor//lib/thor/parser/options.rb#88
2883
- def parse(args); end
2884
-
2885
- # source://thor//lib/thor/parser/options.rb#64
2886
- def peek; end
2887
-
2888
- # source://thor//lib/thor/parser/options.rb#60
2889
- def remaining; end
2890
-
2891
- # source://thor//lib/thor/parser/options.rb#78
2892
- def shift; end
2893
-
2894
- # source://thor//lib/thor/parser/options.rb#83
2895
- def unshift(arg, is_value: T.unsafe(nil)); end
2896
-
2897
- protected
2898
-
2899
- # source://thor//lib/thor/parser/options.rb#151
2900
- def assign_result!(option, result); end
2901
-
2902
- # Check if the current value in peek is a registered switch.
2903
- #
2904
- # Two booleans are returned. The first is true if the current value
2905
- # starts with a hyphen; the second is true if it is a registered switch.
2906
- #
2907
- # @return [Boolean]
2908
- #
2909
- # source://thor//lib/thor/parser/options.rb#165
2910
- def current_is_switch?; end
2911
-
2912
- # @return [Boolean]
2913
- #
2914
- # source://thor//lib/thor/parser/options.rb#177
2915
- def current_is_switch_formatted?; end
2916
-
2917
- # @return [Boolean]
2918
- #
2919
- # source://thor//lib/thor/parser/options.rb#187
2920
- def current_is_value?; end
2921
-
2922
- # Check if the given argument is actually a shortcut.
2923
- #
2924
- # source://thor//lib/thor/parser/options.rb#206
2925
- def normalize_switch(arg); end
2926
-
2927
- # Parse boolean values which can be given as --foo=true, --foo or --no-foo.
2928
- #
2929
- # source://thor//lib/thor/parser/options.rb#217
2930
- def parse_boolean(switch); end
2931
-
2932
- # Parse the value at the peek analyzing if it requires an input or not.
2933
- #
2934
- # source://thor//lib/thor/parser/options.rb#235
2935
- def parse_peek(switch, option); end
2936
-
2937
- # @return [Boolean]
2938
- #
2939
- # source://thor//lib/thor/parser/options.rb#210
2940
- def parsing_options?; end
2941
-
2942
- # @return [Boolean]
2943
- #
2944
- # source://thor//lib/thor/parser/options.rb#192
2945
- def switch?(arg); end
2946
-
2947
- # source://thor//lib/thor/parser/options.rb#196
2948
- def switch_option(arg); end
2949
-
2950
- class << self
2951
- # Receives a hash and makes it switches.
2952
- #
2953
- # source://thor//lib/thor/parser/options.rb#11
2954
- def to_switches(options); end
2955
- end
2956
- end
2957
-
2958
- # source://thor//lib/thor/parser/options.rb#5
2959
- Thor::Options::EQ_RE = T.let(T.unsafe(nil), Regexp)
2960
-
2961
- # source://thor//lib/thor/parser/options.rb#3
2962
- Thor::Options::LONG_RE = T.let(T.unsafe(nil), Regexp)
2963
-
2964
- # source://thor//lib/thor/parser/options.rb#8
2965
- Thor::Options::OPTS_END = T.let(T.unsafe(nil), String)
2966
-
2967
- # source://thor//lib/thor/parser/options.rb#7
2968
- Thor::Options::SHORT_NUM = T.let(T.unsafe(nil), Regexp)
2969
-
2970
- # source://thor//lib/thor/parser/options.rb#4
2971
- Thor::Options::SHORT_RE = T.let(T.unsafe(nil), Regexp)
2972
-
2973
- # Allow either -x -v or -xv style for single char args
2974
- #
2975
- # source://thor//lib/thor/parser/options.rb#6
2976
- Thor::Options::SHORT_SQ_RE = T.let(T.unsafe(nil), Regexp)
2977
-
2978
- # source://thor//lib/thor/error.rb#98
2979
- class Thor::RequiredArgumentMissingError < ::Thor::InvocationError; end
2980
-
2981
- # source://thor//lib/thor/util.rb#4
2982
- module Thor::Sandbox; end
2983
-
2984
- # source://thor//lib/thor/shell.rb#23
2985
- module Thor::Shell
2986
- # Add shell to initialize config values.
2987
- #
2988
- # ==== Configuration
2989
- # shell<Object>:: An instance of the shell to be used.
2990
- #
2991
- # ==== Examples
2992
- #
2993
- # class MyScript < Thor
2994
- # argument :first, :type => :numeric
2995
- # end
2996
- #
2997
- # MyScript.new [1.0], { :foo => :bar }, :shell => Thor::Shell::Basic.new
2998
- #
2999
- # source://thor//lib/thor/shell.rb#44
3000
- def initialize(args = T.unsafe(nil), options = T.unsafe(nil), config = T.unsafe(nil)); end
3001
-
3002
- # source://thor//lib/thor/shell.rb#59
3003
- def ask(*args, &block); end
3004
-
3005
- # source://thor//lib/thor/shell.rb#59
3006
- def error(*args, &block); end
3007
-
3008
- # source://thor//lib/thor/shell.rb#59
3009
- def file_collision(*args, &block); end
3010
-
3011
- # source://thor//lib/thor/shell.rb#59
3012
- def no?(*args, &block); end
3013
-
3014
- # source://thor//lib/thor/shell.rb#59
3015
- def print_in_columns(*args, &block); end
3016
-
3017
- # source://thor//lib/thor/shell.rb#59
3018
- def print_table(*args, &block); end
3019
-
3020
- # source://thor//lib/thor/shell.rb#59
3021
- def print_wrapped(*args, &block); end
3022
-
3023
- # source://thor//lib/thor/shell.rb#59
3024
- def say(*args, &block); end
3025
-
3026
- # source://thor//lib/thor/shell.rb#59
3027
- def say_error(*args, &block); end
3028
-
3029
- # source://thor//lib/thor/shell.rb#59
3030
- def say_status(*args, &block); end
3031
-
3032
- # source://thor//lib/thor/shell.rb#59
3033
- def set_color(*args, &block); end
3034
-
3035
- # Holds the shell for the given Thor instance. If no shell is given,
3036
- # it gets a default shell from Thor::Base.shell.
3037
- #
3038
- # source://thor//lib/thor/shell.rb#52
3039
- def shell; end
3040
-
3041
- # Sets the attribute shell
3042
- #
3043
- # @param value the value to set the attribute shell to.
3044
- #
3045
- # source://thor//lib/thor/shell.rb#25
3046
- def shell=(_arg0); end
3047
-
3048
- # source://thor//lib/thor/shell.rb#59
3049
- def terminal_width(*args, &block); end
3050
-
3051
- # Yields the given block with padding.
3052
- #
3053
- # source://thor//lib/thor/shell.rb#66
3054
- def with_padding; end
3055
-
3056
- # source://thor//lib/thor/shell.rb#59
3057
- def yes?(*args, &block); end
3058
-
3059
- protected
3060
-
3061
- # Allow shell to be shared between invocations.
3062
- #
3063
- # source://thor//lib/thor/shell.rb#77
3064
- def _shared_configuration; end
3065
- end
3066
-
3067
- # source://thor//lib/thor/shell/basic.rb#3
3068
- class Thor::Shell::Basic
3069
- # Initialize base, mute and padding to nil.
3070
- #
3071
- # @return [Basic] a new instance of Basic
3072
- #
3073
- # source://thor//lib/thor/shell/basic.rb#11
3074
- def initialize; end
3075
-
3076
- # Asks something to the user and receives a response.
3077
- #
3078
- # If a default value is specified it will be presented to the user
3079
- # and allows them to select that value with an empty response. This
3080
- # option is ignored when limited answers are supplied.
3081
- #
3082
- # If asked to limit the correct responses, you can pass in an
3083
- # array of acceptable answers. If one of those is not supplied,
3084
- # they will be shown a message stating that one of those answers
3085
- # must be given and re-asked the question.
3086
- #
3087
- # If asking for sensitive information, the :echo option can be set
3088
- # to false to mask user input from $stdin.
3089
- #
3090
- # If the required input is a path, then set the path option to
3091
- # true. This will enable tab completion for file paths relative
3092
- # to the current working directory on systems that support
3093
- # Readline.
3094
- #
3095
- # ==== Example
3096
- # ask("What is your name?")
3097
- #
3098
- # ask("What is the planet furthest from the sun?", :default => "Pluto")
3099
- #
3100
- # ask("What is your favorite Neopolitan flavor?", :limited_to => ["strawberry", "chocolate", "vanilla"])
3101
- #
3102
- # ask("What is your password?", :echo => false)
3103
- #
3104
- # ask("Where should the file be saved?", :path => true)
3105
- #
3106
- # source://thor//lib/thor/shell/basic.rb#78
3107
- def ask(statement, *args); end
3108
-
3109
- # Returns the value of attribute base.
3110
- #
3111
- # source://thor//lib/thor/shell/basic.rb#6
3112
- def base; end
3113
-
3114
- # Sets the attribute base
3115
- #
3116
- # @param value the value to set the attribute base to.
3117
- #
3118
- # source://thor//lib/thor/shell/basic.rb#6
3119
- def base=(_arg0); end
3120
-
3121
- # Called if something goes wrong during the execution. This is used by Thor
3122
- # internally and should not be used inside your scripts. If something went
3123
- # wrong, you can always raise an exception. If you raise a Thor::Error, it
3124
- # will be rescued and wrapped in the method below.
3125
- #
3126
- # source://thor//lib/thor/shell/basic.rb#342
3127
- def error(statement); end
3128
-
3129
- # Deals with file collision and returns true if the file should be
3130
- # overwritten and false otherwise. If a block is given, it uses the block
3131
- # response as the content for the diff.
3132
- #
3133
- # ==== Parameters
3134
- # destination<String>:: the destination file to solve conflicts
3135
- # block<Proc>:: an optional block that returns the value to be used in diff and merge
3136
- #
3137
- # source://thor//lib/thor/shell/basic.rb#285
3138
- def file_collision(destination); end
3139
-
3140
- # Sets the output padding while executing a block and resets it.
3141
- #
3142
- # source://thor//lib/thor/shell/basic.rb#41
3143
- def indent(count = T.unsafe(nil)); end
3144
-
3145
- # Mute everything that's inside given block
3146
- #
3147
- # source://thor//lib/thor/shell/basic.rb#20
3148
- def mute; end
3149
-
3150
- # Check if base is muted
3151
- #
3152
- # @return [Boolean]
3153
- #
3154
- # source://thor//lib/thor/shell/basic.rb#29
3155
- def mute?; end
3156
-
3157
- # Make a question the to user and returns true if the user replies "n" or
3158
- # "no".
3159
- #
3160
- # @return [Boolean]
3161
- #
3162
- # source://thor//lib/thor/shell/basic.rb#154
3163
- def no?(statement, color = T.unsafe(nil)); end
3164
-
3165
- # Returns the value of attribute padding.
3166
- #
3167
- # source://thor//lib/thor/shell/basic.rb#7
3168
- def padding; end
3169
-
3170
- # Sets the output padding, not allowing less than zero values.
3171
- #
3172
- # source://thor//lib/thor/shell/basic.rb#35
3173
- def padding=(value); end
3174
-
3175
- # Prints values in columns
3176
- #
3177
- # ==== Parameters
3178
- # Array[String, String, ...]
3179
- #
3180
- # source://thor//lib/thor/shell/basic.rb#163
3181
- def print_in_columns(array); end
3182
-
3183
- # Prints a table.
3184
- #
3185
- # ==== Parameters
3186
- # Array[Array[String, String, ...]]
3187
- #
3188
- # ==== Options
3189
- # indent<Integer>:: Indent the first column by indent value.
3190
- # colwidth<Integer>:: Force the first column to colwidth spaces wide.
3191
- #
3192
- # source://thor//lib/thor/shell/basic.rb#185
3193
- def print_table(array, options = T.unsafe(nil)); end
3194
-
3195
- # Prints a long string, word-wrapping the text to the current width of the
3196
- # terminal display. Ideal for printing heredocs.
3197
- #
3198
- # ==== Parameters
3199
- # String
3200
- #
3201
- # ==== Options
3202
- # indent<Integer>:: Indent each line of the printed paragraph by indent value.
3203
- #
3204
- # source://thor//lib/thor/shell/basic.rb#247
3205
- def print_wrapped(message, options = T.unsafe(nil)); end
3206
-
3207
- # Say (print) something to the user. If the sentence ends with a whitespace
3208
- # or tab character, a new line is not appended (print + flush). Otherwise
3209
- # are passed straight to puts (behavior got from Highline).
3210
- #
3211
- # ==== Example
3212
- # say("I know you knew that.")
3213
- #
3214
- # source://thor//lib/thor/shell/basic.rb#96
3215
- def say(message = T.unsafe(nil), color = T.unsafe(nil), force_new_line = T.unsafe(nil)); end
3216
-
3217
- # Say (print) an error to the user. If the sentence ends with a whitespace
3218
- # or tab character, a new line is not appended (print + flush). Otherwise
3219
- # are passed straight to puts (behavior got from Highline).
3220
- #
3221
- # ==== Example
3222
- # say_error("error: something went wrong")
3223
- #
3224
- # source://thor//lib/thor/shell/basic.rb#113
3225
- def say_error(message = T.unsafe(nil), color = T.unsafe(nil), force_new_line = T.unsafe(nil)); end
3226
-
3227
- # Say a status with the given color and appends the message. Since this
3228
- # method is used frequently by actions, it allows nil or false to be given
3229
- # in log_status, avoiding the message from being shown. If a Symbol is
3230
- # given in log_status, it's used as the color.
3231
- #
3232
- # source://thor//lib/thor/shell/basic.rb#128
3233
- def say_status(status, message, log_status = T.unsafe(nil)); end
3234
-
3235
- # Apply color to the given string with optional bold. Disabled in the
3236
- # Thor::Shell::Basic class.
3237
- #
3238
- # source://thor//lib/thor/shell/basic.rb#349
3239
- def set_color(string, *_arg1); end
3240
-
3241
- # source://thor//lib/thor/shell/basic.rb#326
3242
- def terminal_width; end
3243
-
3244
- # Make a question the to user and returns true if the user replies "y" or
3245
- # "yes".
3246
- #
3247
- # @return [Boolean]
3248
- #
3249
- # source://thor//lib/thor/shell/basic.rb#147
3250
- def yes?(statement, color = T.unsafe(nil)); end
3251
-
3252
- protected
3253
-
3254
- # source://thor//lib/thor/shell/basic.rb#486
3255
- def answer_match(possibilities, answer, case_insensitive); end
3256
-
3257
- # source://thor//lib/thor/shell/basic.rb#443
3258
- def as_unicode; end
3259
-
3260
- # source://thor//lib/thor/shell/basic.rb#473
3261
- def ask_filtered(statement, color, options); end
3262
-
3263
- # source://thor//lib/thor/shell/basic.rb#456
3264
- def ask_simply(statement, color, options); end
3265
-
3266
- # @return [Boolean]
3267
- #
3268
- # source://thor//lib/thor/shell/basic.rb#360
3269
- def can_display_colors?; end
3270
-
3271
- # Calculate the dynamic width of the terminal
3272
- #
3273
- # source://thor//lib/thor/shell/basic.rb#415
3274
- def dynamic_width; end
3275
-
3276
- # source://thor//lib/thor/shell/basic.rb#419
3277
- def dynamic_width_stty; end
3278
-
3279
- # source://thor//lib/thor/shell/basic.rb#423
3280
- def dynamic_width_tput; end
3281
-
3282
- # source://thor//lib/thor/shell/basic.rb#387
3283
- def file_collision_help; end
3284
-
3285
- # source://thor//lib/thor/shell/basic.rb#507
3286
- def git_merge_tool; end
3287
-
3288
- # @return [Boolean]
3289
- #
3290
- # source://thor//lib/thor/shell/basic.rb#377
3291
- def is?(value); end
3292
-
3293
- # source://thor//lib/thor/shell/basic.rb#364
3294
- def lookup_color(color); end
3295
-
3296
- # source://thor//lib/thor/shell/basic.rb#494
3297
- def merge(destination, content); end
3298
-
3299
- # source://thor//lib/thor/shell/basic.rb#503
3300
- def merge_tool; end
3301
-
3302
- # source://thor//lib/thor/shell/basic.rb#355
3303
- def prepare_message(message, *color); end
3304
-
3305
- # @return [Boolean]
3306
- #
3307
- # source://thor//lib/thor/shell/basic.rb#410
3308
- def quiet?; end
3309
-
3310
- # source://thor//lib/thor/shell/basic.rb#399
3311
- def show_diff(destination, content); end
3312
-
3313
- # source://thor//lib/thor/shell/basic.rb#373
3314
- def stderr; end
3315
-
3316
- # source://thor//lib/thor/shell/basic.rb#369
3317
- def stdout; end
3318
-
3319
- # source://thor//lib/thor/shell/basic.rb#431
3320
- def truncate(string, width); end
3321
-
3322
- # @return [Boolean]
3323
- #
3324
- # source://thor//lib/thor/shell/basic.rb#427
3325
- def unix?; end
3326
- end
3327
-
3328
- # source://thor//lib/thor/shell/basic.rb#4
3329
- Thor::Shell::Basic::DEFAULT_TERMINAL_WIDTH = T.let(T.unsafe(nil), Integer)
3330
-
3331
- # Inherit from Thor::Shell::Basic and add set_color behavior. Check
3332
- # Thor::Shell::Basic to see all available methods.
3333
- #
3334
- # source://thor//lib/thor/shell/color.rb#9
3335
- class Thor::Shell::Color < ::Thor::Shell::Basic
3336
- # Set color by using a string or one of the defined constants. If a third
3337
- # option is set to true, it also adds bold to the string. This is based
3338
- # on Highline implementation and it automatically appends CLEAR to the end
3339
- # of the returned String.
3340
- #
3341
- # Pass foreground, background and bold options to this method as
3342
- # symbols.
3343
- #
3344
- # Example:
3345
- #
3346
- # set_color "Hi!", :red, :on_white, :bold
3347
- #
3348
- # The available colors are:
3349
- #
3350
- # :bold
3351
- # :black
3352
- # :red
3353
- # :green
3354
- # :yellow
3355
- # :blue
3356
- # :magenta
3357
- # :cyan
3358
- # :white
3359
- # :on_black
3360
- # :on_red
3361
- # :on_green
3362
- # :on_yellow
3363
- # :on_blue
3364
- # :on_magenta
3365
- # :on_cyan
3366
- # :on_white
3367
- #
3368
- # source://thor//lib/thor/shell/color.rb#79
3369
- def set_color(string, *colors); end
3370
-
3371
- protected
3372
-
3373
- # @return [Boolean]
3374
- #
3375
- # source://thor//lib/thor/shell/color.rb#107
3376
- def are_colors_disabled?; end
3377
-
3378
- # @return [Boolean]
3379
- #
3380
- # source://thor//lib/thor/shell/color.rb#103
3381
- def are_colors_supported?; end
3382
-
3383
- # @return [Boolean]
3384
- #
3385
- # source://thor//lib/thor/shell/color.rb#99
3386
- def can_display_colors?; end
3387
-
3388
- # Check if Diff::LCS is loaded. If it is, use it to create pretty output
3389
- # for diff.
3390
- #
3391
- # @return [Boolean]
3392
- #
3393
- # source://thor//lib/thor/shell/color.rb#144
3394
- def diff_lcs_loaded?; end
3395
-
3396
- # source://thor//lib/thor/shell/color.rb#127
3397
- def output_diff_line(diff); end
3398
-
3399
- # Overwrite show_diff to show diff with colors if Diff::LCS is
3400
- # available.
3401
- #
3402
- # source://thor//lib/thor/shell/color.rb#114
3403
- def show_diff(destination, content); end
3404
- end
3405
-
3406
- # Set the terminal's foreground ANSI color to black.
3407
- #
3408
- # source://thor//lib/thor/shell/color.rb#15
3409
- Thor::Shell::Color::BLACK = T.let(T.unsafe(nil), String)
3410
-
3411
- # Set the terminal's foreground ANSI color to blue.
3412
- #
3413
- # source://thor//lib/thor/shell/color.rb#23
3414
- Thor::Shell::Color::BLUE = T.let(T.unsafe(nil), String)
3415
-
3416
- # The start of an ANSI bold sequence.
3417
- #
3418
- # source://thor//lib/thor/shell/color.rb#12
3419
- Thor::Shell::Color::BOLD = T.let(T.unsafe(nil), String)
3420
-
3421
- # Embed in a String to clear all previous ANSI sequences.
3422
- #
3423
- # source://thor//lib/thor/shell/color.rb#10
3424
- Thor::Shell::Color::CLEAR = T.let(T.unsafe(nil), String)
3425
-
3426
- # Set the terminal's foreground ANSI color to cyan.
3427
- #
3428
- # source://thor//lib/thor/shell/color.rb#27
3429
- Thor::Shell::Color::CYAN = T.let(T.unsafe(nil), String)
3430
-
3431
- # Set the terminal's foreground ANSI color to green.
3432
- #
3433
- # source://thor//lib/thor/shell/color.rb#19
3434
- Thor::Shell::Color::GREEN = T.let(T.unsafe(nil), String)
3435
-
3436
- # Set the terminal's foreground ANSI color to magenta.
3437
- #
3438
- # source://thor//lib/thor/shell/color.rb#25
3439
- Thor::Shell::Color::MAGENTA = T.let(T.unsafe(nil), String)
3440
-
3441
- # Set the terminal's background ANSI color to black.
3442
- #
3443
- # source://thor//lib/thor/shell/color.rb#32
3444
- Thor::Shell::Color::ON_BLACK = T.let(T.unsafe(nil), String)
3445
-
3446
- # Set the terminal's background ANSI color to blue.
3447
- #
3448
- # source://thor//lib/thor/shell/color.rb#40
3449
- Thor::Shell::Color::ON_BLUE = T.let(T.unsafe(nil), String)
3450
-
3451
- # Set the terminal's background ANSI color to cyan.
3452
- #
3453
- # source://thor//lib/thor/shell/color.rb#44
3454
- Thor::Shell::Color::ON_CYAN = T.let(T.unsafe(nil), String)
3455
-
3456
- # Set the terminal's background ANSI color to green.
3457
- #
3458
- # source://thor//lib/thor/shell/color.rb#36
3459
- Thor::Shell::Color::ON_GREEN = T.let(T.unsafe(nil), String)
3460
-
3461
- # Set the terminal's background ANSI color to magenta.
3462
- #
3463
- # source://thor//lib/thor/shell/color.rb#42
3464
- Thor::Shell::Color::ON_MAGENTA = T.let(T.unsafe(nil), String)
3465
-
3466
- # Set the terminal's background ANSI color to red.
3467
- #
3468
- # source://thor//lib/thor/shell/color.rb#34
3469
- Thor::Shell::Color::ON_RED = T.let(T.unsafe(nil), String)
3470
-
3471
- # Set the terminal's background ANSI color to white.
3472
- #
3473
- # source://thor//lib/thor/shell/color.rb#46
3474
- Thor::Shell::Color::ON_WHITE = T.let(T.unsafe(nil), String)
3475
-
3476
- # Set the terminal's background ANSI color to yellow.
3477
- #
3478
- # source://thor//lib/thor/shell/color.rb#38
3479
- Thor::Shell::Color::ON_YELLOW = T.let(T.unsafe(nil), String)
3480
-
3481
- # Set the terminal's foreground ANSI color to red.
3482
- #
3483
- # source://thor//lib/thor/shell/color.rb#17
3484
- Thor::Shell::Color::RED = T.let(T.unsafe(nil), String)
3485
-
3486
- # Set the terminal's foreground ANSI color to white.
3487
- #
3488
- # source://thor//lib/thor/shell/color.rb#29
3489
- Thor::Shell::Color::WHITE = T.let(T.unsafe(nil), String)
3490
-
3491
- # Set the terminal's foreground ANSI color to yellow.
3492
- #
3493
- # source://thor//lib/thor/shell/color.rb#21
3494
- Thor::Shell::Color::YELLOW = T.let(T.unsafe(nil), String)
3495
-
3496
- # Inherit from Thor::Shell::Basic and add set_color behavior. Check
3497
- # Thor::Shell::Basic to see all available methods.
3498
- class Thor::Shell::HTML < ::Thor::Shell::Basic
3499
- # Ask something to the user and receives a response.
3500
- #
3501
- # ==== Example
3502
- # ask("What is your name?")
3503
- #
3504
- # TODO: Implement #ask for Thor::Shell::HTML
3505
- #
3506
- # @raise [NotImplementedError]
3507
- #
3508
- # source://thor//lib/thor/shell/html.rb#70
3509
- def ask(statement, color = T.unsafe(nil)); end
3510
-
3511
- # Set color by using a string or one of the defined constants. If a third
3512
- # option is set to true, it also adds bold to the string. This is based
3513
- # on Highline implementation and it automatically appends CLEAR to the end
3514
- # of the returned String.
3515
- #
3516
- # source://thor//lib/thor/shell/html.rb#51
3517
- def set_color(string, *colors); end
3518
-
3519
- protected
3520
-
3521
- # @return [Boolean]
3522
- #
3523
- # source://thor//lib/thor/shell/html.rb#76
3524
- def can_display_colors?; end
3525
-
3526
- # Check if Diff::LCS is loaded. If it is, use it to create pretty output
3527
- # for diff.
3528
- #
3529
- # @return [Boolean]
3530
- #
3531
- # source://thor//lib/thor/shell/html.rb#113
3532
- def diff_lcs_loaded?; end
3533
-
3534
- # source://thor//lib/thor/shell/html.rb#96
3535
- def output_diff_line(diff); end
3536
-
3537
- # Overwrite show_diff to show diff with colors if Diff::LCS is
3538
- # available.
3539
- #
3540
- # source://thor//lib/thor/shell/html.rb#83
3541
- def show_diff(destination, content); end
3542
- end
3543
-
3544
- # Set the terminal's foreground HTML color to black.
3545
- #
3546
- # source://thor//lib/thor/shell/html.rb#13
3547
- Thor::Shell::HTML::BLACK = T.let(T.unsafe(nil), String)
3548
-
3549
- # Set the terminal's foreground HTML color to blue.
3550
- #
3551
- # source://thor//lib/thor/shell/html.rb#21
3552
- Thor::Shell::HTML::BLUE = T.let(T.unsafe(nil), String)
3553
-
3554
- # The start of an HTML bold sequence.
3555
- #
3556
- # source://thor//lib/thor/shell/html.rb#10
3557
- Thor::Shell::HTML::BOLD = T.let(T.unsafe(nil), String)
3558
-
3559
- # Set the terminal's foreground HTML color to cyan.
3560
- #
3561
- # source://thor//lib/thor/shell/html.rb#25
3562
- Thor::Shell::HTML::CYAN = T.let(T.unsafe(nil), String)
3563
-
3564
- # Set the terminal's foreground HTML color to green.
3565
- #
3566
- # source://thor//lib/thor/shell/html.rb#17
3567
- Thor::Shell::HTML::GREEN = T.let(T.unsafe(nil), String)
3568
-
3569
- # Set the terminal's foreground HTML color to magenta.
3570
- #
3571
- # source://thor//lib/thor/shell/html.rb#23
3572
- Thor::Shell::HTML::MAGENTA = T.let(T.unsafe(nil), String)
3573
-
3574
- # Set the terminal's background HTML color to black.
3575
- #
3576
- # source://thor//lib/thor/shell/html.rb#30
3577
- Thor::Shell::HTML::ON_BLACK = T.let(T.unsafe(nil), String)
3578
-
3579
- # Set the terminal's background HTML color to blue.
3580
- #
3581
- # source://thor//lib/thor/shell/html.rb#38
3582
- Thor::Shell::HTML::ON_BLUE = T.let(T.unsafe(nil), String)
3583
-
3584
- # Set the terminal's background HTML color to cyan.
3585
- #
3586
- # source://thor//lib/thor/shell/html.rb#42
3587
- Thor::Shell::HTML::ON_CYAN = T.let(T.unsafe(nil), String)
3588
-
3589
- # Set the terminal's background HTML color to green.
3590
- #
3591
- # source://thor//lib/thor/shell/html.rb#34
3592
- Thor::Shell::HTML::ON_GREEN = T.let(T.unsafe(nil), String)
3593
-
3594
- # Set the terminal's background HTML color to magenta.
3595
- #
3596
- # source://thor//lib/thor/shell/html.rb#40
3597
- Thor::Shell::HTML::ON_MAGENTA = T.let(T.unsafe(nil), String)
3598
-
3599
- # Set the terminal's background HTML color to red.
3600
- #
3601
- # source://thor//lib/thor/shell/html.rb#32
3602
- Thor::Shell::HTML::ON_RED = T.let(T.unsafe(nil), String)
3603
-
3604
- # Set the terminal's background HTML color to white.
3605
- #
3606
- # source://thor//lib/thor/shell/html.rb#44
3607
- Thor::Shell::HTML::ON_WHITE = T.let(T.unsafe(nil), String)
3608
-
3609
- # Set the terminal's background HTML color to yellow.
3610
- #
3611
- # source://thor//lib/thor/shell/html.rb#36
3612
- Thor::Shell::HTML::ON_YELLOW = T.let(T.unsafe(nil), String)
3613
-
3614
- # Set the terminal's foreground HTML color to red.
3615
- #
3616
- # source://thor//lib/thor/shell/html.rb#15
3617
- Thor::Shell::HTML::RED = T.let(T.unsafe(nil), String)
3618
-
3619
- # Set the terminal's foreground HTML color to white.
3620
- #
3621
- # source://thor//lib/thor/shell/html.rb#27
3622
- Thor::Shell::HTML::WHITE = T.let(T.unsafe(nil), String)
3623
-
3624
- # Set the terminal's foreground HTML color to yellow.
3625
- #
3626
- # source://thor//lib/thor/shell/html.rb#19
3627
- Thor::Shell::HTML::YELLOW = T.let(T.unsafe(nil), String)
3628
-
3629
- # source://thor//lib/thor/shell.rb#24
3630
- Thor::Shell::SHELL_DELEGATED_METHODS = T.let(T.unsafe(nil), Array)
3631
-
3632
- # source://thor//lib/thor/base.rb#23
3633
- Thor::TEMPLATE_EXTNAME = T.let(T.unsafe(nil), String)
3634
-
3635
- # Thor methods that should not be overwritten by the user.
3636
- #
3637
- # source://thor//lib/thor/base.rb#20
3638
- Thor::THOR_RESERVED_WORDS = T.let(T.unsafe(nil), Array)
3639
-
3640
- # source://thor//lib/thor/command.rb#117
3641
- Thor::Task = Thor::Command
3642
-
3643
- # Raised when a command was not found.
3644
- #
3645
- # source://thor//lib/thor/error.rb#27
3646
- class Thor::UndefinedCommandError < ::Thor::Error
3647
- include ::DidYouMean::Correctable
3648
-
3649
- # @return [UndefinedCommandError] a new instance of UndefinedCommandError
3650
- #
3651
- # source://thor//lib/thor/error.rb#46
3652
- def initialize(command, all_commands, namespace); end
3653
-
3654
- # Returns the value of attribute all_commands.
3655
- #
3656
- # source://thor//lib/thor/error.rb#44
3657
- def all_commands; end
3658
-
3659
- # Returns the value of attribute command.
3660
- #
3661
- # source://thor//lib/thor/error.rb#44
3662
- def command; end
3663
- end
3664
-
3665
- # source://thor//lib/thor/error.rb#28
3666
- class Thor::UndefinedCommandError::SpellChecker
3667
- # @return [SpellChecker] a new instance of SpellChecker
3668
- #
3669
- # source://thor//lib/thor/error.rb#31
3670
- def initialize(error); end
3671
-
3672
- # source://thor//lib/thor/error.rb#35
3673
- def corrections; end
3674
-
3675
- # Returns the value of attribute error.
3676
- #
3677
- # source://thor//lib/thor/error.rb#29
3678
- def error; end
3679
-
3680
- # source://thor//lib/thor/error.rb#39
3681
- def spell_checker; end
3682
- end
3683
-
3684
- # source://thor//lib/thor/error.rb#58
3685
- Thor::UndefinedTaskError = Thor::UndefinedCommandError
3686
-
3687
- # source://thor//lib/thor/error.rb#68
3688
- class Thor::UnknownArgumentError < ::Thor::Error
3689
- include ::DidYouMean::Correctable
3690
-
3691
- # @return [UnknownArgumentError] a new instance of UnknownArgumentError
3692
- #
3693
- # source://thor//lib/thor/error.rb#88
3694
- def initialize(switches, unknown); end
3695
-
3696
- # Returns the value of attribute switches.
3697
- #
3698
- # source://thor//lib/thor/error.rb#86
3699
- def switches; end
3700
-
3701
- # Returns the value of attribute unknown.
3702
- #
3703
- # source://thor//lib/thor/error.rb#86
3704
- def unknown; end
3705
- end
3706
-
3707
- # source://thor//lib/thor/error.rb#69
3708
- class Thor::UnknownArgumentError::SpellChecker
3709
- # @return [SpellChecker] a new instance of SpellChecker
3710
- #
3711
- # source://thor//lib/thor/error.rb#72
3712
- def initialize(error); end
3713
-
3714
- # source://thor//lib/thor/error.rb#76
3715
- def corrections; end
3716
-
3717
- # Returns the value of attribute error.
3718
- #
3719
- # source://thor//lib/thor/error.rb#70
3720
- def error; end
3721
-
3722
- # source://thor//lib/thor/error.rb#81
3723
- def spell_checker; end
3724
- end
3725
-
3726
- # This module holds several utilities:
3727
- #
3728
- # 1) Methods to convert thor namespaces to constants and vice-versa.
3729
- #
3730
- # Thor::Util.namespace_from_thor_class(Foo::Bar::Baz) #=> "foo:bar:baz"
3731
- #
3732
- # 2) Loading thor files and sandboxing:
3733
- #
3734
- # Thor::Util.load_thorfile("~/.thor/foo")
3735
- #
3736
- # source://thor//lib/thor/util.rb#17
3737
- module Thor::Util
3738
- class << self
3739
- # Receives a string and convert it to camel case. camel_case returns CamelCase.
3740
- #
3741
- # ==== Parameters
3742
- # String
3743
- #
3744
- # ==== Returns
3745
- # String
3746
- #
3747
- # source://thor//lib/thor/util.rb#104
3748
- def camel_case(str); end
3749
-
3750
- # Returns a string that has had any glob characters escaped.
3751
- # The glob characters are `* ? { } [ ]`.
3752
- #
3753
- # ==== Examples
3754
- #
3755
- # Thor::Util.escape_globs('[apps]') # => '\[apps\]'
3756
- #
3757
- # ==== Parameters
3758
- # String
3759
- #
3760
- # ==== Returns
3761
- # String
3762
- #
3763
- # source://thor//lib/thor/util.rb#263
3764
- def escape_globs(path); end
3765
-
3766
- # Returns a string that has had any HTML characters escaped.
3767
- #
3768
- # ==== Examples
3769
- #
3770
- # Thor::Util.escape_html('<div>') # => "&lt;div&gt;"
3771
- #
3772
- # ==== Parameters
3773
- # String
3774
- #
3775
- # ==== Returns
3776
- # String
3777
- #
3778
- # source://thor//lib/thor/util.rb#279
3779
- def escape_html(string); end
3780
-
3781
- # Receives a namespace and search for it in the Thor::Base subclasses.
3782
- #
3783
- # ==== Parameters
3784
- # namespace<String>:: The namespace to search for.
3785
- #
3786
- # source://thor//lib/thor/util.rb#24
3787
- def find_by_namespace(namespace); end
3788
-
3789
- # Receives a namespace and tries to retrieve a Thor or Thor::Group class
3790
- # from it. It first searches for a class using the all the given namespace,
3791
- # if it's not found, removes the highest entry and searches for the class
3792
- # again. If found, returns the highest entry as the class name.
3793
- #
3794
- # ==== Examples
3795
- #
3796
- # class Foo::Bar < Thor
3797
- # def baz
3798
- # end
3799
- # end
3800
- #
3801
- # class Baz::Foo < Thor::Group
3802
- # end
3803
- #
3804
- # Thor::Util.namespace_to_thor_class("foo:bar") #=> Foo::Bar, nil # will invoke default command
3805
- # Thor::Util.namespace_to_thor_class("baz:foo") #=> Baz::Foo, nil
3806
- # Thor::Util.namespace_to_thor_class("foo:bar:baz") #=> Foo::Bar, "baz"
3807
- #
3808
- # ==== Parameters
3809
- # namespace<String>
3810
- #
3811
- # source://thor//lib/thor/util.rb#131
3812
- def find_class_and_command_by_namespace(namespace, fallback = T.unsafe(nil)); end
3813
-
3814
- # Receives a namespace and tries to retrieve a Thor or Thor::Group class
3815
- # from it. It first searches for a class using the all the given namespace,
3816
- # if it's not found, removes the highest entry and searches for the class
3817
- # again. If found, returns the highest entry as the class name.
3818
- #
3819
- # ==== Examples
3820
- #
3821
- # class Foo::Bar < Thor
3822
- # def baz
3823
- # end
3824
- # end
3825
- #
3826
- # class Baz::Foo < Thor::Group
3827
- # end
3828
- #
3829
- # Thor::Util.namespace_to_thor_class("foo:bar") #=> Foo::Bar, nil # will invoke default command
3830
- # Thor::Util.namespace_to_thor_class("baz:foo") #=> Baz::Foo, nil
3831
- # Thor::Util.namespace_to_thor_class("foo:bar:baz") #=> Foo::Bar, "baz"
3832
- #
3833
- # ==== Parameters
3834
- # namespace<String>
3835
- #
3836
- # source://thor//lib/thor/util.rb#131
3837
- def find_class_and_task_by_namespace(namespace, fallback = T.unsafe(nil)); end
3838
-
3839
- # Where to look for Thor files.
3840
- #
3841
- # source://thor//lib/thor/util.rb#212
3842
- def globs_for(path); end
3843
-
3844
- # Receives a path and load the thor file in the path. The file is evaluated
3845
- # inside the sandbox to avoid namespacing conflicts.
3846
- #
3847
- # source://thor//lib/thor/util.rb#152
3848
- def load_thorfile(path, content = T.unsafe(nil), debug = T.unsafe(nil)); end
3849
-
3850
- # Receives a constant and converts it to a Thor namespace. Since Thor
3851
- # commands can be added to a sandbox, this method is also responsible for
3852
- # removing the sandbox namespace.
3853
- #
3854
- # This method should not be used in general because it's used to deal with
3855
- # older versions of Thor. On current versions, if you need to get the
3856
- # namespace from a class, just call namespace on it.
3857
- #
3858
- # ==== Parameters
3859
- # constant<Object>:: The constant to be converted to the thor path.
3860
- #
3861
- # ==== Returns
3862
- # String:: If we receive Foo::Bar::Baz it returns "foo:bar:baz"
3863
- #
3864
- # source://thor//lib/thor/util.rb#43
3865
- def namespace_from_thor_class(constant); end
3866
-
3867
- # Given the contents, evaluate it inside the sandbox and returns the
3868
- # namespaces defined in the sandbox.
3869
- #
3870
- # ==== Parameters
3871
- # contents<String>
3872
- #
3873
- # ==== Returns
3874
- # Array[Object]
3875
- #
3876
- # source://thor//lib/thor/util.rb#58
3877
- def namespaces_in_content(contents, file = T.unsafe(nil)); end
3878
-
3879
- # Return the path to the ruby interpreter taking into account multiple
3880
- # installations and windows extensions.
3881
- #
3882
- # source://thor//lib/thor/util.rb#220
3883
- def ruby_command; end
3884
-
3885
- # Receives a string and convert it to snake case. SnakeCase returns snake_case.
3886
- #
3887
- # ==== Parameters
3888
- # String
3889
- #
3890
- # ==== Returns
3891
- # String
3892
- #
3893
- # source://thor//lib/thor/util.rb#90
3894
- def snake_case(str); end
3895
-
3896
- # Returns the thor classes declared inside the given class.
3897
- #
3898
- # source://thor//lib/thor/util.rb#74
3899
- def thor_classes_in(klass); end
3900
-
3901
- # Returns the root where thor files are located, depending on the OS.
3902
- #
3903
- # source://thor//lib/thor/util.rb#191
3904
- def thor_root; end
3905
-
3906
- # Returns the files in the thor root. On Windows thor_root will be something
3907
- # like this:
3908
- #
3909
- # C:\Documents and Settings\james\.thor
3910
- #
3911
- # If we don't #gsub the \ character, Dir.glob will fail.
3912
- #
3913
- # source://thor//lib/thor/util.rb#202
3914
- def thor_root_glob; end
3915
-
3916
- # source://thor//lib/thor/util.rb#167
3917
- def user_home; end
3918
- end
3919
- end