danger-packwerk 0.14.0 → 0.14.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/danger-packwerk/version.rb +1 -1
- metadata +2 -88
- data/sorbet/config +0 -4
- data/sorbet/rbi/gems/actionview@7.0.4.rbi +0 -11543
- data/sorbet/rbi/gems/activesupport@7.0.4.rbi +0 -12959
- data/sorbet/rbi/gems/addressable@2.8.1.rbi +0 -1505
- data/sorbet/rbi/gems/ast@2.4.2.rbi +0 -522
- data/sorbet/rbi/gems/better_html@2.0.1.rbi +0 -286
- data/sorbet/rbi/gems/builder@3.2.4.rbi +0 -8
- data/sorbet/rbi/gems/claide-plugins@0.9.2.rbi +0 -791
- data/sorbet/rbi/gems/claide@1.1.0.rbi +0 -1132
- data/sorbet/rbi/gems/code_ownership@1.29.2.rbi +0 -525
- data/sorbet/rbi/gems/code_teams@1.0.0.rbi +0 -120
- data/sorbet/rbi/gems/coderay@1.1.3.rbi +0 -2256
- data/sorbet/rbi/gems/colored2@3.1.2.rbi +0 -130
- data/sorbet/rbi/gems/concurrent-ruby@1.1.10.rbi +0 -8695
- data/sorbet/rbi/gems/constant_resolver@0.2.0.rbi +0 -30
- data/sorbet/rbi/gems/cork@0.3.0.rbi +0 -248
- data/sorbet/rbi/gems/crass@1.0.6.rbi +0 -436
- data/sorbet/rbi/gems/danger-plugin-api@1.0.0.rbi +0 -8
- data/sorbet/rbi/gems/danger@9.0.0.rbi +0 -4722
- data/sorbet/rbi/gems/diff-lcs@1.5.0.rbi +0 -862
- data/sorbet/rbi/gems/erubi@1.11.0.rbi +0 -102
- data/sorbet/rbi/gems/faraday-em_http@1.0.0.rbi +0 -266
- data/sorbet/rbi/gems/faraday-em_synchrony@1.0.0.rbi +0 -209
- data/sorbet/rbi/gems/faraday-excon@1.1.0.rbi +0 -212
- data/sorbet/rbi/gems/faraday-http-cache@2.4.1.rbi +0 -805
- data/sorbet/rbi/gems/faraday-httpclient@1.0.1.rbi +0 -221
- data/sorbet/rbi/gems/faraday-multipart@1.0.4.rbi +0 -266
- data/sorbet/rbi/gems/faraday-net_http@1.0.1.rbi +0 -216
- data/sorbet/rbi/gems/faraday-net_http_persistent@1.2.0.rbi +0 -206
- data/sorbet/rbi/gems/faraday-patron@1.0.0.rbi +0 -212
- data/sorbet/rbi/gems/faraday-rack@1.0.0.rbi +0 -225
- data/sorbet/rbi/gems/faraday-retry@1.0.3.rbi +0 -222
- data/sorbet/rbi/gems/faraday@1.10.2.rbi +0 -1862
- data/sorbet/rbi/gems/git@1.12.0.rbi +0 -1936
- data/sorbet/rbi/gems/i18n@1.12.0.rbi +0 -1643
- data/sorbet/rbi/gems/kramdown-parser-gfm@1.1.0.rbi +0 -8
- data/sorbet/rbi/gems/kramdown@2.4.0.rbi +0 -2168
- data/sorbet/rbi/gems/loofah@2.19.0.rbi +0 -646
- data/sorbet/rbi/gems/method_source@1.0.0.rbi +0 -199
- data/sorbet/rbi/gems/minitest@5.16.3.rbi +0 -997
- data/sorbet/rbi/gems/multipart-post@2.2.3.rbi +0 -165
- data/sorbet/rbi/gems/nap@1.1.0.rbi +0 -351
- data/sorbet/rbi/gems/no_proxy_fix@0.1.2.rbi +0 -8
- data/sorbet/rbi/gems/nokogiri@1.13.8.rbi +0 -4916
- data/sorbet/rbi/gems/octokit@5.6.1.rbi +0 -8939
- data/sorbet/rbi/gems/open4@1.3.4.rbi +0 -8
- data/sorbet/rbi/gems/packs@0.0.5.rbi +0 -111
- data/sorbet/rbi/gems/packwerk@2.2.1-e998ef65194de398f0baaf03a0ba33390b30351e.rbi +0 -2161
- data/sorbet/rbi/gems/parallel@1.22.1.rbi +0 -163
- data/sorbet/rbi/gems/parse_packwerk@0.18.0.rbi +0 -225
- data/sorbet/rbi/gems/parser@3.1.2.1.rbi +0 -5988
- data/sorbet/rbi/gems/pry@0.14.1.rbi +0 -6969
- data/sorbet/rbi/gems/public_suffix@5.0.0.rbi +0 -779
- data/sorbet/rbi/gems/racc@1.6.0.rbi +0 -92
- data/sorbet/rbi/gems/rails-dom-testing@2.0.3.rbi +0 -8
- data/sorbet/rbi/gems/rails-html-sanitizer@1.4.3.rbi +0 -493
- data/sorbet/rbi/gems/rainbow@3.1.1.rbi +0 -227
- data/sorbet/rbi/gems/rake@13.0.6.rbi +0 -1865
- data/sorbet/rbi/gems/rbi@0.0.14.rbi +0 -2337
- data/sorbet/rbi/gems/rchardet@1.8.0.rbi +0 -587
- data/sorbet/rbi/gems/regexp_parser@2.5.0.rbi +0 -1851
- data/sorbet/rbi/gems/rexml@3.2.5.rbi +0 -3852
- data/sorbet/rbi/gems/rspec-core@3.11.0.rbi +0 -7725
- data/sorbet/rbi/gems/rspec-expectations@3.11.0.rbi +0 -6201
- data/sorbet/rbi/gems/rspec-mocks@3.11.1.rbi +0 -3625
- data/sorbet/rbi/gems/rspec-support@3.11.0.rbi +0 -1176
- data/sorbet/rbi/gems/rspec@3.11.0.rbi +0 -40
- data/sorbet/rbi/gems/rubocop-ast@1.21.0.rbi +0 -4193
- data/sorbet/rbi/gems/rubocop-sorbet@0.6.8.rbi +0 -677
- data/sorbet/rbi/gems/rubocop@1.36.0.rbi +0 -37914
- data/sorbet/rbi/gems/ruby-progressbar@1.11.0.rbi +0 -732
- data/sorbet/rbi/gems/ruby2_keywords@0.0.5.rbi +0 -8
- data/sorbet/rbi/gems/sawyer@0.9.2.rbi +0 -513
- data/sorbet/rbi/gems/smart_properties@1.17.0.rbi +0 -326
- data/sorbet/rbi/gems/spoom@1.1.11.rbi +0 -1600
- data/sorbet/rbi/gems/tapioca@0.8.0.rbi +0 -1959
- data/sorbet/rbi/gems/terminal-table@3.0.2.rbi +0 -438
- data/sorbet/rbi/gems/thor@1.2.1.rbi +0 -2921
- data/sorbet/rbi/gems/tzinfo@2.0.5.rbi +0 -4879
- data/sorbet/rbi/gems/unicode-display_width@2.3.0.rbi +0 -27
- data/sorbet/rbi/gems/unparser@0.6.5.rbi +0 -2789
- data/sorbet/rbi/gems/webrick@1.7.0.rbi +0 -1802
- data/sorbet/rbi/gems/yard-sorbet@0.6.1.rbi +0 -288
- data/sorbet/rbi/gems/yard@0.9.27.rbi +0 -12668
- data/sorbet/rbi/todo.rbi +0 -125
- data/sorbet/tapioca/require.rb +0 -4
@@ -1,791 +0,0 @@
|
|
1
|
-
# typed: true
|
2
|
-
|
3
|
-
# DO NOT EDIT MANUALLY
|
4
|
-
# This is an autogenerated file for types exported from the `claide-plugins` gem.
|
5
|
-
# Please instead update this file by running `bin/tapioca gem claide-plugins`.
|
6
|
-
|
7
|
-
# The mods of interest are {CLAide::ARGV}, {CLAide::Command}, and
|
8
|
-
# {CLAide::InformativeError}
|
9
|
-
module CLAide; end
|
10
|
-
|
11
|
-
# This class is used to build a command-line interface
|
12
|
-
#
|
13
|
-
# Each command is represented by a subclass of this class, which may be
|
14
|
-
# nested to create more granular commands.
|
15
|
-
#
|
16
|
-
# Following is an overview of the types of commands and what they should do.
|
17
|
-
#
|
18
|
-
# ### Any command type
|
19
|
-
#
|
20
|
-
# * Inherit from the command class under which the command should be nested.
|
21
|
-
# * Set {Command.summary} to a brief description of the command.
|
22
|
-
# * Override {Command.options} to return the options it handles and their
|
23
|
-
# descriptions and prepending them to the results of calling `super`.
|
24
|
-
# * Override {Command#initialize} if it handles any parameters.
|
25
|
-
# * Override {Command#validate!} to check if the required parameters the
|
26
|
-
# command handles are valid, or call {Command#help!} in case they’re not.
|
27
|
-
#
|
28
|
-
# ### Abstract command
|
29
|
-
#
|
30
|
-
# The following is needed for an abstract command:
|
31
|
-
#
|
32
|
-
# * Set {Command.abstract_command} to `true`.
|
33
|
-
# * Subclass the command.
|
34
|
-
#
|
35
|
-
# When the optional {Command.description} is specified, it will be shown at
|
36
|
-
# the top of the command’s help banner.
|
37
|
-
#
|
38
|
-
# ### Normal command
|
39
|
-
#
|
40
|
-
# The following is needed for a normal command:
|
41
|
-
#
|
42
|
-
# * Set {Command.arguments} to the description of the arguments this command
|
43
|
-
# handles.
|
44
|
-
# * Override {Command#run} to perform the actual work.
|
45
|
-
#
|
46
|
-
# When the optional {Command.description} is specified, it will be shown
|
47
|
-
# underneath the usage section of the command’s help banner. Otherwise this
|
48
|
-
# defaults to {Command.summary}.
|
49
|
-
class CLAide::Command
|
50
|
-
# Subclasses should override this method to remove the arguments/options
|
51
|
-
# they support from `argv` _before_ calling `super`.
|
52
|
-
#
|
53
|
-
# The `super` implementation sets the {#verbose} attribute based on whether
|
54
|
-
# or not the `--verbose` option is specified; and the {#ansi_output}
|
55
|
-
# attribute to `false` if {Command.ansi_output} returns `true`, but the
|
56
|
-
# user specified the `--no-ansi` option.
|
57
|
-
#
|
58
|
-
# @param argv [ARGV, Array] A list of (user-supplied) params that should be handled.
|
59
|
-
# @return [Command] a new instance of Command
|
60
|
-
def initialize(argv); end
|
61
|
-
|
62
|
-
# Set to `true` if {Command.ansi_output} returns `true` and the user
|
63
|
-
# did **not** specify the `--no-ansi` option.
|
64
|
-
#
|
65
|
-
# @note If you want to make use of this value for your own configuration, you
|
66
|
-
# should check the value _after_ calling the `super` {Command#initialize}
|
67
|
-
# implementation.
|
68
|
-
# @return [Boolean] Whether or not to use ANSI codes to prettify output. For instance, by
|
69
|
-
# default {InformativeError} exception messages will be colored red and
|
70
|
-
# subcommands in help banners green.
|
71
|
-
def ansi_output; end
|
72
|
-
|
73
|
-
# Set to `true` if {Command.ansi_output} returns `true` and the user
|
74
|
-
# did **not** specify the `--no-ansi` option.
|
75
|
-
#
|
76
|
-
# @note If you want to make use of this value for your own configuration, you
|
77
|
-
# should check the value _after_ calling the `super` {Command#initialize}
|
78
|
-
# implementation.
|
79
|
-
# @return [Boolean] Whether or not to use ANSI codes to prettify output. For instance, by
|
80
|
-
# default {InformativeError} exception messages will be colored red and
|
81
|
-
# subcommands in help banners green.
|
82
|
-
def ansi_output=(_arg0); end
|
83
|
-
|
84
|
-
# Set to `true` if {Command.ansi_output} returns `true` and the user
|
85
|
-
# did **not** specify the `--no-ansi` option.
|
86
|
-
#
|
87
|
-
# @note If you want to make use of this value for your own configuration, you
|
88
|
-
# should check the value _after_ calling the `super` {Command#initialize}
|
89
|
-
# implementation.
|
90
|
-
# @return [Boolean] Whether or not to use ANSI codes to prettify output. For instance, by
|
91
|
-
# default {InformativeError} exception messages will be colored red and
|
92
|
-
# subcommands in help banners green.
|
93
|
-
def ansi_output?; end
|
94
|
-
|
95
|
-
# Handles root commands options if appropriate.
|
96
|
-
#
|
97
|
-
# @param argv [ARGV] The parameters of the command.
|
98
|
-
# @return [Bool] Whether any root command option was handled.
|
99
|
-
def handle_root_options(argv); end
|
100
|
-
|
101
|
-
# Set to `true` if initialized with a `--help` flag
|
102
|
-
#
|
103
|
-
# @return [Boolean] Whether the command was initialized with argv containing --help
|
104
|
-
def help?; end
|
105
|
-
|
106
|
-
# Set to `true` if initialized with a `--help` flag
|
107
|
-
#
|
108
|
-
# @return [Boolean] Whether the command was initialized with argv containing --help
|
109
|
-
def help_arg; end
|
110
|
-
|
111
|
-
# Set to `true` if initialized with a `--help` flag
|
112
|
-
#
|
113
|
-
# @return [Boolean] Whether the command was initialized with argv containing --help
|
114
|
-
def help_arg=(_arg0); end
|
115
|
-
|
116
|
-
# @return [Bool] Whether the command was invoked by an abstract command by
|
117
|
-
# default.
|
118
|
-
def invoked_as_default; end
|
119
|
-
|
120
|
-
# @return [Bool] Whether the command was invoked by an abstract command by
|
121
|
-
# default.
|
122
|
-
def invoked_as_default=(_arg0); end
|
123
|
-
|
124
|
-
# @return [Bool] Whether the command was invoked by an abstract command by
|
125
|
-
# default.
|
126
|
-
def invoked_as_default?; end
|
127
|
-
|
128
|
-
# Prints the version of the command optionally including plugins.
|
129
|
-
def print_version; end
|
130
|
-
|
131
|
-
# This method should be overridden by the command class to perform its
|
132
|
-
# work.
|
133
|
-
#
|
134
|
-
# @return [void]
|
135
|
-
def run; end
|
136
|
-
|
137
|
-
# Raises a Help exception if the `--help` option is specified, if `argv`
|
138
|
-
# still contains remaining arguments/options by the time it reaches this
|
139
|
-
# implementation, or when called on an ‘abstract command’.
|
140
|
-
#
|
141
|
-
# Subclasses should call `super` _before_ doing their own validation. This
|
142
|
-
# way when the user specifies the `--help` flag a help banner is shown,
|
143
|
-
# instead of possible actual validation errors.
|
144
|
-
#
|
145
|
-
# @raise [Help]
|
146
|
-
# @return [void]
|
147
|
-
def validate!; end
|
148
|
-
|
149
|
-
# Set to `true` if the user specifies the `--verbose` option.
|
150
|
-
#
|
151
|
-
# @note If you want to make use of this value for your own configuration, you
|
152
|
-
# should check the value _after_ calling the `super` {Command#initialize}
|
153
|
-
# implementation.
|
154
|
-
# @return [Boolean] Wether or not backtraces should be included when presenting the user an
|
155
|
-
# exception that includes the {InformativeError} module.
|
156
|
-
def verbose; end
|
157
|
-
|
158
|
-
# Set to `true` if the user specifies the `--verbose` option.
|
159
|
-
#
|
160
|
-
# @note If you want to make use of this value for your own configuration, you
|
161
|
-
# should check the value _after_ calling the `super` {Command#initialize}
|
162
|
-
# implementation.
|
163
|
-
# @return [Boolean] Wether or not backtraces should be included when presenting the user an
|
164
|
-
# exception that includes the {InformativeError} module.
|
165
|
-
def verbose=(_arg0); end
|
166
|
-
|
167
|
-
# Set to `true` if the user specifies the `--verbose` option.
|
168
|
-
#
|
169
|
-
# @note If you want to make use of this value for your own configuration, you
|
170
|
-
# should check the value _after_ calling the `super` {Command#initialize}
|
171
|
-
# implementation.
|
172
|
-
# @return [Boolean] Wether or not backtraces should be included when presenting the user an
|
173
|
-
# exception that includes the {InformativeError} module.
|
174
|
-
def verbose?; end
|
175
|
-
|
176
|
-
protected
|
177
|
-
|
178
|
-
# Print banner and exit
|
179
|
-
#
|
180
|
-
# @note Calling this method exits the current process.
|
181
|
-
# @return [void]
|
182
|
-
def banner!; end
|
183
|
-
|
184
|
-
# @param error_message [String] A custom optional error message
|
185
|
-
# @raise [Help] Signals CLAide that a help banner for this command should be shown,
|
186
|
-
# with an optional error message.
|
187
|
-
# @return [void]
|
188
|
-
def help!(error_message = T.unsafe(nil)); end
|
189
|
-
|
190
|
-
# Returns the class of the invoked command
|
191
|
-
#
|
192
|
-
# @return [Command]
|
193
|
-
def invoked_command_class; end
|
194
|
-
|
195
|
-
class << self
|
196
|
-
# @return [Boolean] Indicates whether or not this command can actually
|
197
|
-
# perform work of itself, or that it only contains subcommands.
|
198
|
-
def abstract_command; end
|
199
|
-
|
200
|
-
# @return [Boolean] Indicates whether or not this command can actually
|
201
|
-
# perform work of itself, or that it only contains subcommands.
|
202
|
-
def abstract_command=(_arg0); end
|
203
|
-
|
204
|
-
# @return [Boolean] Indicates whether or not this command can actually
|
205
|
-
# perform work of itself, or that it only contains subcommands.
|
206
|
-
def abstract_command?; end
|
207
|
-
|
208
|
-
# @return [Boolean] The default value for {Command#ansi_output}. This
|
209
|
-
# defaults to `true` if `STDOUT` is connected to a TTY and
|
210
|
-
# `String` has the instance methods `#red`, `#green`, and
|
211
|
-
# `#yellow` (which are defined by, for instance, the
|
212
|
-
# [colored](https://github.com/defunkt/colored) gem).
|
213
|
-
def ansi_output; end
|
214
|
-
|
215
|
-
# Sets the attribute ansi_output
|
216
|
-
#
|
217
|
-
# @param value the value to set the attribute ansi_output to.
|
218
|
-
def ansi_output=(_arg0); end
|
219
|
-
|
220
|
-
# @return [Boolean] The default value for {Command#ansi_output}. This
|
221
|
-
# defaults to `true` if `STDOUT` is connected to a TTY and
|
222
|
-
# `String` has the instance methods `#red`, `#green`, and
|
223
|
-
# `#yellow` (which are defined by, for instance, the
|
224
|
-
# [colored](https://github.com/defunkt/colored) gem).
|
225
|
-
def ansi_output?; end
|
226
|
-
|
227
|
-
# @return [Array<Argument>] A list of arguments the command handles. This is shown
|
228
|
-
# in the usage section of the command’s help banner.
|
229
|
-
# Each Argument in the array represents an argument by its name
|
230
|
-
# (or list of alternatives) and whether it's required or optional
|
231
|
-
def arguments; end
|
232
|
-
|
233
|
-
# @param arguments [Array<Argument>] An array listing the command arguments.
|
234
|
-
# Each Argument object describe the argument by its name
|
235
|
-
# (or list of alternatives) and whether it's required or optional
|
236
|
-
# @todo Remove deprecation
|
237
|
-
def arguments=(arguments); end
|
238
|
-
|
239
|
-
# Handle deprecated form of self.arguments as an
|
240
|
-
# Array<Array<(String, Symbol)>> like in:
|
241
|
-
#
|
242
|
-
# self.arguments = [ ['NAME', :required], ['QUERY', :optional] ]
|
243
|
-
#
|
244
|
-
# @todo Remove deprecated format support
|
245
|
-
def arguments_array=(arguments); end
|
246
|
-
|
247
|
-
# Handle deprecated form of self.arguments as a String, like in:
|
248
|
-
#
|
249
|
-
# self.arguments = 'NAME [QUERY]'
|
250
|
-
#
|
251
|
-
# @todo Remove deprecated format support
|
252
|
-
def arguments_string=(arguments); end
|
253
|
-
|
254
|
-
# Returns the banner for the command.
|
255
|
-
#
|
256
|
-
# @param banner_class [Class] The class to use to format help banners.
|
257
|
-
# @return [String] The banner for the command.
|
258
|
-
def banner(banner_class = T.unsafe(nil)); end
|
259
|
-
|
260
|
-
# Print banner and exit
|
261
|
-
#
|
262
|
-
# @note Calling this method exits the current process.
|
263
|
-
# @return [void]
|
264
|
-
def banner!; end
|
265
|
-
|
266
|
-
# @return [String] The name of the command. Defaults to a snake-cased
|
267
|
-
# version of the class’ name.
|
268
|
-
def command; end
|
269
|
-
|
270
|
-
# Sets the attribute command
|
271
|
-
#
|
272
|
-
# @param value the value to set the attribute command to.
|
273
|
-
def command=(_arg0); end
|
274
|
-
|
275
|
-
# @return [String] The subcommand which an abstract command should invoke
|
276
|
-
# by default.
|
277
|
-
def default_subcommand; end
|
278
|
-
|
279
|
-
# @return [String] The subcommand which an abstract command should invoke
|
280
|
-
# by default.
|
281
|
-
def default_subcommand=(_arg0); end
|
282
|
-
|
283
|
-
# @return [String] A longer description of the command, which is shown
|
284
|
-
# underneath the usage section of the command’s help banner. Any
|
285
|
-
# indentation in this value will be ignored.
|
286
|
-
def description; end
|
287
|
-
|
288
|
-
# @return [String] A longer description of the command, which is shown
|
289
|
-
# underneath the usage section of the command’s help banner. Any
|
290
|
-
# indentation in this value will be ignored.
|
291
|
-
def description=(_arg0); end
|
292
|
-
|
293
|
-
# Searches the list of subcommands that should not be ignored for command
|
294
|
-
# lookup for a subcommand with the given `name`.
|
295
|
-
#
|
296
|
-
# @param name [String] The name of the subcommand to be found.
|
297
|
-
# @return [CLAide::Command, nil] The subcommand, if found.
|
298
|
-
def find_subcommand(name); end
|
299
|
-
|
300
|
-
# @example
|
301
|
-
#
|
302
|
-
# BevarageMaker::Tea.full_command # => "beverage-maker tea"
|
303
|
-
# @return [String] The full command up-to this command, as it would be
|
304
|
-
# looked up during parsing.
|
305
|
-
def full_command; end
|
306
|
-
|
307
|
-
# Presents an exception to the user in a short manner in case of an
|
308
|
-
# `InformativeError` or in long form in other cases,
|
309
|
-
#
|
310
|
-
# @param command [Command, nil] The command from where the exception originated.
|
311
|
-
# @param exception [Object] The exception to present.
|
312
|
-
# @return [void]
|
313
|
-
def handle_exception(command, exception); end
|
314
|
-
|
315
|
-
# @param error_message [String] The error message to show to the user.
|
316
|
-
# @param help_class [Class] The class to use to raise a ‘help’ error.
|
317
|
-
# @raise [Help] Signals CLAide that a help banner for this command should be shown,
|
318
|
-
# with an optional error message.
|
319
|
-
# @return [void]
|
320
|
-
def help!(error_message = T.unsafe(nil), help_class = T.unsafe(nil)); end
|
321
|
-
|
322
|
-
# @return [Boolean] Indicates whether or not this command is used during
|
323
|
-
# command parsing and whether or not it should be shown in the
|
324
|
-
# help banner or to show its subcommands instead.
|
325
|
-
#
|
326
|
-
# Setting this to `true` implies it’s an abstract command.
|
327
|
-
def ignore_in_command_lookup; end
|
328
|
-
|
329
|
-
def ignore_in_command_lookup=(flag); end
|
330
|
-
|
331
|
-
# @return [Boolean] Indicates whether or not this command is used during
|
332
|
-
# command parsing and whether or not it should be shown in the
|
333
|
-
# help banner or to show its subcommands instead.
|
334
|
-
#
|
335
|
-
# Setting this to `true` implies it’s an abstract command.
|
336
|
-
def ignore_in_command_lookup?; end
|
337
|
-
|
338
|
-
# Automatically registers a subclass as a subcommand.
|
339
|
-
def inherited(subcommand); end
|
340
|
-
|
341
|
-
# Convenience method.
|
342
|
-
# Instantiate the command and run it with the provided arguments at once.
|
343
|
-
#
|
344
|
-
# CLAide::Command::run, it does not load plugins nor exit on failure.
|
345
|
-
# It is up to the caller to rescue any possible exception raised.
|
346
|
-
#
|
347
|
-
# @note This method validate! the command before running it, but contrary to
|
348
|
-
# @param args [String..., Array<String>] The arguments to initialize the command with
|
349
|
-
# @raise [Help] If validate! fails
|
350
|
-
def invoke(*args); end
|
351
|
-
|
352
|
-
# @param argv [Array, ARGV] A list of (remaining) parameters.
|
353
|
-
# @return [Command] Returns the default subcommand initialized with the
|
354
|
-
# given arguments.
|
355
|
-
def load_default_subcommand(argv); end
|
356
|
-
|
357
|
-
# Should be overridden by a subclass if it handles any options.
|
358
|
-
#
|
359
|
-
# The subclass has to combine the result of calling `super` and its own
|
360
|
-
# list of options. The recommended way of doing this is by concatenating
|
361
|
-
# to this classes’ own options.
|
362
|
-
#
|
363
|
-
# @example
|
364
|
-
#
|
365
|
-
# def self.options
|
366
|
-
# [
|
367
|
-
# ['--verbose', 'Print more info'],
|
368
|
-
# ['--help', 'Print help banner'],
|
369
|
-
# ].concat(super)
|
370
|
-
# end
|
371
|
-
# @return [Array<Array>] A list of option name and description tuples.
|
372
|
-
def options; end
|
373
|
-
|
374
|
-
# @param argv [Array, ARGV] A list of (remaining) parameters.
|
375
|
-
# @return [Command] An instance of the command class that was matched by
|
376
|
-
# going through the arguments in the parameters and drilling down
|
377
|
-
# command classes.
|
378
|
-
def parse(argv); end
|
379
|
-
|
380
|
-
# Handle depracted form of assigning a plugin prefix.
|
381
|
-
#
|
382
|
-
# @todo Remove deprecated form.
|
383
|
-
def plugin_prefix=(prefix); end
|
384
|
-
|
385
|
-
# @return [Array<String>] The prefixes used to search for CLAide plugins.
|
386
|
-
# Plugins are loaded via their `<plugin_prefix>_plugin.rb` file.
|
387
|
-
# Defaults to search for `claide` plugins.
|
388
|
-
def plugin_prefixes; end
|
389
|
-
|
390
|
-
# Sets the attribute plugin_prefixes
|
391
|
-
#
|
392
|
-
# @param value the value to set the attribute plugin_prefixes to.
|
393
|
-
def plugin_prefixes=(_arg0); end
|
394
|
-
|
395
|
-
# Allows the application to perform custom error reporting, by overriding
|
396
|
-
# this method.
|
397
|
-
#
|
398
|
-
# @param exception [Exception] An exception that occurred while running a command through
|
399
|
-
# {Command.run}.
|
400
|
-
# @raise By default re-raises the specified exception.
|
401
|
-
# @return [void]
|
402
|
-
def report_error(exception); end
|
403
|
-
|
404
|
-
# @return [Bool] Whether this is the root command class
|
405
|
-
def root_command?; end
|
406
|
-
|
407
|
-
# Instantiates the command class matching the parameters through
|
408
|
-
# {Command.parse}, validates it through {Command#validate!}, and runs it
|
409
|
-
# through {Command#run}.
|
410
|
-
#
|
411
|
-
# @note The ANSI support is configured before running a command to allow
|
412
|
-
# the same process to run multiple commands with different
|
413
|
-
# settings. For example a process with ANSI output enabled might
|
414
|
-
# want to programmatically invoke another command with the output
|
415
|
-
# enabled.
|
416
|
-
# @param argv [Array, ARGV] A list of parameters. For instance, the standard `ARGV` constant,
|
417
|
-
# which contains the parameters passed to the program.
|
418
|
-
# @return [void]
|
419
|
-
def run(argv = T.unsafe(nil)); end
|
420
|
-
|
421
|
-
# @return [Array<Class>] A list of all command classes that are nested
|
422
|
-
# under this command.
|
423
|
-
def subcommands; end
|
424
|
-
|
425
|
-
# @return [Array<Class>] A list of command classes that are nested under
|
426
|
-
# this command _or_ the subcommands of those command classes in
|
427
|
-
# case the command class should be ignored in command lookup.
|
428
|
-
def subcommands_for_command_lookup; end
|
429
|
-
|
430
|
-
# @return [String] A brief description of the command, which is shown
|
431
|
-
# next to the command in the help banner of a parent command.
|
432
|
-
def summary; end
|
433
|
-
|
434
|
-
# @return [String] A brief description of the command, which is shown
|
435
|
-
# next to the command in the help banner of a parent command.
|
436
|
-
def summary=(_arg0); end
|
437
|
-
|
438
|
-
# @return [String] The version of the command. This value will be printed
|
439
|
-
# by the `--version` flag if used for the root command.
|
440
|
-
def version; end
|
441
|
-
|
442
|
-
# @return [String] The version of the command. This value will be printed
|
443
|
-
# by the `--version` flag if used for the root command.
|
444
|
-
def version=(_arg0); end
|
445
|
-
|
446
|
-
private
|
447
|
-
|
448
|
-
# Adds a new option for the current command.
|
449
|
-
#
|
450
|
-
# This method can be used in conjunction with overriding `options`.
|
451
|
-
#
|
452
|
-
# @example
|
453
|
-
#
|
454
|
-
# option '--help', 'Print help banner '
|
455
|
-
# @return [void]
|
456
|
-
def option(name, description); end
|
457
|
-
end
|
458
|
-
end
|
459
|
-
|
460
|
-
CLAide::Command::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Array)
|
461
|
-
CLAide::Command::DEFAULT_ROOT_OPTIONS = T.let(T.unsafe(nil), Array)
|
462
|
-
|
463
|
-
# This module is used by Command::PluginsHelper to download the Gem
|
464
|
-
# Specification data, check if a Gem is installed, and provide info
|
465
|
-
# on all versions of a Gem.
|
466
|
-
module CLAide::Command::GemHelper
|
467
|
-
class << self
|
468
|
-
# Getter for GemIndexCache
|
469
|
-
#
|
470
|
-
# @return [GemIndexCache] a new or memoized GemIndexCache
|
471
|
-
def cache; end
|
472
|
-
|
473
|
-
# Colorize an Array of version strings so versions that are installed
|
474
|
-
# are green and uninstalled versions are yellow.
|
475
|
-
#
|
476
|
-
# @param versions [Array] sorted array of Gem::NameTuples representing all versions of
|
477
|
-
# a plugin gem.
|
478
|
-
# @return [Array] An array of strings, each one being the version
|
479
|
-
# string of the same plugin
|
480
|
-
def colorize_versions(versions); end
|
481
|
-
|
482
|
-
# Instantiate a cache and download the spec index if it has
|
483
|
-
# not already been done.
|
484
|
-
def download_and_cache_specs; end
|
485
|
-
|
486
|
-
# Tells if a gem is installed
|
487
|
-
#
|
488
|
-
# @param gem_name [String] The name of the plugin gem to test
|
489
|
-
# @param version_string [String] An optional version string, used to check if a specific
|
490
|
-
# version of a gem is installed
|
491
|
-
# @return [Bool] true if the gem is installed, false otherwise.
|
492
|
-
def gem_installed?(gem_name, version_string = T.unsafe(nil)); end
|
493
|
-
|
494
|
-
# Get the version of a gem that is installed locally. If more than
|
495
|
-
# one version is installed, this returns the first version found,
|
496
|
-
# which MAY not be the highest/newest version.
|
497
|
-
#
|
498
|
-
# @return [String] The version of the gem that is installed,
|
499
|
-
# or nil if it is not installed.
|
500
|
-
def installed_version(gem_name); end
|
501
|
-
|
502
|
-
# Create a string containing all versions of a plugin,
|
503
|
-
# colored to indicate if a specific version is installed
|
504
|
-
# locally.
|
505
|
-
#
|
506
|
-
# @param plugin_name [String] The name of the plugin gem
|
507
|
-
# @param index_cache [GemIndexCache] Optional index cache can be passed in, otherwise
|
508
|
-
# the module instance is used.
|
509
|
-
# @return [String] a string containing a comma separated
|
510
|
-
# concatenation of all versions of a plugin
|
511
|
-
# that were found on rubygems.org
|
512
|
-
def versions_string(plugin_name, index_cache = T.unsafe(nil)); end
|
513
|
-
end
|
514
|
-
end
|
515
|
-
|
516
|
-
# This class is used by Command::GemsHelper to download the Gem
|
517
|
-
# Specification index from rubygems.org and provide info about
|
518
|
-
# the index.
|
519
|
-
class CLAide::Command::GemIndexCache
|
520
|
-
# A memoized hash of all the rubygem specs. If it is nil, the specs will
|
521
|
-
# be downloaded, which will take a few seconds to download.
|
522
|
-
# Alias to make the initial caching process more readable.
|
523
|
-
#
|
524
|
-
# @return [Hash] The hash of all rubygems
|
525
|
-
def download_and_cache_specs; end
|
526
|
-
|
527
|
-
# A memoized hash of all the rubygem specs. If it is nil, the specs will
|
528
|
-
# be downloaded, which will take a few seconds to download.
|
529
|
-
#
|
530
|
-
# @return [Hash] The hash of all rubygems
|
531
|
-
def specs; end
|
532
|
-
|
533
|
-
# Get an Array of Gem::NameTuple objects that match a given
|
534
|
-
# spec name.
|
535
|
-
#
|
536
|
-
# @param name [String] The name of the gem to match on (e.g. 'cocoapods-try')
|
537
|
-
# @return [Array] Array of Gem::NameTuple that match the name
|
538
|
-
def specs_with_name(name); end
|
539
|
-
|
540
|
-
private
|
541
|
-
|
542
|
-
# Force the rubygem spec index file
|
543
|
-
#
|
544
|
-
# @return [Hash] The hash of all rubygems
|
545
|
-
def download_specs; end
|
546
|
-
|
547
|
-
# Flatten the dictionary returned from Gem::SpecFetcher
|
548
|
-
# to a simple array.
|
549
|
-
#
|
550
|
-
# @param results [Hash] the hash returned from the call to
|
551
|
-
# Gem::SpecFetcher.available_specs()
|
552
|
-
# @return [Array] Array of all spec results
|
553
|
-
def flatten_fetcher_results(results); end
|
554
|
-
end
|
555
|
-
|
556
|
-
# The claide plugins command.
|
557
|
-
class CLAide::Command::Plugins < ::CLAide::Command; end
|
558
|
-
|
559
|
-
# The create subcommand. Used to create a new plugin using either the
|
560
|
-
# default template (CocoaPods/cocoapods-plugin-template) or a custom
|
561
|
-
# template
|
562
|
-
class CLAide::Command::Plugins::Create < ::CLAide::Command::Plugins
|
563
|
-
# @return [Create] a new instance of Create
|
564
|
-
def initialize(argv); end
|
565
|
-
|
566
|
-
def run; end
|
567
|
-
def validate!; end
|
568
|
-
|
569
|
-
private
|
570
|
-
|
571
|
-
# Shows a reminder to the plugin author to make a Pull Request
|
572
|
-
# in order to update plugins.json once the plugin is released
|
573
|
-
def show_reminder; end
|
574
|
-
|
575
|
-
class << self
|
576
|
-
def description; end
|
577
|
-
end
|
578
|
-
end
|
579
|
-
|
580
|
-
# The list subcommand. Used to list all known plugins
|
581
|
-
class CLAide::Command::Plugins::List < ::CLAide::Command::Plugins
|
582
|
-
def run; end
|
583
|
-
|
584
|
-
class << self
|
585
|
-
def description; end
|
586
|
-
def options; end
|
587
|
-
end
|
588
|
-
end
|
589
|
-
|
590
|
-
# The search subcommand.
|
591
|
-
# Used to search a plugin in the list of known plugins,
|
592
|
-
# searching into the name, author description fields
|
593
|
-
class CLAide::Command::Plugins::Search < ::CLAide::Command::Plugins
|
594
|
-
# @return [Search] a new instance of Search
|
595
|
-
def initialize(argv); end
|
596
|
-
|
597
|
-
def run; end
|
598
|
-
def validate!; end
|
599
|
-
|
600
|
-
class << self
|
601
|
-
def options; end
|
602
|
-
end
|
603
|
-
end
|
604
|
-
|
605
|
-
# This module is used by Command::Plugins::List
|
606
|
-
# and Command::Plugins::Search to download and parse
|
607
|
-
# the JSON describing the plugins list and manipulate it
|
608
|
-
module CLAide::Command::PluginsHelper
|
609
|
-
class << self
|
610
|
-
# Force-download the JSON
|
611
|
-
#
|
612
|
-
# @return [Hash] The hash representing the JSON with all known plugins
|
613
|
-
def download_json; end
|
614
|
-
|
615
|
-
# The list of all known plugins, according to
|
616
|
-
# the JSON hosted on github's cocoapods-plugins
|
617
|
-
#
|
618
|
-
# @return [Array] all known plugins, as listed in the downloaded JSON
|
619
|
-
def known_plugins; end
|
620
|
-
|
621
|
-
# Filter plugins to return only matching ones
|
622
|
-
#
|
623
|
-
# @param query [String] A query string that corresponds to a valid RegExp pattern.
|
624
|
-
# @param full_text_search [Bool] false only searches in the plugin's name.
|
625
|
-
# true searches in the plugin's name, author and description.
|
626
|
-
# @return [Array] all plugins matching the query
|
627
|
-
def matching_plugins(query, full_text_search); end
|
628
|
-
|
629
|
-
# Parse the given JSON data, handling parsing errors if any
|
630
|
-
#
|
631
|
-
# @param json_str [String] The string representation of the JSON to parse
|
632
|
-
def parse_json(json_str); end
|
633
|
-
|
634
|
-
def plugin_prefix; end
|
635
|
-
|
636
|
-
# Format the title line to print the plugin info with print_plugin
|
637
|
-
# coloring it according to whether the plugin is installed or not
|
638
|
-
#
|
639
|
-
# @param plugin [Hash] The hash describing the plugin
|
640
|
-
# @return [String] The formatted and colored title
|
641
|
-
def plugin_title(plugin); end
|
642
|
-
|
643
|
-
def plugins_raw_url; end
|
644
|
-
|
645
|
-
# Display information about a plugin
|
646
|
-
#
|
647
|
-
# @param plugin [Hash] The hash describing the plugin
|
648
|
-
# @param verbose [Bool] If true, will also print the author of the plugins.
|
649
|
-
# Defaults to false.
|
650
|
-
def print_plugin(plugin, verbose = T.unsafe(nil)); end
|
651
|
-
|
652
|
-
# Smaller helper to print out the verbose details
|
653
|
-
# for a plugin.
|
654
|
-
#
|
655
|
-
# @param plugin [Hash] The hash describing the plugin
|
656
|
-
# @param ljust [Integer] The left justification that is passed into UI.labeled
|
657
|
-
def print_verbose_plugin(plugin, ljust); end
|
658
|
-
end
|
659
|
-
end
|
660
|
-
|
661
|
-
# Module which provides support for running executables.
|
662
|
-
#
|
663
|
-
# In a class it can be used as:
|
664
|
-
#
|
665
|
-
# extend Executable
|
666
|
-
# executable :git
|
667
|
-
#
|
668
|
-
# This will create two methods `git` and `git!` both accept a command but
|
669
|
-
# the latter will raise on non successful executions. The methods return the
|
670
|
-
# output of the command.
|
671
|
-
module CLAide::Executable
|
672
|
-
# Creates the methods for the executable with the given name.
|
673
|
-
#
|
674
|
-
# @param name [Symbol] the name of the executable.
|
675
|
-
# @return [void]
|
676
|
-
def executable(name); end
|
677
|
-
|
678
|
-
class << self
|
679
|
-
# Executes the given command. Displays output if in verbose mode.
|
680
|
-
#
|
681
|
-
# @param bin [String] The binary to use.
|
682
|
-
# @param command [Array<#to_s>] The command to send to the binary.
|
683
|
-
# @param raise_on_failure [Bool] Whether it should raise if the command fails.
|
684
|
-
# @raise If the executable could not be located.
|
685
|
-
# @raise If the command fails and the `raise_on_failure` is set to true.
|
686
|
-
# @return [String] the output of the command (STDOUT and STDERR).
|
687
|
-
# @todo Find a way to display the live output of the commands.
|
688
|
-
def execute_command(exe, command, raise_on_failure); end
|
689
|
-
end
|
690
|
-
end
|
691
|
-
|
692
|
-
# Helper class that allows to write to an {IO} instance taking into account
|
693
|
-
# the UI indentation level.
|
694
|
-
class CLAide::Executable::Indenter < ::Array
|
695
|
-
# @param io [IO] @see io
|
696
|
-
# @return [Indenter] a new instance of Indenter
|
697
|
-
def initialize(io = T.unsafe(nil)); end
|
698
|
-
|
699
|
-
# Stores a portion of the output and prints it to the {IO} instance.
|
700
|
-
#
|
701
|
-
# @param value [String] the output to print.
|
702
|
-
# @return [void]
|
703
|
-
def <<(value); end
|
704
|
-
|
705
|
-
# @return [Fixnum] The indentation level of the UI.
|
706
|
-
def indent; end
|
707
|
-
|
708
|
-
# @return [Fixnum] The indentation level of the UI.
|
709
|
-
def indent=(_arg0); end
|
710
|
-
|
711
|
-
# @return [IO] the {IO} to which the output should be printed.
|
712
|
-
def io; end
|
713
|
-
|
714
|
-
# @return [IO] the {IO} to which the output should be printed.
|
715
|
-
def io=(_arg0); end
|
716
|
-
end
|
717
|
-
|
718
|
-
# Indicates a user error.
|
719
|
-
class CLAide::Informative < ::CLAide::PlainInformative; end
|
720
|
-
|
721
|
-
# Indicates a runtime error **not** caused by a bug.
|
722
|
-
class CLAide::PlainInformative < ::StandardError; end
|
723
|
-
|
724
|
-
module CLAide::Plugins
|
725
|
-
class << self
|
726
|
-
# Returns the value of attribute config.
|
727
|
-
def config; end
|
728
|
-
|
729
|
-
# Sets the attribute config
|
730
|
-
#
|
731
|
-
# @param value the value to set the attribute config to.
|
732
|
-
def config=(_arg0); end
|
733
|
-
end
|
734
|
-
end
|
735
|
-
|
736
|
-
class CLAide::Plugins::Configuration
|
737
|
-
# @return [Configuration] a new instance of Configuration
|
738
|
-
def initialize(name = T.unsafe(nil), plugin_prefix = T.unsafe(nil), plugin_list_url = T.unsafe(nil), plugin_template_url = T.unsafe(nil)); end
|
739
|
-
|
740
|
-
# name of the plugin
|
741
|
-
def name; end
|
742
|
-
|
743
|
-
# name of the plugin
|
744
|
-
def name=(_arg0); end
|
745
|
-
|
746
|
-
# url for JSON file that holds list of plugins to show when searching
|
747
|
-
def plugin_list_url; end
|
748
|
-
|
749
|
-
# url for JSON file that holds list of plugins to show when searching
|
750
|
-
def plugin_list_url=(_arg0); end
|
751
|
-
|
752
|
-
# prefix to use when searching for gems to load at runtime
|
753
|
-
def plugin_prefix; end
|
754
|
-
|
755
|
-
# prefix to use when searching for gems to load at runtime
|
756
|
-
def plugin_prefix=(_arg0); end
|
757
|
-
|
758
|
-
# url for repo that holds template to use when creating a new plugin
|
759
|
-
def plugin_template_url; end
|
760
|
-
|
761
|
-
# url for repo that holds template to use when creating a new plugin
|
762
|
-
def plugin_template_url=(_arg0); end
|
763
|
-
end
|
764
|
-
|
765
|
-
class CLAide::TemplateRunner
|
766
|
-
extend ::CLAide::Executable
|
767
|
-
|
768
|
-
# @return [TemplateRunner] a new instance of TemplateRunner
|
769
|
-
def initialize(name, template_url); end
|
770
|
-
|
771
|
-
# Clones the template from the remote in the working directory using
|
772
|
-
# the name of the plugin.
|
773
|
-
#
|
774
|
-
# @return [void]
|
775
|
-
def clone_template; end
|
776
|
-
|
777
|
-
# Runs the template configuration utilities.
|
778
|
-
#
|
779
|
-
# @return [void]
|
780
|
-
def configure_template; end
|
781
|
-
|
782
|
-
def git(*command); end
|
783
|
-
def git!(*command); end
|
784
|
-
|
785
|
-
# Checks if a template URL is given else returns the Plugins.config URL
|
786
|
-
#
|
787
|
-
# @return String
|
788
|
-
def template_repo_url; end
|
789
|
-
end
|
790
|
-
|
791
|
-
UI = T.let(T.unsafe(nil), Cork::Board)
|