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,3950 +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
- # Adds a compatibility layer to your Thor classes which allows you to use
2979
- # rake package tasks. For example, to use rspec rake tasks, one can do:
2980
- #
2981
- # require 'thor/rake_compat'
2982
- # require 'rspec/core/rake_task'
2983
- #
2984
- # class Default < Thor
2985
- # include Thor::RakeCompat
2986
- #
2987
- # RSpec::Core::RakeTask.new(:spec) do |t|
2988
- # t.spec_opts = ['--options', './.rspec']
2989
- # t.spec_files = FileList['spec/**/*_spec.rb']
2990
- # end
2991
- # end
2992
- module Thor::RakeCompat
2993
- include ::FileUtils::StreamUtils_
2994
- include ::FileUtils
2995
- include ::Rake::FileUtilsExt
2996
- include ::Rake::DSL
2997
-
2998
- class << self
2999
- # @private
3000
- #
3001
- # source://thor//lib/thor/rake_compat.rb#27
3002
- def included(base); end
3003
-
3004
- # source://thor//lib/thor/rake_compat.rb#23
3005
- def rake_classes; end
3006
- end
3007
- end
3008
-
3009
- # source://thor//lib/thor/error.rb#98
3010
- class Thor::RequiredArgumentMissingError < ::Thor::InvocationError; end
3011
-
3012
- # source://thor//lib/thor/util.rb#4
3013
- module Thor::Sandbox; end
3014
-
3015
- # source://thor//lib/thor/shell.rb#23
3016
- module Thor::Shell
3017
- # Add shell to initialize config values.
3018
- #
3019
- # ==== Configuration
3020
- # shell<Object>:: An instance of the shell to be used.
3021
- #
3022
- # ==== Examples
3023
- #
3024
- # class MyScript < Thor
3025
- # argument :first, :type => :numeric
3026
- # end
3027
- #
3028
- # MyScript.new [1.0], { :foo => :bar }, :shell => Thor::Shell::Basic.new
3029
- #
3030
- # source://thor//lib/thor/shell.rb#44
3031
- def initialize(args = T.unsafe(nil), options = T.unsafe(nil), config = T.unsafe(nil)); end
3032
-
3033
- # source://thor//lib/thor/shell.rb#59
3034
- def ask(*args, &block); end
3035
-
3036
- # source://thor//lib/thor/shell.rb#59
3037
- def error(*args, &block); end
3038
-
3039
- # source://thor//lib/thor/shell.rb#59
3040
- def file_collision(*args, &block); end
3041
-
3042
- # source://thor//lib/thor/shell.rb#59
3043
- def no?(*args, &block); end
3044
-
3045
- # source://thor//lib/thor/shell.rb#59
3046
- def print_in_columns(*args, &block); end
3047
-
3048
- # source://thor//lib/thor/shell.rb#59
3049
- def print_table(*args, &block); end
3050
-
3051
- # source://thor//lib/thor/shell.rb#59
3052
- def print_wrapped(*args, &block); end
3053
-
3054
- # source://thor//lib/thor/shell.rb#59
3055
- def say(*args, &block); end
3056
-
3057
- # source://thor//lib/thor/shell.rb#59
3058
- def say_error(*args, &block); end
3059
-
3060
- # source://thor//lib/thor/shell.rb#59
3061
- def say_status(*args, &block); end
3062
-
3063
- # source://thor//lib/thor/shell.rb#59
3064
- def set_color(*args, &block); end
3065
-
3066
- # Holds the shell for the given Thor instance. If no shell is given,
3067
- # it gets a default shell from Thor::Base.shell.
3068
- #
3069
- # source://thor//lib/thor/shell.rb#52
3070
- def shell; end
3071
-
3072
- # Sets the attribute shell
3073
- #
3074
- # @param value the value to set the attribute shell to.
3075
- #
3076
- # source://thor//lib/thor/shell.rb#25
3077
- def shell=(_arg0); end
3078
-
3079
- # source://thor//lib/thor/shell.rb#59
3080
- def terminal_width(*args, &block); end
3081
-
3082
- # Yields the given block with padding.
3083
- #
3084
- # source://thor//lib/thor/shell.rb#66
3085
- def with_padding; end
3086
-
3087
- # source://thor//lib/thor/shell.rb#59
3088
- def yes?(*args, &block); end
3089
-
3090
- protected
3091
-
3092
- # Allow shell to be shared between invocations.
3093
- #
3094
- # source://thor//lib/thor/shell.rb#77
3095
- def _shared_configuration; end
3096
- end
3097
-
3098
- # source://thor//lib/thor/shell/basic.rb#3
3099
- class Thor::Shell::Basic
3100
- # Initialize base, mute and padding to nil.
3101
- #
3102
- # @return [Basic] a new instance of Basic
3103
- #
3104
- # source://thor//lib/thor/shell/basic.rb#11
3105
- def initialize; end
3106
-
3107
- # Asks something to the user and receives a response.
3108
- #
3109
- # If a default value is specified it will be presented to the user
3110
- # and allows them to select that value with an empty response. This
3111
- # option is ignored when limited answers are supplied.
3112
- #
3113
- # If asked to limit the correct responses, you can pass in an
3114
- # array of acceptable answers. If one of those is not supplied,
3115
- # they will be shown a message stating that one of those answers
3116
- # must be given and re-asked the question.
3117
- #
3118
- # If asking for sensitive information, the :echo option can be set
3119
- # to false to mask user input from $stdin.
3120
- #
3121
- # If the required input is a path, then set the path option to
3122
- # true. This will enable tab completion for file paths relative
3123
- # to the current working directory on systems that support
3124
- # Readline.
3125
- #
3126
- # ==== Example
3127
- # ask("What is your name?")
3128
- #
3129
- # ask("What is the planet furthest from the sun?", :default => "Pluto")
3130
- #
3131
- # ask("What is your favorite Neopolitan flavor?", :limited_to => ["strawberry", "chocolate", "vanilla"])
3132
- #
3133
- # ask("What is your password?", :echo => false)
3134
- #
3135
- # ask("Where should the file be saved?", :path => true)
3136
- #
3137
- # source://thor//lib/thor/shell/basic.rb#78
3138
- def ask(statement, *args); end
3139
-
3140
- # Returns the value of attribute base.
3141
- #
3142
- # source://thor//lib/thor/shell/basic.rb#6
3143
- def base; end
3144
-
3145
- # Sets the attribute base
3146
- #
3147
- # @param value the value to set the attribute base to.
3148
- #
3149
- # source://thor//lib/thor/shell/basic.rb#6
3150
- def base=(_arg0); end
3151
-
3152
- # Called if something goes wrong during the execution. This is used by Thor
3153
- # internally and should not be used inside your scripts. If something went
3154
- # wrong, you can always raise an exception. If you raise a Thor::Error, it
3155
- # will be rescued and wrapped in the method below.
3156
- #
3157
- # source://thor//lib/thor/shell/basic.rb#342
3158
- def error(statement); end
3159
-
3160
- # Deals with file collision and returns true if the file should be
3161
- # overwritten and false otherwise. If a block is given, it uses the block
3162
- # response as the content for the diff.
3163
- #
3164
- # ==== Parameters
3165
- # destination<String>:: the destination file to solve conflicts
3166
- # block<Proc>:: an optional block that returns the value to be used in diff and merge
3167
- #
3168
- # source://thor//lib/thor/shell/basic.rb#285
3169
- def file_collision(destination); end
3170
-
3171
- # Sets the output padding while executing a block and resets it.
3172
- #
3173
- # source://thor//lib/thor/shell/basic.rb#41
3174
- def indent(count = T.unsafe(nil)); end
3175
-
3176
- # Mute everything that's inside given block
3177
- #
3178
- # source://thor//lib/thor/shell/basic.rb#20
3179
- def mute; end
3180
-
3181
- # Check if base is muted
3182
- #
3183
- # @return [Boolean]
3184
- #
3185
- # source://thor//lib/thor/shell/basic.rb#29
3186
- def mute?; end
3187
-
3188
- # Make a question the to user and returns true if the user replies "n" or
3189
- # "no".
3190
- #
3191
- # @return [Boolean]
3192
- #
3193
- # source://thor//lib/thor/shell/basic.rb#154
3194
- def no?(statement, color = T.unsafe(nil)); end
3195
-
3196
- # Returns the value of attribute padding.
3197
- #
3198
- # source://thor//lib/thor/shell/basic.rb#7
3199
- def padding; end
3200
-
3201
- # Sets the output padding, not allowing less than zero values.
3202
- #
3203
- # source://thor//lib/thor/shell/basic.rb#35
3204
- def padding=(value); end
3205
-
3206
- # Prints values in columns
3207
- #
3208
- # ==== Parameters
3209
- # Array[String, String, ...]
3210
- #
3211
- # source://thor//lib/thor/shell/basic.rb#163
3212
- def print_in_columns(array); end
3213
-
3214
- # Prints a table.
3215
- #
3216
- # ==== Parameters
3217
- # Array[Array[String, String, ...]]
3218
- #
3219
- # ==== Options
3220
- # indent<Integer>:: Indent the first column by indent value.
3221
- # colwidth<Integer>:: Force the first column to colwidth spaces wide.
3222
- #
3223
- # source://thor//lib/thor/shell/basic.rb#185
3224
- def print_table(array, options = T.unsafe(nil)); end
3225
-
3226
- # Prints a long string, word-wrapping the text to the current width of the
3227
- # terminal display. Ideal for printing heredocs.
3228
- #
3229
- # ==== Parameters
3230
- # String
3231
- #
3232
- # ==== Options
3233
- # indent<Integer>:: Indent each line of the printed paragraph by indent value.
3234
- #
3235
- # source://thor//lib/thor/shell/basic.rb#247
3236
- def print_wrapped(message, options = T.unsafe(nil)); end
3237
-
3238
- # Say (print) something to the user. If the sentence ends with a whitespace
3239
- # or tab character, a new line is not appended (print + flush). Otherwise
3240
- # are passed straight to puts (behavior got from Highline).
3241
- #
3242
- # ==== Example
3243
- # say("I know you knew that.")
3244
- #
3245
- # source://thor//lib/thor/shell/basic.rb#96
3246
- def say(message = T.unsafe(nil), color = T.unsafe(nil), force_new_line = T.unsafe(nil)); end
3247
-
3248
- # Say (print) an error to the user. If the sentence ends with a whitespace
3249
- # or tab character, a new line is not appended (print + flush). Otherwise
3250
- # are passed straight to puts (behavior got from Highline).
3251
- #
3252
- # ==== Example
3253
- # say_error("error: something went wrong")
3254
- #
3255
- # source://thor//lib/thor/shell/basic.rb#113
3256
- def say_error(message = T.unsafe(nil), color = T.unsafe(nil), force_new_line = T.unsafe(nil)); end
3257
-
3258
- # Say a status with the given color and appends the message. Since this
3259
- # method is used frequently by actions, it allows nil or false to be given
3260
- # in log_status, avoiding the message from being shown. If a Symbol is
3261
- # given in log_status, it's used as the color.
3262
- #
3263
- # source://thor//lib/thor/shell/basic.rb#128
3264
- def say_status(status, message, log_status = T.unsafe(nil)); end
3265
-
3266
- # Apply color to the given string with optional bold. Disabled in the
3267
- # Thor::Shell::Basic class.
3268
- #
3269
- # source://thor//lib/thor/shell/basic.rb#349
3270
- def set_color(string, *_arg1); end
3271
-
3272
- # source://thor//lib/thor/shell/basic.rb#326
3273
- def terminal_width; end
3274
-
3275
- # Make a question the to user and returns true if the user replies "y" or
3276
- # "yes".
3277
- #
3278
- # @return [Boolean]
3279
- #
3280
- # source://thor//lib/thor/shell/basic.rb#147
3281
- def yes?(statement, color = T.unsafe(nil)); end
3282
-
3283
- protected
3284
-
3285
- # source://thor//lib/thor/shell/basic.rb#486
3286
- def answer_match(possibilities, answer, case_insensitive); end
3287
-
3288
- # source://thor//lib/thor/shell/basic.rb#443
3289
- def as_unicode; end
3290
-
3291
- # source://thor//lib/thor/shell/basic.rb#473
3292
- def ask_filtered(statement, color, options); end
3293
-
3294
- # source://thor//lib/thor/shell/basic.rb#456
3295
- def ask_simply(statement, color, options); end
3296
-
3297
- # @return [Boolean]
3298
- #
3299
- # source://thor//lib/thor/shell/basic.rb#360
3300
- def can_display_colors?; end
3301
-
3302
- # Calculate the dynamic width of the terminal
3303
- #
3304
- # source://thor//lib/thor/shell/basic.rb#415
3305
- def dynamic_width; end
3306
-
3307
- # source://thor//lib/thor/shell/basic.rb#419
3308
- def dynamic_width_stty; end
3309
-
3310
- # source://thor//lib/thor/shell/basic.rb#423
3311
- def dynamic_width_tput; end
3312
-
3313
- # source://thor//lib/thor/shell/basic.rb#387
3314
- def file_collision_help; end
3315
-
3316
- # source://thor//lib/thor/shell/basic.rb#507
3317
- def git_merge_tool; end
3318
-
3319
- # @return [Boolean]
3320
- #
3321
- # source://thor//lib/thor/shell/basic.rb#377
3322
- def is?(value); end
3323
-
3324
- # source://thor//lib/thor/shell/basic.rb#364
3325
- def lookup_color(color); end
3326
-
3327
- # source://thor//lib/thor/shell/basic.rb#494
3328
- def merge(destination, content); end
3329
-
3330
- # source://thor//lib/thor/shell/basic.rb#503
3331
- def merge_tool; end
3332
-
3333
- # source://thor//lib/thor/shell/basic.rb#355
3334
- def prepare_message(message, *color); end
3335
-
3336
- # @return [Boolean]
3337
- #
3338
- # source://thor//lib/thor/shell/basic.rb#410
3339
- def quiet?; end
3340
-
3341
- # source://thor//lib/thor/shell/basic.rb#399
3342
- def show_diff(destination, content); end
3343
-
3344
- # source://thor//lib/thor/shell/basic.rb#373
3345
- def stderr; end
3346
-
3347
- # source://thor//lib/thor/shell/basic.rb#369
3348
- def stdout; end
3349
-
3350
- # source://thor//lib/thor/shell/basic.rb#431
3351
- def truncate(string, width); end
3352
-
3353
- # @return [Boolean]
3354
- #
3355
- # source://thor//lib/thor/shell/basic.rb#427
3356
- def unix?; end
3357
- end
3358
-
3359
- # source://thor//lib/thor/shell/basic.rb#4
3360
- Thor::Shell::Basic::DEFAULT_TERMINAL_WIDTH = T.let(T.unsafe(nil), Integer)
3361
-
3362
- # Inherit from Thor::Shell::Basic and add set_color behavior. Check
3363
- # Thor::Shell::Basic to see all available methods.
3364
- #
3365
- # source://thor//lib/thor/shell/color.rb#9
3366
- class Thor::Shell::Color < ::Thor::Shell::Basic
3367
- # Set color by using a string or one of the defined constants. If a third
3368
- # option is set to true, it also adds bold to the string. This is based
3369
- # on Highline implementation and it automatically appends CLEAR to the end
3370
- # of the returned String.
3371
- #
3372
- # Pass foreground, background and bold options to this method as
3373
- # symbols.
3374
- #
3375
- # Example:
3376
- #
3377
- # set_color "Hi!", :red, :on_white, :bold
3378
- #
3379
- # The available colors are:
3380
- #
3381
- # :bold
3382
- # :black
3383
- # :red
3384
- # :green
3385
- # :yellow
3386
- # :blue
3387
- # :magenta
3388
- # :cyan
3389
- # :white
3390
- # :on_black
3391
- # :on_red
3392
- # :on_green
3393
- # :on_yellow
3394
- # :on_blue
3395
- # :on_magenta
3396
- # :on_cyan
3397
- # :on_white
3398
- #
3399
- # source://thor//lib/thor/shell/color.rb#79
3400
- def set_color(string, *colors); end
3401
-
3402
- protected
3403
-
3404
- # @return [Boolean]
3405
- #
3406
- # source://thor//lib/thor/shell/color.rb#107
3407
- def are_colors_disabled?; end
3408
-
3409
- # @return [Boolean]
3410
- #
3411
- # source://thor//lib/thor/shell/color.rb#103
3412
- def are_colors_supported?; end
3413
-
3414
- # @return [Boolean]
3415
- #
3416
- # source://thor//lib/thor/shell/color.rb#99
3417
- def can_display_colors?; end
3418
-
3419
- # Check if Diff::LCS is loaded. If it is, use it to create pretty output
3420
- # for diff.
3421
- #
3422
- # @return [Boolean]
3423
- #
3424
- # source://thor//lib/thor/shell/color.rb#144
3425
- def diff_lcs_loaded?; end
3426
-
3427
- # source://thor//lib/thor/shell/color.rb#127
3428
- def output_diff_line(diff); end
3429
-
3430
- # Overwrite show_diff to show diff with colors if Diff::LCS is
3431
- # available.
3432
- #
3433
- # source://thor//lib/thor/shell/color.rb#114
3434
- def show_diff(destination, content); end
3435
- end
3436
-
3437
- # Set the terminal's foreground ANSI color to black.
3438
- #
3439
- # source://thor//lib/thor/shell/color.rb#15
3440
- Thor::Shell::Color::BLACK = T.let(T.unsafe(nil), String)
3441
-
3442
- # Set the terminal's foreground ANSI color to blue.
3443
- #
3444
- # source://thor//lib/thor/shell/color.rb#23
3445
- Thor::Shell::Color::BLUE = T.let(T.unsafe(nil), String)
3446
-
3447
- # The start of an ANSI bold sequence.
3448
- #
3449
- # source://thor//lib/thor/shell/color.rb#12
3450
- Thor::Shell::Color::BOLD = T.let(T.unsafe(nil), String)
3451
-
3452
- # Embed in a String to clear all previous ANSI sequences.
3453
- #
3454
- # source://thor//lib/thor/shell/color.rb#10
3455
- Thor::Shell::Color::CLEAR = T.let(T.unsafe(nil), String)
3456
-
3457
- # Set the terminal's foreground ANSI color to cyan.
3458
- #
3459
- # source://thor//lib/thor/shell/color.rb#27
3460
- Thor::Shell::Color::CYAN = T.let(T.unsafe(nil), String)
3461
-
3462
- # Set the terminal's foreground ANSI color to green.
3463
- #
3464
- # source://thor//lib/thor/shell/color.rb#19
3465
- Thor::Shell::Color::GREEN = T.let(T.unsafe(nil), String)
3466
-
3467
- # Set the terminal's foreground ANSI color to magenta.
3468
- #
3469
- # source://thor//lib/thor/shell/color.rb#25
3470
- Thor::Shell::Color::MAGENTA = T.let(T.unsafe(nil), String)
3471
-
3472
- # Set the terminal's background ANSI color to black.
3473
- #
3474
- # source://thor//lib/thor/shell/color.rb#32
3475
- Thor::Shell::Color::ON_BLACK = T.let(T.unsafe(nil), String)
3476
-
3477
- # Set the terminal's background ANSI color to blue.
3478
- #
3479
- # source://thor//lib/thor/shell/color.rb#40
3480
- Thor::Shell::Color::ON_BLUE = T.let(T.unsafe(nil), String)
3481
-
3482
- # Set the terminal's background ANSI color to cyan.
3483
- #
3484
- # source://thor//lib/thor/shell/color.rb#44
3485
- Thor::Shell::Color::ON_CYAN = T.let(T.unsafe(nil), String)
3486
-
3487
- # Set the terminal's background ANSI color to green.
3488
- #
3489
- # source://thor//lib/thor/shell/color.rb#36
3490
- Thor::Shell::Color::ON_GREEN = T.let(T.unsafe(nil), String)
3491
-
3492
- # Set the terminal's background ANSI color to magenta.
3493
- #
3494
- # source://thor//lib/thor/shell/color.rb#42
3495
- Thor::Shell::Color::ON_MAGENTA = T.let(T.unsafe(nil), String)
3496
-
3497
- # Set the terminal's background ANSI color to red.
3498
- #
3499
- # source://thor//lib/thor/shell/color.rb#34
3500
- Thor::Shell::Color::ON_RED = T.let(T.unsafe(nil), String)
3501
-
3502
- # Set the terminal's background ANSI color to white.
3503
- #
3504
- # source://thor//lib/thor/shell/color.rb#46
3505
- Thor::Shell::Color::ON_WHITE = T.let(T.unsafe(nil), String)
3506
-
3507
- # Set the terminal's background ANSI color to yellow.
3508
- #
3509
- # source://thor//lib/thor/shell/color.rb#38
3510
- Thor::Shell::Color::ON_YELLOW = T.let(T.unsafe(nil), String)
3511
-
3512
- # Set the terminal's foreground ANSI color to red.
3513
- #
3514
- # source://thor//lib/thor/shell/color.rb#17
3515
- Thor::Shell::Color::RED = T.let(T.unsafe(nil), String)
3516
-
3517
- # Set the terminal's foreground ANSI color to white.
3518
- #
3519
- # source://thor//lib/thor/shell/color.rb#29
3520
- Thor::Shell::Color::WHITE = T.let(T.unsafe(nil), String)
3521
-
3522
- # Set the terminal's foreground ANSI color to yellow.
3523
- #
3524
- # source://thor//lib/thor/shell/color.rb#21
3525
- Thor::Shell::Color::YELLOW = T.let(T.unsafe(nil), String)
3526
-
3527
- # Inherit from Thor::Shell::Basic and add set_color behavior. Check
3528
- # Thor::Shell::Basic to see all available methods.
3529
- class Thor::Shell::HTML < ::Thor::Shell::Basic
3530
- # Ask something to the user and receives a response.
3531
- #
3532
- # ==== Example
3533
- # ask("What is your name?")
3534
- #
3535
- # TODO: Implement #ask for Thor::Shell::HTML
3536
- #
3537
- # @raise [NotImplementedError]
3538
- #
3539
- # source://thor//lib/thor/shell/html.rb#70
3540
- def ask(statement, color = T.unsafe(nil)); end
3541
-
3542
- # Set color by using a string or one of the defined constants. If a third
3543
- # option is set to true, it also adds bold to the string. This is based
3544
- # on Highline implementation and it automatically appends CLEAR to the end
3545
- # of the returned String.
3546
- #
3547
- # source://thor//lib/thor/shell/html.rb#51
3548
- def set_color(string, *colors); end
3549
-
3550
- protected
3551
-
3552
- # @return [Boolean]
3553
- #
3554
- # source://thor//lib/thor/shell/html.rb#76
3555
- def can_display_colors?; end
3556
-
3557
- # Check if Diff::LCS is loaded. If it is, use it to create pretty output
3558
- # for diff.
3559
- #
3560
- # @return [Boolean]
3561
- #
3562
- # source://thor//lib/thor/shell/html.rb#113
3563
- def diff_lcs_loaded?; end
3564
-
3565
- # source://thor//lib/thor/shell/html.rb#96
3566
- def output_diff_line(diff); end
3567
-
3568
- # Overwrite show_diff to show diff with colors if Diff::LCS is
3569
- # available.
3570
- #
3571
- # source://thor//lib/thor/shell/html.rb#83
3572
- def show_diff(destination, content); end
3573
- end
3574
-
3575
- # Set the terminal's foreground HTML color to black.
3576
- #
3577
- # source://thor//lib/thor/shell/html.rb#13
3578
- Thor::Shell::HTML::BLACK = T.let(T.unsafe(nil), String)
3579
-
3580
- # Set the terminal's foreground HTML color to blue.
3581
- #
3582
- # source://thor//lib/thor/shell/html.rb#21
3583
- Thor::Shell::HTML::BLUE = T.let(T.unsafe(nil), String)
3584
-
3585
- # The start of an HTML bold sequence.
3586
- #
3587
- # source://thor//lib/thor/shell/html.rb#10
3588
- Thor::Shell::HTML::BOLD = T.let(T.unsafe(nil), String)
3589
-
3590
- # Set the terminal's foreground HTML color to cyan.
3591
- #
3592
- # source://thor//lib/thor/shell/html.rb#25
3593
- Thor::Shell::HTML::CYAN = T.let(T.unsafe(nil), String)
3594
-
3595
- # Set the terminal's foreground HTML color to green.
3596
- #
3597
- # source://thor//lib/thor/shell/html.rb#17
3598
- Thor::Shell::HTML::GREEN = T.let(T.unsafe(nil), String)
3599
-
3600
- # Set the terminal's foreground HTML color to magenta.
3601
- #
3602
- # source://thor//lib/thor/shell/html.rb#23
3603
- Thor::Shell::HTML::MAGENTA = T.let(T.unsafe(nil), String)
3604
-
3605
- # Set the terminal's background HTML color to black.
3606
- #
3607
- # source://thor//lib/thor/shell/html.rb#30
3608
- Thor::Shell::HTML::ON_BLACK = T.let(T.unsafe(nil), String)
3609
-
3610
- # Set the terminal's background HTML color to blue.
3611
- #
3612
- # source://thor//lib/thor/shell/html.rb#38
3613
- Thor::Shell::HTML::ON_BLUE = T.let(T.unsafe(nil), String)
3614
-
3615
- # Set the terminal's background HTML color to cyan.
3616
- #
3617
- # source://thor//lib/thor/shell/html.rb#42
3618
- Thor::Shell::HTML::ON_CYAN = T.let(T.unsafe(nil), String)
3619
-
3620
- # Set the terminal's background HTML color to green.
3621
- #
3622
- # source://thor//lib/thor/shell/html.rb#34
3623
- Thor::Shell::HTML::ON_GREEN = T.let(T.unsafe(nil), String)
3624
-
3625
- # Set the terminal's background HTML color to magenta.
3626
- #
3627
- # source://thor//lib/thor/shell/html.rb#40
3628
- Thor::Shell::HTML::ON_MAGENTA = T.let(T.unsafe(nil), String)
3629
-
3630
- # Set the terminal's background HTML color to red.
3631
- #
3632
- # source://thor//lib/thor/shell/html.rb#32
3633
- Thor::Shell::HTML::ON_RED = T.let(T.unsafe(nil), String)
3634
-
3635
- # Set the terminal's background HTML color to white.
3636
- #
3637
- # source://thor//lib/thor/shell/html.rb#44
3638
- Thor::Shell::HTML::ON_WHITE = T.let(T.unsafe(nil), String)
3639
-
3640
- # Set the terminal's background HTML color to yellow.
3641
- #
3642
- # source://thor//lib/thor/shell/html.rb#36
3643
- Thor::Shell::HTML::ON_YELLOW = T.let(T.unsafe(nil), String)
3644
-
3645
- # Set the terminal's foreground HTML color to red.
3646
- #
3647
- # source://thor//lib/thor/shell/html.rb#15
3648
- Thor::Shell::HTML::RED = T.let(T.unsafe(nil), String)
3649
-
3650
- # Set the terminal's foreground HTML color to white.
3651
- #
3652
- # source://thor//lib/thor/shell/html.rb#27
3653
- Thor::Shell::HTML::WHITE = T.let(T.unsafe(nil), String)
3654
-
3655
- # Set the terminal's foreground HTML color to yellow.
3656
- #
3657
- # source://thor//lib/thor/shell/html.rb#19
3658
- Thor::Shell::HTML::YELLOW = T.let(T.unsafe(nil), String)
3659
-
3660
- # source://thor//lib/thor/shell.rb#24
3661
- Thor::Shell::SHELL_DELEGATED_METHODS = T.let(T.unsafe(nil), Array)
3662
-
3663
- # source://thor//lib/thor/base.rb#23
3664
- Thor::TEMPLATE_EXTNAME = T.let(T.unsafe(nil), String)
3665
-
3666
- # Thor methods that should not be overwritten by the user.
3667
- #
3668
- # source://thor//lib/thor/base.rb#20
3669
- Thor::THOR_RESERVED_WORDS = T.let(T.unsafe(nil), Array)
3670
-
3671
- # source://thor//lib/thor/command.rb#117
3672
- Thor::Task = Thor::Command
3673
-
3674
- # Raised when a command was not found.
3675
- #
3676
- # source://thor//lib/thor/error.rb#27
3677
- class Thor::UndefinedCommandError < ::Thor::Error
3678
- include ::DidYouMean::Correctable
3679
-
3680
- # @return [UndefinedCommandError] a new instance of UndefinedCommandError
3681
- #
3682
- # source://thor//lib/thor/error.rb#46
3683
- def initialize(command, all_commands, namespace); end
3684
-
3685
- # Returns the value of attribute all_commands.
3686
- #
3687
- # source://thor//lib/thor/error.rb#44
3688
- def all_commands; end
3689
-
3690
- # Returns the value of attribute command.
3691
- #
3692
- # source://thor//lib/thor/error.rb#44
3693
- def command; end
3694
- end
3695
-
3696
- # source://thor//lib/thor/error.rb#28
3697
- class Thor::UndefinedCommandError::SpellChecker
3698
- # @return [SpellChecker] a new instance of SpellChecker
3699
- #
3700
- # source://thor//lib/thor/error.rb#31
3701
- def initialize(error); end
3702
-
3703
- # source://thor//lib/thor/error.rb#35
3704
- def corrections; end
3705
-
3706
- # Returns the value of attribute error.
3707
- #
3708
- # source://thor//lib/thor/error.rb#29
3709
- def error; end
3710
-
3711
- # source://thor//lib/thor/error.rb#39
3712
- def spell_checker; end
3713
- end
3714
-
3715
- # source://thor//lib/thor/error.rb#58
3716
- Thor::UndefinedTaskError = Thor::UndefinedCommandError
3717
-
3718
- # source://thor//lib/thor/error.rb#68
3719
- class Thor::UnknownArgumentError < ::Thor::Error
3720
- include ::DidYouMean::Correctable
3721
-
3722
- # @return [UnknownArgumentError] a new instance of UnknownArgumentError
3723
- #
3724
- # source://thor//lib/thor/error.rb#88
3725
- def initialize(switches, unknown); end
3726
-
3727
- # Returns the value of attribute switches.
3728
- #
3729
- # source://thor//lib/thor/error.rb#86
3730
- def switches; end
3731
-
3732
- # Returns the value of attribute unknown.
3733
- #
3734
- # source://thor//lib/thor/error.rb#86
3735
- def unknown; end
3736
- end
3737
-
3738
- # source://thor//lib/thor/error.rb#69
3739
- class Thor::UnknownArgumentError::SpellChecker
3740
- # @return [SpellChecker] a new instance of SpellChecker
3741
- #
3742
- # source://thor//lib/thor/error.rb#72
3743
- def initialize(error); end
3744
-
3745
- # source://thor//lib/thor/error.rb#76
3746
- def corrections; end
3747
-
3748
- # Returns the value of attribute error.
3749
- #
3750
- # source://thor//lib/thor/error.rb#70
3751
- def error; end
3752
-
3753
- # source://thor//lib/thor/error.rb#81
3754
- def spell_checker; end
3755
- end
3756
-
3757
- # This module holds several utilities:
3758
- #
3759
- # 1) Methods to convert thor namespaces to constants and vice-versa.
3760
- #
3761
- # Thor::Util.namespace_from_thor_class(Foo::Bar::Baz) #=> "foo:bar:baz"
3762
- #
3763
- # 2) Loading thor files and sandboxing:
3764
- #
3765
- # Thor::Util.load_thorfile("~/.thor/foo")
3766
- #
3767
- # source://thor//lib/thor/util.rb#17
3768
- module Thor::Util
3769
- class << self
3770
- # Receives a string and convert it to camel case. camel_case returns CamelCase.
3771
- #
3772
- # ==== Parameters
3773
- # String
3774
- #
3775
- # ==== Returns
3776
- # String
3777
- #
3778
- # source://thor//lib/thor/util.rb#104
3779
- def camel_case(str); end
3780
-
3781
- # Returns a string that has had any glob characters escaped.
3782
- # The glob characters are `* ? { } [ ]`.
3783
- #
3784
- # ==== Examples
3785
- #
3786
- # Thor::Util.escape_globs('[apps]') # => '\[apps\]'
3787
- #
3788
- # ==== Parameters
3789
- # String
3790
- #
3791
- # ==== Returns
3792
- # String
3793
- #
3794
- # source://thor//lib/thor/util.rb#263
3795
- def escape_globs(path); end
3796
-
3797
- # Returns a string that has had any HTML characters escaped.
3798
- #
3799
- # ==== Examples
3800
- #
3801
- # Thor::Util.escape_html('<div>') # => "&lt;div&gt;"
3802
- #
3803
- # ==== Parameters
3804
- # String
3805
- #
3806
- # ==== Returns
3807
- # String
3808
- #
3809
- # source://thor//lib/thor/util.rb#279
3810
- def escape_html(string); end
3811
-
3812
- # Receives a namespace and search for it in the Thor::Base subclasses.
3813
- #
3814
- # ==== Parameters
3815
- # namespace<String>:: The namespace to search for.
3816
- #
3817
- # source://thor//lib/thor/util.rb#24
3818
- def find_by_namespace(namespace); end
3819
-
3820
- # Receives a namespace and tries to retrieve a Thor or Thor::Group class
3821
- # from it. It first searches for a class using the all the given namespace,
3822
- # if it's not found, removes the highest entry and searches for the class
3823
- # again. If found, returns the highest entry as the class name.
3824
- #
3825
- # ==== Examples
3826
- #
3827
- # class Foo::Bar < Thor
3828
- # def baz
3829
- # end
3830
- # end
3831
- #
3832
- # class Baz::Foo < Thor::Group
3833
- # end
3834
- #
3835
- # Thor::Util.namespace_to_thor_class("foo:bar") #=> Foo::Bar, nil # will invoke default command
3836
- # Thor::Util.namespace_to_thor_class("baz:foo") #=> Baz::Foo, nil
3837
- # Thor::Util.namespace_to_thor_class("foo:bar:baz") #=> Foo::Bar, "baz"
3838
- #
3839
- # ==== Parameters
3840
- # namespace<String>
3841
- #
3842
- # source://thor//lib/thor/util.rb#131
3843
- def find_class_and_command_by_namespace(namespace, fallback = T.unsafe(nil)); end
3844
-
3845
- # Receives a namespace and tries to retrieve a Thor or Thor::Group class
3846
- # from it. It first searches for a class using the all the given namespace,
3847
- # if it's not found, removes the highest entry and searches for the class
3848
- # again. If found, returns the highest entry as the class name.
3849
- #
3850
- # ==== Examples
3851
- #
3852
- # class Foo::Bar < Thor
3853
- # def baz
3854
- # end
3855
- # end
3856
- #
3857
- # class Baz::Foo < Thor::Group
3858
- # end
3859
- #
3860
- # Thor::Util.namespace_to_thor_class("foo:bar") #=> Foo::Bar, nil # will invoke default command
3861
- # Thor::Util.namespace_to_thor_class("baz:foo") #=> Baz::Foo, nil
3862
- # Thor::Util.namespace_to_thor_class("foo:bar:baz") #=> Foo::Bar, "baz"
3863
- #
3864
- # ==== Parameters
3865
- # namespace<String>
3866
- #
3867
- # source://thor//lib/thor/util.rb#131
3868
- def find_class_and_task_by_namespace(namespace, fallback = T.unsafe(nil)); end
3869
-
3870
- # Where to look for Thor files.
3871
- #
3872
- # source://thor//lib/thor/util.rb#212
3873
- def globs_for(path); end
3874
-
3875
- # Receives a path and load the thor file in the path. The file is evaluated
3876
- # inside the sandbox to avoid namespacing conflicts.
3877
- #
3878
- # source://thor//lib/thor/util.rb#152
3879
- def load_thorfile(path, content = T.unsafe(nil), debug = T.unsafe(nil)); end
3880
-
3881
- # Receives a constant and converts it to a Thor namespace. Since Thor
3882
- # commands can be added to a sandbox, this method is also responsible for
3883
- # removing the sandbox namespace.
3884
- #
3885
- # This method should not be used in general because it's used to deal with
3886
- # older versions of Thor. On current versions, if you need to get the
3887
- # namespace from a class, just call namespace on it.
3888
- #
3889
- # ==== Parameters
3890
- # constant<Object>:: The constant to be converted to the thor path.
3891
- #
3892
- # ==== Returns
3893
- # String:: If we receive Foo::Bar::Baz it returns "foo:bar:baz"
3894
- #
3895
- # source://thor//lib/thor/util.rb#43
3896
- def namespace_from_thor_class(constant); end
3897
-
3898
- # Given the contents, evaluate it inside the sandbox and returns the
3899
- # namespaces defined in the sandbox.
3900
- #
3901
- # ==== Parameters
3902
- # contents<String>
3903
- #
3904
- # ==== Returns
3905
- # Array[Object]
3906
- #
3907
- # source://thor//lib/thor/util.rb#58
3908
- def namespaces_in_content(contents, file = T.unsafe(nil)); end
3909
-
3910
- # Return the path to the ruby interpreter taking into account multiple
3911
- # installations and windows extensions.
3912
- #
3913
- # source://thor//lib/thor/util.rb#220
3914
- def ruby_command; end
3915
-
3916
- # Receives a string and convert it to snake case. SnakeCase returns snake_case.
3917
- #
3918
- # ==== Parameters
3919
- # String
3920
- #
3921
- # ==== Returns
3922
- # String
3923
- #
3924
- # source://thor//lib/thor/util.rb#90
3925
- def snake_case(str); end
3926
-
3927
- # Returns the thor classes declared inside the given class.
3928
- #
3929
- # source://thor//lib/thor/util.rb#74
3930
- def thor_classes_in(klass); end
3931
-
3932
- # Returns the root where thor files are located, depending on the OS.
3933
- #
3934
- # source://thor//lib/thor/util.rb#191
3935
- def thor_root; end
3936
-
3937
- # Returns the files in the thor root. On Windows thor_root will be something
3938
- # like this:
3939
- #
3940
- # C:\Documents and Settings\james\.thor
3941
- #
3942
- # If we don't #gsub the \ character, Dir.glob will fail.
3943
- #
3944
- # source://thor//lib/thor/util.rb#202
3945
- def thor_root_glob; end
3946
-
3947
- # source://thor//lib/thor/util.rb#167
3948
- def user_home; end
3949
- end
3950
- end