geet 0.23.0 → 0.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +16 -2
- data/.gitignore +0 -1
- data/.ruby-version +1 -0
- data/Gemfile +3 -6
- data/bin/geet +2 -8
- data/geet.gemspec +4 -4
- data/lib/geet/commandline/configuration.rb +0 -1
- data/lib/geet/commandline/editor.rb +0 -2
- data/lib/geet/git/repository.rb +12 -21
- data/lib/geet/github/abstract_issue.rb +0 -6
- data/lib/geet/github/api_interface.rb +0 -1
- data/lib/geet/github/issue.rb +0 -3
- data/lib/geet/github/milestone.rb +0 -2
- data/lib/geet/github/pr.rb +0 -3
- data/lib/geet/github/user.rb +0 -3
- data/lib/geet/gitlab/pr.rb +3 -1
- data/lib/geet/helpers/json_helper.rb +4 -0
- data/lib/geet/helpers/os_helper.rb +21 -7
- data/lib/geet/helpers/services_workflow_helper.rb +12 -0
- data/lib/geet/helpers/summary_helper.rb +7 -0
- data/lib/geet/services/abstract_create_issue.rb +5 -5
- data/lib/geet/services/add_upstream_repo.rb +6 -0
- data/lib/geet/services/close_milestones.rb +0 -2
- data/lib/geet/services/comment_pr.rb +0 -3
- data/lib/geet/services/create_gist.rb +0 -4
- data/lib/geet/services/create_issue.rb +0 -4
- data/lib/geet/services/create_pr.rb +4 -6
- data/lib/geet/services/list_issues.rb +0 -3
- data/lib/geet/services/merge_pr.rb +0 -2
- data/lib/geet/services/open_pr.rb +0 -3
- data/lib/geet/services/open_repo.rb +0 -2
- data/lib/geet/shared/http_error.rb +8 -2
- data/lib/geet/shared/repo_permissions.rb +7 -2
- data/lib/geet/shared/selection.rb +3 -2
- data/lib/geet/utils/attributes_selection_manager.rb +15 -4
- data/lib/geet/utils/git_client.rb +4 -1
- data/lib/geet/utils/manual_list_selection.rb +39 -14
- data/lib/geet/utils/string_matching_selection.rb +5 -0
- data/lib/geet/version.rb +1 -1
- data/lib/geet.rb +11 -0
- data/sorbet/config +3 -1
- data/sorbet/rbi/gems/{rbs@3.9.5.rbi → rbs@4.0.0.dev.5.rbi} +2013 -680
- data/sorbet/rbi/gems/require-hooks@0.2.2.rbi +110 -0
- data/sorbet/rbi/gems/{spoom@1.6.3.rbi → spoom@1.7.11.rbi} +1139 -2246
- data/sorbet/rbi/gems/{tapioca@0.16.11.rbi → tapioca@0.17.10.rbi} +721 -835
- data/sorbet/rbi/gems/tsort@0.2.0.rbi +393 -0
- data/sorbet/rbi/gems/tty-prompt@0.23.1.rbi +3300 -2
- data/sorbet/rbi/gems/zeitwerk@2.7.4.rbi +1196 -0
- data/sorbet/rbi/shims/unresolved_gem_constants.rbi +4 -0
- data/spec/integration/create_pr_spec.rb +157 -147
- data/spec/integration/merge_pr_spec.rb +84 -85
- data/spec/spec_helper.rb +1 -1
- metadata +40 -6
|
@@ -5,5 +5,3303 @@
|
|
|
5
5
|
# Please instead update this file by running `bin/tapioca gem tty-prompt`.
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
#
|
|
9
|
-
|
|
8
|
+
# source://tty-prompt//lib/tty/prompt/answers_collector.rb#3
|
|
9
|
+
module TTY; end
|
|
10
|
+
|
|
11
|
+
# A main entry for asking prompt questions.
|
|
12
|
+
#
|
|
13
|
+
# source://tty-prompt//lib/tty/prompt/answers_collector.rb#4
|
|
14
|
+
class TTY::Prompt
|
|
15
|
+
extend ::Forwardable
|
|
16
|
+
|
|
17
|
+
# Initialize a Prompt
|
|
18
|
+
#
|
|
19
|
+
# @api public
|
|
20
|
+
# @param :active_color [String, Proc] the color used for selected option
|
|
21
|
+
# @param :enable_color [Boolean] enable color support, true by default
|
|
22
|
+
# @param :env [Hash] the environment variables
|
|
23
|
+
# @param :error_color [String] the color used for displaying error messages
|
|
24
|
+
# @param :help_color [String, Proc] the color used for help text
|
|
25
|
+
# @param :input [IO] the input stream
|
|
26
|
+
# @param :interrupt [Symbol] handling of Ctrl+C key out of :signal, :exit, :noop
|
|
27
|
+
# @param :output [IO] the output stream
|
|
28
|
+
# @param :prefix [String] the prompt prefix, by default empty
|
|
29
|
+
# @param :symbols [Hash] the symbols displayed in prompts such as :marker, :cross
|
|
30
|
+
# @param :track_history [Boolean] disable line history tracking, true by default
|
|
31
|
+
# @param options [Boolean] :quiet
|
|
32
|
+
# enable quiet mode, don't re-echo the question
|
|
33
|
+
# @return [Prompt] a new instance of Prompt
|
|
34
|
+
#
|
|
35
|
+
# source://tty-prompt//lib/tty/prompt.rb#120
|
|
36
|
+
def initialize(input: T.unsafe(nil), output: T.unsafe(nil), env: T.unsafe(nil), symbols: T.unsafe(nil), prefix: T.unsafe(nil), interrupt: T.unsafe(nil), track_history: T.unsafe(nil), quiet: T.unsafe(nil), enable_color: T.unsafe(nil), active_color: T.unsafe(nil), help_color: T.unsafe(nil), error_color: T.unsafe(nil)); end
|
|
37
|
+
|
|
38
|
+
# Theme colors
|
|
39
|
+
#
|
|
40
|
+
# @api private
|
|
41
|
+
#
|
|
42
|
+
# source://tty-prompt//lib/tty/prompt.rb#55
|
|
43
|
+
def active_color; end
|
|
44
|
+
|
|
45
|
+
# Ask a question.
|
|
46
|
+
#
|
|
47
|
+
# @api public
|
|
48
|
+
# @example
|
|
49
|
+
# propmt = TTY::Prompt.new
|
|
50
|
+
# prompt.ask("What is your name?")
|
|
51
|
+
# @param message [String] the question to be asked
|
|
52
|
+
# @return [TTY::Prompt::Question]
|
|
53
|
+
# @yield [question]
|
|
54
|
+
# @yieldparam question [TTY::Prompt::Question] further configure the question
|
|
55
|
+
#
|
|
56
|
+
# source://tty-prompt//lib/tty/prompt.rb#201
|
|
57
|
+
def ask(message = T.unsafe(nil), **options, &block); end
|
|
58
|
+
|
|
59
|
+
# source://tty-prompt//lib/tty/prompt.rb#74
|
|
60
|
+
def clear_line(*args, **_arg1, &block); end
|
|
61
|
+
|
|
62
|
+
# source://tty-prompt//lib/tty/prompt.rb#74
|
|
63
|
+
def clear_lines(*args, **_arg1, &block); end
|
|
64
|
+
|
|
65
|
+
# Gathers more than one aswer
|
|
66
|
+
#
|
|
67
|
+
# @api public
|
|
68
|
+
# @example
|
|
69
|
+
# prompt.collect do
|
|
70
|
+
# key(:name).ask("Name?")
|
|
71
|
+
# end
|
|
72
|
+
# @return [Hash] the collection of answers
|
|
73
|
+
#
|
|
74
|
+
# source://tty-prompt//lib/tty/prompt.rb#534
|
|
75
|
+
def collect(**options, &block); end
|
|
76
|
+
|
|
77
|
+
# source://tty-prompt//lib/tty/prompt.rb#77
|
|
78
|
+
def count_screen_lines(*args, **_arg1, &block); end
|
|
79
|
+
|
|
80
|
+
# Returns the value of attribute cursor.
|
|
81
|
+
#
|
|
82
|
+
# source://tty-prompt//lib/tty/prompt.rb#40
|
|
83
|
+
def cursor; end
|
|
84
|
+
|
|
85
|
+
# Print debug information in terminal top right corner
|
|
86
|
+
#
|
|
87
|
+
# @api public
|
|
88
|
+
# @example
|
|
89
|
+
# prompt.debug "info1", "info2"
|
|
90
|
+
# @param messages [Array]
|
|
91
|
+
#
|
|
92
|
+
# source://tty-prompt//lib/tty/prompt.rb#484
|
|
93
|
+
def debug(*messages); end
|
|
94
|
+
|
|
95
|
+
# Decorate a string with colors
|
|
96
|
+
#
|
|
97
|
+
# @api public
|
|
98
|
+
# @param :colors [Array<Proc|Symbol>] collection of color symbols or callable object
|
|
99
|
+
# @param :string [String] the string to color
|
|
100
|
+
#
|
|
101
|
+
# source://tty-prompt//lib/tty/prompt.rb#156
|
|
102
|
+
def decorate(string, *colors); end
|
|
103
|
+
|
|
104
|
+
# Theme colors
|
|
105
|
+
#
|
|
106
|
+
# @api private
|
|
107
|
+
#
|
|
108
|
+
# source://tty-prompt//lib/tty/prompt.rb#55
|
|
109
|
+
def enabled_color; end
|
|
110
|
+
|
|
111
|
+
# Ask a question with indexed list
|
|
112
|
+
#
|
|
113
|
+
# @api public
|
|
114
|
+
# @example
|
|
115
|
+
# prompt = TTY::Prompt.new
|
|
116
|
+
# editors = %w(emacs nano vim)
|
|
117
|
+
# prompt.enum_select(EnumList, "Select editor: ", editors)
|
|
118
|
+
# @param choices [Array[Object]] the choices to select from
|
|
119
|
+
# @param question [String] the question to ask
|
|
120
|
+
# @return [String]
|
|
121
|
+
#
|
|
122
|
+
# source://tty-prompt//lib/tty/prompt.rb#325
|
|
123
|
+
def enum_select(question, *args, &block); end
|
|
124
|
+
|
|
125
|
+
# Print statement(s) out in red color.
|
|
126
|
+
#
|
|
127
|
+
# @api public
|
|
128
|
+
# @example
|
|
129
|
+
# prompt.error "Shutting down all systems!"
|
|
130
|
+
# prompt.error "Nothing is fine!", "All is broken!"
|
|
131
|
+
# @param messages [Array]
|
|
132
|
+
# @return [Array] messages
|
|
133
|
+
#
|
|
134
|
+
# source://tty-prompt//lib/tty/prompt.rb#469
|
|
135
|
+
def error(*args, **options); end
|
|
136
|
+
|
|
137
|
+
# Theme colors
|
|
138
|
+
#
|
|
139
|
+
# @api private
|
|
140
|
+
#
|
|
141
|
+
# source://tty-prompt//lib/tty/prompt.rb#55
|
|
142
|
+
def error_color; end
|
|
143
|
+
|
|
144
|
+
# Expand available options
|
|
145
|
+
#
|
|
146
|
+
# @api public
|
|
147
|
+
# @example
|
|
148
|
+
# prompt = TTY::Prompt.new
|
|
149
|
+
# choices = [{
|
|
150
|
+
# key: "Y",
|
|
151
|
+
# name: "Overwrite",
|
|
152
|
+
# value: :yes
|
|
153
|
+
# }, {
|
|
154
|
+
# key: "n",
|
|
155
|
+
# name: "Skip",
|
|
156
|
+
# value: :no
|
|
157
|
+
# }]
|
|
158
|
+
# prompt.expand("Overwirte Gemfile?", choices)
|
|
159
|
+
# @return [Object] the user specified value
|
|
160
|
+
#
|
|
161
|
+
# source://tty-prompt//lib/tty/prompt.rb#382
|
|
162
|
+
def expand(message, *args, &block); end
|
|
163
|
+
|
|
164
|
+
# source://tty-prompt//lib/tty/prompt.rb#81
|
|
165
|
+
def flush(*args, **_arg1, &block); end
|
|
166
|
+
|
|
167
|
+
# Theme colors
|
|
168
|
+
#
|
|
169
|
+
# @api private
|
|
170
|
+
#
|
|
171
|
+
# source://tty-prompt//lib/tty/prompt.rb#55
|
|
172
|
+
def help_color; end
|
|
173
|
+
|
|
174
|
+
# source://tty-prompt//lib/tty/prompt.rb#74
|
|
175
|
+
def hide(*args, **_arg1, &block); end
|
|
176
|
+
|
|
177
|
+
# @api private
|
|
178
|
+
#
|
|
179
|
+
# source://tty-prompt//lib/tty/prompt.rb#33
|
|
180
|
+
def input; end
|
|
181
|
+
|
|
182
|
+
# Inspect this instance public attributes
|
|
183
|
+
#
|
|
184
|
+
# @api public
|
|
185
|
+
# @return [String]
|
|
186
|
+
#
|
|
187
|
+
# source://tty-prompt//lib/tty/prompt.rb#574
|
|
188
|
+
def inspect; end
|
|
189
|
+
|
|
190
|
+
# Invoke a question type of prompt
|
|
191
|
+
#
|
|
192
|
+
# @api public
|
|
193
|
+
# @example
|
|
194
|
+
# prompt = TTY::Prompt.new
|
|
195
|
+
# prompt.invoke_question(Question, "Your name? ")
|
|
196
|
+
# @return [String]
|
|
197
|
+
#
|
|
198
|
+
# source://tty-prompt//lib/tty/prompt.rb#178
|
|
199
|
+
def invoke_question(object, message, **options, &block); end
|
|
200
|
+
|
|
201
|
+
# Invoke a list type of prompt
|
|
202
|
+
#
|
|
203
|
+
# @api public
|
|
204
|
+
# @example
|
|
205
|
+
# prompt = TTY::Prompt.new
|
|
206
|
+
# editors = %w(emacs nano vim)
|
|
207
|
+
# prompt.invoke_select(EnumList, "Select editor: ", editors)
|
|
208
|
+
# @return [String]
|
|
209
|
+
#
|
|
210
|
+
# source://tty-prompt//lib/tty/prompt.rb#236
|
|
211
|
+
def invoke_select(object, question, *args, &block); end
|
|
212
|
+
|
|
213
|
+
# Ask a question with a keypress answer
|
|
214
|
+
#
|
|
215
|
+
# @api public
|
|
216
|
+
# @see #ask
|
|
217
|
+
#
|
|
218
|
+
# source://tty-prompt//lib/tty/prompt.rb#210
|
|
219
|
+
def keypress(message = T.unsafe(nil), **options, &block); end
|
|
220
|
+
|
|
221
|
+
# Ask masked question
|
|
222
|
+
#
|
|
223
|
+
# @api public
|
|
224
|
+
# @example
|
|
225
|
+
# propmt = TTY::Prompt.new
|
|
226
|
+
# prompt.mask("What is your secret?")
|
|
227
|
+
# @return [TTY::Prompt::MaskQuestion]
|
|
228
|
+
#
|
|
229
|
+
# source://tty-prompt//lib/tty/prompt.rb#261
|
|
230
|
+
def mask(message = T.unsafe(nil), **options, &block); end
|
|
231
|
+
|
|
232
|
+
# Ask a question with multiple attributes activated
|
|
233
|
+
#
|
|
234
|
+
# @api public
|
|
235
|
+
# @example
|
|
236
|
+
# prompt = TTY::Prompt.new
|
|
237
|
+
# choices = %w(Scorpion Jax Kitana Baraka Jade)
|
|
238
|
+
# prompt.multi_select("Choose your destiny?", choices)
|
|
239
|
+
# @param choices [Array[Object]] the choices to select from
|
|
240
|
+
# @param question [String] the question to ask
|
|
241
|
+
# @return [String]
|
|
242
|
+
#
|
|
243
|
+
# source://tty-prompt//lib/tty/prompt.rb#305
|
|
244
|
+
def multi_select(question, *args, &block); end
|
|
245
|
+
|
|
246
|
+
# Ask a question with a multiline answer
|
|
247
|
+
#
|
|
248
|
+
# @api public
|
|
249
|
+
# @example
|
|
250
|
+
# prompt.multiline("Description?")
|
|
251
|
+
# @return [Array[String]]
|
|
252
|
+
#
|
|
253
|
+
# source://tty-prompt//lib/tty/prompt.rb#222
|
|
254
|
+
def multiline(message = T.unsafe(nil), **options, &block); end
|
|
255
|
+
|
|
256
|
+
# A shortcut method to ask the user negative question and return
|
|
257
|
+
# true for "no" reply.
|
|
258
|
+
#
|
|
259
|
+
# @api public
|
|
260
|
+
# @example
|
|
261
|
+
# prompt = TTY::Prompt.new
|
|
262
|
+
# prompt.no?("Are you alien?") # => true
|
|
263
|
+
# # => Are you human? (y/N)
|
|
264
|
+
# @return [Boolean]
|
|
265
|
+
#
|
|
266
|
+
# source://tty-prompt//lib/tty/prompt.rb#357
|
|
267
|
+
def no?(message, **options, &block); end
|
|
268
|
+
|
|
269
|
+
# Print statement(s) out in red green.
|
|
270
|
+
#
|
|
271
|
+
# @api public
|
|
272
|
+
# @example
|
|
273
|
+
# prompt.ok "Are you sure?"
|
|
274
|
+
# prompt.ok "All is fine!", "This is fine too."
|
|
275
|
+
# @param messages [Array]
|
|
276
|
+
# @return [Array] messages
|
|
277
|
+
#
|
|
278
|
+
# source://tty-prompt//lib/tty/prompt.rb#437
|
|
279
|
+
def ok(*args, **options); end
|
|
280
|
+
|
|
281
|
+
# source://tty-prompt//lib/tty/prompt.rb#77
|
|
282
|
+
def on(*args, **_arg1, &block); end
|
|
283
|
+
|
|
284
|
+
# @api private
|
|
285
|
+
#
|
|
286
|
+
# source://tty-prompt//lib/tty/prompt.rb#36
|
|
287
|
+
def output; end
|
|
288
|
+
|
|
289
|
+
# Prompt prefix
|
|
290
|
+
#
|
|
291
|
+
# @api private
|
|
292
|
+
# @example
|
|
293
|
+
# prompt = TTY::Prompt.new(prefix: [?])
|
|
294
|
+
# @return [String]
|
|
295
|
+
#
|
|
296
|
+
# source://tty-prompt//lib/tty/prompt.rb#50
|
|
297
|
+
def prefix; end
|
|
298
|
+
|
|
299
|
+
# source://tty-prompt//lib/tty/prompt.rb#81
|
|
300
|
+
def print(*args, **_arg1, &block); end
|
|
301
|
+
|
|
302
|
+
# source://tty-prompt//lib/tty/prompt.rb#81
|
|
303
|
+
def puts(*args, **_arg1, &block); end
|
|
304
|
+
|
|
305
|
+
# Quiet mode
|
|
306
|
+
#
|
|
307
|
+
# @api private
|
|
308
|
+
#
|
|
309
|
+
# source://tty-prompt//lib/tty/prompt.rb#60
|
|
310
|
+
def quiet; end
|
|
311
|
+
|
|
312
|
+
# source://tty-prompt//lib/tty/prompt.rb#77
|
|
313
|
+
def read_char(*args, **_arg1, &block); end
|
|
314
|
+
|
|
315
|
+
# source://tty-prompt//lib/tty/prompt.rb#77
|
|
316
|
+
def read_keypress(*args, **_arg1, &block); end
|
|
317
|
+
|
|
318
|
+
# source://tty-prompt//lib/tty/prompt.rb#77
|
|
319
|
+
def read_line(*args, **_arg1, &block); end
|
|
320
|
+
|
|
321
|
+
# source://tty-prompt//lib/tty/prompt.rb#77
|
|
322
|
+
def read_multiline(*args, **_arg1, &block); end
|
|
323
|
+
|
|
324
|
+
# Returns the value of attribute reader.
|
|
325
|
+
#
|
|
326
|
+
# source://tty-prompt//lib/tty/prompt.rb#38
|
|
327
|
+
def reader; end
|
|
328
|
+
|
|
329
|
+
# Print statement out. If the supplied message ends with a space or
|
|
330
|
+
# tab character, a new line will not be appended.
|
|
331
|
+
#
|
|
332
|
+
# @api public
|
|
333
|
+
# @example
|
|
334
|
+
# say("Simple things.", color: :red)
|
|
335
|
+
# @param message [String]
|
|
336
|
+
# @return [String]
|
|
337
|
+
#
|
|
338
|
+
# source://tty-prompt//lib/tty/prompt.rb#418
|
|
339
|
+
def say(message = T.unsafe(nil), **options); end
|
|
340
|
+
|
|
341
|
+
# Ask a question with a list of options
|
|
342
|
+
#
|
|
343
|
+
# @api public
|
|
344
|
+
# @example
|
|
345
|
+
# prompt = TTY::Prompt.new
|
|
346
|
+
# prompt.select("What size?", %w(large medium small))
|
|
347
|
+
# @example
|
|
348
|
+
# prompt = TTY::Prompt.new
|
|
349
|
+
# prompt.select("What size?") do |menu|
|
|
350
|
+
# menu.choice :large
|
|
351
|
+
# menu.choices %w(:medium :small)
|
|
352
|
+
# end
|
|
353
|
+
# @param choices [Array[Object]] the choices to select from
|
|
354
|
+
# @param question [String] the question to ask
|
|
355
|
+
#
|
|
356
|
+
# source://tty-prompt//lib/tty/prompt.rb#285
|
|
357
|
+
def select(question, *args, &block); end
|
|
358
|
+
|
|
359
|
+
# source://tty-prompt//lib/tty/prompt.rb#74
|
|
360
|
+
def show(*args, **_arg1, &block); end
|
|
361
|
+
|
|
362
|
+
# Ask a question with a range slider
|
|
363
|
+
#
|
|
364
|
+
# @api public
|
|
365
|
+
# @example
|
|
366
|
+
# prompt = TTY::Prompt.new
|
|
367
|
+
# prompt.slider("What size?", min: 32, max: 54, step: 2)
|
|
368
|
+
# prompt.slider("What size?", [ 'xs', 's', 'm', 'l', 'xl' ])
|
|
369
|
+
# @param choices [Array] the choices to display
|
|
370
|
+
# @param question [String] the question to ask
|
|
371
|
+
# @return [String]
|
|
372
|
+
#
|
|
373
|
+
# source://tty-prompt//lib/tty/prompt.rb#402
|
|
374
|
+
def slider(question, choices = T.unsafe(nil), **options, &block); end
|
|
375
|
+
|
|
376
|
+
# Return standard error
|
|
377
|
+
#
|
|
378
|
+
# @api private
|
|
379
|
+
#
|
|
380
|
+
# source://tty-prompt//lib/tty/prompt.rb#565
|
|
381
|
+
def stderr; end
|
|
382
|
+
|
|
383
|
+
# Return standard in
|
|
384
|
+
#
|
|
385
|
+
# @api private
|
|
386
|
+
#
|
|
387
|
+
# source://tty-prompt//lib/tty/prompt.rb#551
|
|
388
|
+
def stdin; end
|
|
389
|
+
|
|
390
|
+
# Return standard out
|
|
391
|
+
#
|
|
392
|
+
# @api private
|
|
393
|
+
#
|
|
394
|
+
# source://tty-prompt//lib/tty/prompt.rb#558
|
|
395
|
+
def stdout; end
|
|
396
|
+
|
|
397
|
+
# source://tty-prompt//lib/tty/prompt.rb#72
|
|
398
|
+
def strip(*args, **_arg1, &block); end
|
|
399
|
+
|
|
400
|
+
# source://tty-prompt//lib/tty/prompt.rb#77
|
|
401
|
+
def subscribe(*args, **_arg1, &block); end
|
|
402
|
+
|
|
403
|
+
# Takes the string provided by the user and compare it with other possible
|
|
404
|
+
# matches to suggest an unambigous string
|
|
405
|
+
#
|
|
406
|
+
# @api public
|
|
407
|
+
# @example
|
|
408
|
+
# prompt.suggest("sta", ["status", "stage", "commit", "branch"])
|
|
409
|
+
# # => "status, stage"
|
|
410
|
+
# @option options
|
|
411
|
+
# @option options
|
|
412
|
+
# @option options
|
|
413
|
+
# @param message [String]
|
|
414
|
+
# @param options [Hash]
|
|
415
|
+
# @param possibilities [Array]
|
|
416
|
+
# @return [String]
|
|
417
|
+
#
|
|
418
|
+
# source://tty-prompt//lib/tty/prompt.rb#518
|
|
419
|
+
def suggest(message, possibilities, **options); end
|
|
420
|
+
|
|
421
|
+
# The collection of display symbols
|
|
422
|
+
#
|
|
423
|
+
# @api private
|
|
424
|
+
# @example
|
|
425
|
+
# prompt = TTY::Prompt.new(symbols: {marker: ">"})
|
|
426
|
+
# @return [Hash]
|
|
427
|
+
#
|
|
428
|
+
# source://tty-prompt//lib/tty/prompt.rb#70
|
|
429
|
+
def symbols; end
|
|
430
|
+
|
|
431
|
+
# source://tty-prompt//lib/tty/prompt.rb#77
|
|
432
|
+
def trigger(*args, **_arg1, &block); end
|
|
433
|
+
|
|
434
|
+
# Check if outputing to terminal
|
|
435
|
+
#
|
|
436
|
+
# @api public
|
|
437
|
+
# @return [Boolean]
|
|
438
|
+
#
|
|
439
|
+
# source://tty-prompt//lib/tty/prompt.rb#544
|
|
440
|
+
def tty?; end
|
|
441
|
+
|
|
442
|
+
# source://tty-prompt//lib/tty/prompt.rb#77
|
|
443
|
+
def unsubscribe(*args, **_arg1, &block); end
|
|
444
|
+
|
|
445
|
+
# Print statement(s) out in yellow color.
|
|
446
|
+
#
|
|
447
|
+
# @api public
|
|
448
|
+
# @example
|
|
449
|
+
# prompt.warn "This action can have dire consequences"
|
|
450
|
+
# prompt.warn "Carefull young apprentice", "This is potentially dangerous"
|
|
451
|
+
# @param messages [Array]
|
|
452
|
+
# @return [Array] messages
|
|
453
|
+
#
|
|
454
|
+
# source://tty-prompt//lib/tty/prompt.rb#453
|
|
455
|
+
def warn(*args, **options); end
|
|
456
|
+
|
|
457
|
+
# A shortcut method to ask the user positive question and return
|
|
458
|
+
# true for "yes" reply, false for "no".
|
|
459
|
+
#
|
|
460
|
+
# @api public
|
|
461
|
+
# @example
|
|
462
|
+
# prompt = TTY::Prompt.new
|
|
463
|
+
# prompt.yes?("Are you human?")
|
|
464
|
+
# # => Are you human? (Y/n)
|
|
465
|
+
# @return [Boolean]
|
|
466
|
+
#
|
|
467
|
+
# source://tty-prompt//lib/tty/prompt.rb#340
|
|
468
|
+
def yes?(message, **options, &block); end
|
|
469
|
+
|
|
470
|
+
class << self
|
|
471
|
+
# source://tty-prompt//lib/tty/prompt.rb#83
|
|
472
|
+
def messages; end
|
|
473
|
+
end
|
|
474
|
+
end
|
|
475
|
+
|
|
476
|
+
# source://tty-prompt//lib/tty/prompt/answers_collector.rb#5
|
|
477
|
+
class TTY::Prompt::AnswersCollector
|
|
478
|
+
# Initialize answer collector
|
|
479
|
+
#
|
|
480
|
+
# @api public
|
|
481
|
+
# @return [AnswersCollector] a new instance of AnswersCollector
|
|
482
|
+
#
|
|
483
|
+
# source://tty-prompt//lib/tty/prompt/answers_collector.rb#9
|
|
484
|
+
def initialize(prompt, **options); end
|
|
485
|
+
|
|
486
|
+
# @api public
|
|
487
|
+
#
|
|
488
|
+
# source://tty-prompt//lib/tty/prompt/answers_collector.rb#61
|
|
489
|
+
def add_answer(answer); end
|
|
490
|
+
|
|
491
|
+
# Start gathering answers
|
|
492
|
+
#
|
|
493
|
+
# @api public
|
|
494
|
+
# @return [Hash] the collection of all answers
|
|
495
|
+
#
|
|
496
|
+
# source://tty-prompt//lib/tty/prompt/answers_collector.rb#20
|
|
497
|
+
def call(&block); end
|
|
498
|
+
|
|
499
|
+
# @api public
|
|
500
|
+
#
|
|
501
|
+
# source://tty-prompt//lib/tty/prompt/answers_collector.rb#56
|
|
502
|
+
def create_collector; end
|
|
503
|
+
|
|
504
|
+
# Create answer entry
|
|
505
|
+
#
|
|
506
|
+
# @api public
|
|
507
|
+
# @example
|
|
508
|
+
# key(:name).ask("Name?")
|
|
509
|
+
#
|
|
510
|
+
# source://tty-prompt//lib/tty/prompt/answers_collector.rb#31
|
|
511
|
+
def key(name, &block); end
|
|
512
|
+
|
|
513
|
+
# Change to collect all values for a key
|
|
514
|
+
#
|
|
515
|
+
# @api public
|
|
516
|
+
# @example
|
|
517
|
+
# key(:colors).values.ask("Color?")
|
|
518
|
+
#
|
|
519
|
+
# source://tty-prompt//lib/tty/prompt/answers_collector.rb#46
|
|
520
|
+
def values(&block); end
|
|
521
|
+
|
|
522
|
+
private
|
|
523
|
+
|
|
524
|
+
# @api private
|
|
525
|
+
#
|
|
526
|
+
# source://tty-prompt//lib/tty/prompt/answers_collector.rb#72
|
|
527
|
+
def method_missing(method, *args, **options, &block); end
|
|
528
|
+
end
|
|
529
|
+
|
|
530
|
+
# Raised when the required argument is not supplied
|
|
531
|
+
#
|
|
532
|
+
# source://tty-prompt//lib/tty/prompt/errors.rb#17
|
|
533
|
+
class TTY::Prompt::ArgumentRequired < ::TTY::Prompt::Error; end
|
|
534
|
+
|
|
535
|
+
# Raised when the argument validation fails
|
|
536
|
+
#
|
|
537
|
+
# source://tty-prompt//lib/tty/prompt/errors.rb#20
|
|
538
|
+
class TTY::Prompt::ArgumentValidation < ::TTY::Prompt::Error; end
|
|
539
|
+
|
|
540
|
+
# source://tty-prompt//lib/tty/prompt/block_paginator.rb#7
|
|
541
|
+
class TTY::Prompt::BlockPaginator < ::TTY::Prompt::Paginator
|
|
542
|
+
# Paginate list of choices based on current active choice.
|
|
543
|
+
# Move entire pages.
|
|
544
|
+
#
|
|
545
|
+
# @api public
|
|
546
|
+
#
|
|
547
|
+
# source://tty-prompt//lib/tty/prompt/block_paginator.rb#12
|
|
548
|
+
def paginate(list, active, per_page = T.unsafe(nil), &block); end
|
|
549
|
+
end
|
|
550
|
+
|
|
551
|
+
# An immutable representation of a single choice option from select menu
|
|
552
|
+
#
|
|
553
|
+
# @api public
|
|
554
|
+
#
|
|
555
|
+
# source://tty-prompt//lib/tty/prompt/choice.rb#8
|
|
556
|
+
class TTY::Prompt::Choice
|
|
557
|
+
# Create a Choice instance
|
|
558
|
+
#
|
|
559
|
+
# @api public
|
|
560
|
+
# @return [Choice] a new instance of Choice
|
|
561
|
+
#
|
|
562
|
+
# source://tty-prompt//lib/tty/prompt/choice.rb#95
|
|
563
|
+
def initialize(name, value, **options); end
|
|
564
|
+
|
|
565
|
+
# Object equality comparison
|
|
566
|
+
#
|
|
567
|
+
# @api public
|
|
568
|
+
# @return [Boolean]
|
|
569
|
+
#
|
|
570
|
+
# source://tty-prompt//lib/tty/prompt/choice.rb#129
|
|
571
|
+
def ==(other); end
|
|
572
|
+
|
|
573
|
+
# The text to display for disabled choice
|
|
574
|
+
#
|
|
575
|
+
# @api public
|
|
576
|
+
#
|
|
577
|
+
# source://tty-prompt//lib/tty/prompt/choice.rb#90
|
|
578
|
+
def disabled; end
|
|
579
|
+
|
|
580
|
+
# Check if this choice is disabled
|
|
581
|
+
#
|
|
582
|
+
# @api public
|
|
583
|
+
# @return [Boolean]
|
|
584
|
+
#
|
|
585
|
+
# source://tty-prompt//lib/tty/prompt/choice.rb#108
|
|
586
|
+
def disabled?; end
|
|
587
|
+
|
|
588
|
+
# The keyboard key to activate this choice
|
|
589
|
+
#
|
|
590
|
+
# @api public
|
|
591
|
+
#
|
|
592
|
+
# source://tty-prompt//lib/tty/prompt/choice.rb#85
|
|
593
|
+
def key; end
|
|
594
|
+
|
|
595
|
+
# The label name
|
|
596
|
+
#
|
|
597
|
+
# @api public
|
|
598
|
+
#
|
|
599
|
+
# source://tty-prompt//lib/tty/prompt/choice.rb#80
|
|
600
|
+
def name; end
|
|
601
|
+
|
|
602
|
+
# Object string representation
|
|
603
|
+
#
|
|
604
|
+
# @api public
|
|
605
|
+
# @return [String]
|
|
606
|
+
#
|
|
607
|
+
# source://tty-prompt//lib/tty/prompt/choice.rb#142
|
|
608
|
+
def to_s; end
|
|
609
|
+
|
|
610
|
+
# Read value and evaluate
|
|
611
|
+
#
|
|
612
|
+
# @api public
|
|
613
|
+
#
|
|
614
|
+
# source://tty-prompt//lib/tty/prompt/choice.rb#115
|
|
615
|
+
def value; end
|
|
616
|
+
|
|
617
|
+
class << self
|
|
618
|
+
# Convert an array into choice
|
|
619
|
+
#
|
|
620
|
+
# @api public
|
|
621
|
+
# @param [Array<Object>]
|
|
622
|
+
# @return [Choice]
|
|
623
|
+
#
|
|
624
|
+
# source://tty-prompt//lib/tty/prompt/choice.rb#49
|
|
625
|
+
def convert_array(val); end
|
|
626
|
+
|
|
627
|
+
# Convert a hash into choice
|
|
628
|
+
#
|
|
629
|
+
# @api public
|
|
630
|
+
# @param [Hash<Symbol,Object>]
|
|
631
|
+
# @return [Choice]
|
|
632
|
+
#
|
|
633
|
+
# source://tty-prompt//lib/tty/prompt/choice.rb#67
|
|
634
|
+
def convert_hash(val); end
|
|
635
|
+
|
|
636
|
+
# Create choice from value
|
|
637
|
+
#
|
|
638
|
+
# @api public
|
|
639
|
+
# @param val [Object] the value to be converted
|
|
640
|
+
# @raise [ArgumentError]
|
|
641
|
+
# @return [Choice]
|
|
642
|
+
#
|
|
643
|
+
# source://tty-prompt//lib/tty/prompt/choice.rb#29
|
|
644
|
+
def from(val); end
|
|
645
|
+
end
|
|
646
|
+
end
|
|
647
|
+
|
|
648
|
+
# A class responsible for storing a collection of choices
|
|
649
|
+
#
|
|
650
|
+
# @api private
|
|
651
|
+
#
|
|
652
|
+
# source://tty-prompt//lib/tty/prompt/choices.rb#12
|
|
653
|
+
class TTY::Prompt::Choices
|
|
654
|
+
include ::Enumerable
|
|
655
|
+
extend ::Forwardable
|
|
656
|
+
|
|
657
|
+
# Create Choices collection
|
|
658
|
+
#
|
|
659
|
+
# @api public
|
|
660
|
+
# @param choices [Array[Choice]] the choices to add to collection
|
|
661
|
+
# @return [Choices] a new instance of Choices
|
|
662
|
+
#
|
|
663
|
+
# source://tty-prompt//lib/tty/prompt/choices.rb#38
|
|
664
|
+
def initialize(choices = T.unsafe(nil)); end
|
|
665
|
+
|
|
666
|
+
# Add choice to collection
|
|
667
|
+
#
|
|
668
|
+
# @api public
|
|
669
|
+
# @param choice [Object] the choice to add
|
|
670
|
+
#
|
|
671
|
+
# source://tty-prompt//lib/tty/prompt/choices.rb#75
|
|
672
|
+
def <<(choice); end
|
|
673
|
+
|
|
674
|
+
# source://tty-prompt//lib/tty/prompt/choices.rb#16
|
|
675
|
+
def ==(*args, **_arg1, &block); end
|
|
676
|
+
|
|
677
|
+
# Access choice by index
|
|
678
|
+
#
|
|
679
|
+
# @api public
|
|
680
|
+
# @param index [Integer]
|
|
681
|
+
# @return [Choice]
|
|
682
|
+
#
|
|
683
|
+
# source://tty-prompt//lib/tty/prompt/choices.rb#86
|
|
684
|
+
def [](index); end
|
|
685
|
+
|
|
686
|
+
# Iterate over all choices in the collection
|
|
687
|
+
#
|
|
688
|
+
# @api public
|
|
689
|
+
# @yield [Choice]
|
|
690
|
+
#
|
|
691
|
+
# source://tty-prompt//lib/tty/prompt/choices.rb#63
|
|
692
|
+
def each(&block); end
|
|
693
|
+
|
|
694
|
+
# source://tty-prompt//lib/tty/prompt/choices.rb#16
|
|
695
|
+
def empty?(*args, **_arg1, &block); end
|
|
696
|
+
|
|
697
|
+
# Scope of choices which are not disabled
|
|
698
|
+
#
|
|
699
|
+
# @api public
|
|
700
|
+
#
|
|
701
|
+
# source://tty-prompt//lib/tty/prompt/choices.rb#47
|
|
702
|
+
def enabled; end
|
|
703
|
+
|
|
704
|
+
# @api private
|
|
705
|
+
#
|
|
706
|
+
# source://tty-prompt//lib/tty/prompt/choices.rb#51
|
|
707
|
+
def enabled_indexes; end
|
|
708
|
+
|
|
709
|
+
# Find a matching choice
|
|
710
|
+
#
|
|
711
|
+
# @api public
|
|
712
|
+
# @example
|
|
713
|
+
# choices.find_by(:name, "small")
|
|
714
|
+
# @param attr [Symbol] the attribute name
|
|
715
|
+
# @param value [Object]
|
|
716
|
+
# @return [Choice]
|
|
717
|
+
#
|
|
718
|
+
# source://tty-prompt//lib/tty/prompt/choices.rb#114
|
|
719
|
+
def find_by(attr, value); end
|
|
720
|
+
|
|
721
|
+
# source://tty-prompt//lib/tty/prompt/choices.rb#16
|
|
722
|
+
def index(*args, **_arg1, &block); end
|
|
723
|
+
|
|
724
|
+
# source://tty-prompt//lib/tty/prompt/choices.rb#16
|
|
725
|
+
def length(*args, **_arg1, &block); end
|
|
726
|
+
|
|
727
|
+
# Pluck a choice by its name from collection
|
|
728
|
+
#
|
|
729
|
+
# @api public
|
|
730
|
+
# @param name [String] the label name for the choice
|
|
731
|
+
# @return [Choice]
|
|
732
|
+
#
|
|
733
|
+
# source://tty-prompt//lib/tty/prompt/choices.rb#98
|
|
734
|
+
def pluck(name); end
|
|
735
|
+
|
|
736
|
+
# source://tty-prompt//lib/tty/prompt/choices.rb#16
|
|
737
|
+
def size(*args, **_arg1, &block); end
|
|
738
|
+
|
|
739
|
+
# source://tty-prompt//lib/tty/prompt/choices.rb#16
|
|
740
|
+
def to_ary(*args, **_arg1, &block); end
|
|
741
|
+
|
|
742
|
+
# source://tty-prompt//lib/tty/prompt/choices.rb#16
|
|
743
|
+
def values_at(*args, **_arg1, &block); end
|
|
744
|
+
|
|
745
|
+
protected
|
|
746
|
+
|
|
747
|
+
# The actual collection choices
|
|
748
|
+
#
|
|
749
|
+
# @api private
|
|
750
|
+
# @return [Array[Choice]]
|
|
751
|
+
#
|
|
752
|
+
# source://tty-prompt//lib/tty/prompt/choices.rb#126
|
|
753
|
+
def choices; end
|
|
754
|
+
|
|
755
|
+
class << self
|
|
756
|
+
# Convenience for creating choices
|
|
757
|
+
#
|
|
758
|
+
# @api public
|
|
759
|
+
# @param choices [Array[Object]] the choice objects
|
|
760
|
+
# @return [Choices] the choices collection
|
|
761
|
+
#
|
|
762
|
+
# source://tty-prompt//lib/tty/prompt/choices.rb#28
|
|
763
|
+
def [](*choices); end
|
|
764
|
+
end
|
|
765
|
+
end
|
|
766
|
+
|
|
767
|
+
# Raised when wrong parameter is used to configure prompt
|
|
768
|
+
#
|
|
769
|
+
# source://tty-prompt//lib/tty/prompt/errors.rb#8
|
|
770
|
+
class TTY::Prompt::ConfigurationError < ::TTY::Prompt::Error; end
|
|
771
|
+
|
|
772
|
+
# source://tty-prompt//lib/tty/prompt/confirm_question.rb#8
|
|
773
|
+
class TTY::Prompt::ConfirmQuestion < ::TTY::Prompt::Question
|
|
774
|
+
# Create confirmation question
|
|
775
|
+
#
|
|
776
|
+
# @api public
|
|
777
|
+
# @option options
|
|
778
|
+
# @option options
|
|
779
|
+
# @option options
|
|
780
|
+
# @param options [Hash]
|
|
781
|
+
# @return [ConfirmQuestion] a new instance of ConfirmQuestion
|
|
782
|
+
#
|
|
783
|
+
# source://tty-prompt//lib/tty/prompt/confirm_question.rb#17
|
|
784
|
+
def initialize(prompt, **options); end
|
|
785
|
+
|
|
786
|
+
# source://tty-prompt//lib/tty/prompt/confirm_question.rb#63
|
|
787
|
+
def call(message, &block); end
|
|
788
|
+
|
|
789
|
+
# Set value for matching negative choice
|
|
790
|
+
#
|
|
791
|
+
# @api public
|
|
792
|
+
#
|
|
793
|
+
# source://tty-prompt//lib/tty/prompt/confirm_question.rb#57
|
|
794
|
+
def negative(value = T.unsafe(nil)); end
|
|
795
|
+
|
|
796
|
+
# @return [Boolean]
|
|
797
|
+
#
|
|
798
|
+
# source://tty-prompt//lib/tty/prompt/confirm_question.rb#28
|
|
799
|
+
def negative?; end
|
|
800
|
+
|
|
801
|
+
# Set value for matching positive choice
|
|
802
|
+
#
|
|
803
|
+
# @api public
|
|
804
|
+
#
|
|
805
|
+
# source://tty-prompt//lib/tty/prompt/confirm_question.rb#48
|
|
806
|
+
def positive(value = T.unsafe(nil)); end
|
|
807
|
+
|
|
808
|
+
# @return [Boolean]
|
|
809
|
+
#
|
|
810
|
+
# source://tty-prompt//lib/tty/prompt/confirm_question.rb#24
|
|
811
|
+
def positive?; end
|
|
812
|
+
|
|
813
|
+
# Render confirmation question
|
|
814
|
+
#
|
|
815
|
+
# @api private
|
|
816
|
+
# @return [String]
|
|
817
|
+
#
|
|
818
|
+
# source://tty-prompt//lib/tty/prompt/confirm_question.rb#77
|
|
819
|
+
def render_question; end
|
|
820
|
+
|
|
821
|
+
# Set question suffix
|
|
822
|
+
#
|
|
823
|
+
# @api public
|
|
824
|
+
#
|
|
825
|
+
# source://tty-prompt//lib/tty/prompt/confirm_question.rb#39
|
|
826
|
+
def suffix(value = T.unsafe(nil)); end
|
|
827
|
+
|
|
828
|
+
# @return [Boolean]
|
|
829
|
+
#
|
|
830
|
+
# source://tty-prompt//lib/tty/prompt/confirm_question.rb#32
|
|
831
|
+
def suffix?; end
|
|
832
|
+
|
|
833
|
+
protected
|
|
834
|
+
|
|
835
|
+
# Create custom conversion
|
|
836
|
+
#
|
|
837
|
+
# @api private
|
|
838
|
+
#
|
|
839
|
+
# source://tty-prompt//lib/tty/prompt/confirm_question.rb#148
|
|
840
|
+
def conversion; end
|
|
841
|
+
|
|
842
|
+
# @api private
|
|
843
|
+
#
|
|
844
|
+
# source://tty-prompt//lib/tty/prompt/confirm_question.rb#131
|
|
845
|
+
def create_default_labels; end
|
|
846
|
+
|
|
847
|
+
# @api private
|
|
848
|
+
#
|
|
849
|
+
# source://tty-prompt//lib/tty/prompt/confirm_question.rb#140
|
|
850
|
+
def create_suffix; end
|
|
851
|
+
|
|
852
|
+
# @api private
|
|
853
|
+
#
|
|
854
|
+
# source://tty-prompt//lib/tty/prompt/confirm_question.rb#121
|
|
855
|
+
def infer_default; end
|
|
856
|
+
|
|
857
|
+
# Decide how to handle input from user
|
|
858
|
+
#
|
|
859
|
+
# @api private
|
|
860
|
+
#
|
|
861
|
+
# source://tty-prompt//lib/tty/prompt/confirm_question.rb#95
|
|
862
|
+
def process_input(question); end
|
|
863
|
+
|
|
864
|
+
# @api private
|
|
865
|
+
#
|
|
866
|
+
# source://tty-prompt//lib/tty/prompt/confirm_question.rb#104
|
|
867
|
+
def setup_defaults; end
|
|
868
|
+
end
|
|
869
|
+
|
|
870
|
+
# source://tty-prompt//lib/tty/prompt/const.rb#5
|
|
871
|
+
module TTY::Prompt::Const; end
|
|
872
|
+
|
|
873
|
+
# source://tty-prompt//lib/tty/prompt/const.rb#6
|
|
874
|
+
TTY::Prompt::Const::Undefined = T.let(T.unsafe(nil), Object)
|
|
875
|
+
|
|
876
|
+
# Raised when overriding already defined conversion
|
|
877
|
+
#
|
|
878
|
+
# source://tty-prompt//lib/tty/prompt/errors.rb#26
|
|
879
|
+
class TTY::Prompt::ConversionAlreadyDefined < ::TTY::Prompt::Error; end
|
|
880
|
+
|
|
881
|
+
# Raised when type conversion cannot be performed
|
|
882
|
+
#
|
|
883
|
+
# source://tty-prompt//lib/tty/prompt/errors.rb#11
|
|
884
|
+
class TTY::Prompt::ConversionError < ::TTY::Prompt::Error; end
|
|
885
|
+
|
|
886
|
+
# source://tty-prompt//lib/tty/prompt/converter_dsl.rb#7
|
|
887
|
+
module TTY::Prompt::ConverterDSL
|
|
888
|
+
# source://tty-prompt//lib/tty/prompt/converter_dsl.rb#16
|
|
889
|
+
def convert(name, input); end
|
|
890
|
+
|
|
891
|
+
# source://tty-prompt//lib/tty/prompt/converter_dsl.rb#12
|
|
892
|
+
def converter(*names, &block); end
|
|
893
|
+
|
|
894
|
+
# source://tty-prompt//lib/tty/prompt/converter_dsl.rb#8
|
|
895
|
+
def converter_registry; end
|
|
896
|
+
end
|
|
897
|
+
|
|
898
|
+
# Immutable collection of converters for type transformation
|
|
899
|
+
#
|
|
900
|
+
# @api private
|
|
901
|
+
#
|
|
902
|
+
# source://tty-prompt//lib/tty/prompt/converter_registry.rb#10
|
|
903
|
+
class TTY::Prompt::ConverterRegistry
|
|
904
|
+
extend ::Forwardable
|
|
905
|
+
|
|
906
|
+
# Create a registry of conversions
|
|
907
|
+
#
|
|
908
|
+
# @api private
|
|
909
|
+
# @param registry [Hash]
|
|
910
|
+
# @return [ConverterRegistry] a new instance of ConverterRegistry
|
|
911
|
+
#
|
|
912
|
+
# source://tty-prompt//lib/tty/prompt/converter_registry.rb#20
|
|
913
|
+
def initialize(registry = T.unsafe(nil)); end
|
|
914
|
+
|
|
915
|
+
# Execute converter
|
|
916
|
+
#
|
|
917
|
+
# @api public
|
|
918
|
+
#
|
|
919
|
+
# source://tty-prompt//lib/tty/prompt/converter_registry.rb#55
|
|
920
|
+
def [](name); end
|
|
921
|
+
|
|
922
|
+
# Check if conversion is available
|
|
923
|
+
#
|
|
924
|
+
# @api public
|
|
925
|
+
# @param name [String]
|
|
926
|
+
# @return [Boolean]
|
|
927
|
+
#
|
|
928
|
+
# source://tty-prompt//lib/tty/prompt/converter_registry.rb#31
|
|
929
|
+
def contain?(name); end
|
|
930
|
+
|
|
931
|
+
# Execute converter
|
|
932
|
+
#
|
|
933
|
+
# @api public
|
|
934
|
+
#
|
|
935
|
+
# source://tty-prompt//lib/tty/prompt/converter_registry.rb#62
|
|
936
|
+
def fetch(name); end
|
|
937
|
+
|
|
938
|
+
# @api private
|
|
939
|
+
#
|
|
940
|
+
# source://tty-prompt//lib/tty/prompt/converter_registry.rb#64
|
|
941
|
+
def inspect; end
|
|
942
|
+
|
|
943
|
+
# source://tty-prompt//lib/tty/prompt/converter_registry.rb#13
|
|
944
|
+
def keys(*args, **_arg1, &block); end
|
|
945
|
+
|
|
946
|
+
# Register a conversion
|
|
947
|
+
#
|
|
948
|
+
# @api public
|
|
949
|
+
# @param name [Symbol] the converter name
|
|
950
|
+
#
|
|
951
|
+
# source://tty-prompt//lib/tty/prompt/converter_registry.rb#42
|
|
952
|
+
def register(*names, &block); end
|
|
953
|
+
end
|
|
954
|
+
|
|
955
|
+
# source://tty-prompt//lib/tty/prompt/converters.rb#8
|
|
956
|
+
module TTY::Prompt::Converters
|
|
957
|
+
extend ::TTY::Prompt::ConverterDSL
|
|
958
|
+
|
|
959
|
+
private
|
|
960
|
+
|
|
961
|
+
# Convert string number to integer or float
|
|
962
|
+
#
|
|
963
|
+
# @api private
|
|
964
|
+
# @return [Integer, Float, Const::Undefined]
|
|
965
|
+
#
|
|
966
|
+
# source://tty-prompt//lib/tty/prompt/converters.rb#92
|
|
967
|
+
def cast_to_num(num); end
|
|
968
|
+
|
|
969
|
+
class << self
|
|
970
|
+
# Convert string number to integer or float
|
|
971
|
+
#
|
|
972
|
+
# @api private
|
|
973
|
+
# @return [Integer, Float, Const::Undefined]
|
|
974
|
+
#
|
|
975
|
+
# source://tty-prompt//lib/tty/prompt/converters.rb#96
|
|
976
|
+
def cast_to_num(num); end
|
|
977
|
+
end
|
|
978
|
+
end
|
|
979
|
+
|
|
980
|
+
# source://tty-prompt//lib/tty/prompt/converters.rb#15
|
|
981
|
+
TTY::Prompt::Converters::DIGIT_MATCHER = T.let(T.unsafe(nil), Regexp)
|
|
982
|
+
|
|
983
|
+
# source://tty-prompt//lib/tty/prompt/converters.rb#12
|
|
984
|
+
TTY::Prompt::Converters::FALSE_VALUES = T.let(T.unsafe(nil), Regexp)
|
|
985
|
+
|
|
986
|
+
# source://tty-prompt//lib/tty/prompt/converters.rb#19
|
|
987
|
+
TTY::Prompt::Converters::LETTER_MATCHER = T.let(T.unsafe(nil), Regexp)
|
|
988
|
+
|
|
989
|
+
# source://tty-prompt//lib/tty/prompt/converters.rb#14
|
|
990
|
+
TTY::Prompt::Converters::SINGLE_DIGIT_MATCHER = T.let(T.unsafe(nil), Regexp)
|
|
991
|
+
|
|
992
|
+
# source://tty-prompt//lib/tty/prompt/converters.rb#11
|
|
993
|
+
TTY::Prompt::Converters::TRUE_VALUES = T.let(T.unsafe(nil), Regexp)
|
|
994
|
+
|
|
995
|
+
# A class responsible for string comparison
|
|
996
|
+
#
|
|
997
|
+
# source://tty-prompt//lib/tty/prompt/distance.rb#6
|
|
998
|
+
class TTY::Prompt::Distance
|
|
999
|
+
# Calculate the optimal string alignment distance
|
|
1000
|
+
#
|
|
1001
|
+
# @api public
|
|
1002
|
+
#
|
|
1003
|
+
# source://tty-prompt//lib/tty/prompt/distance.rb#10
|
|
1004
|
+
def distance(first, second); end
|
|
1005
|
+
end
|
|
1006
|
+
|
|
1007
|
+
# A class reponsible for rendering enumerated list menu.
|
|
1008
|
+
# Used by {Prompt} to display static choice menu.
|
|
1009
|
+
#
|
|
1010
|
+
# @api private
|
|
1011
|
+
#
|
|
1012
|
+
# source://tty-prompt//lib/tty/prompt/enum_list.rb#15
|
|
1013
|
+
class TTY::Prompt::EnumList
|
|
1014
|
+
# Create instance of EnumList menu.
|
|
1015
|
+
#
|
|
1016
|
+
# @api public
|
|
1017
|
+
# @return [EnumList] a new instance of EnumList
|
|
1018
|
+
#
|
|
1019
|
+
# source://tty-prompt//lib/tty/prompt/enum_list.rb#24
|
|
1020
|
+
def initialize(prompt, **options); end
|
|
1021
|
+
|
|
1022
|
+
# Call the list menu by passing question and choices
|
|
1023
|
+
#
|
|
1024
|
+
# @api public
|
|
1025
|
+
# @param
|
|
1026
|
+
# @param question [String]
|
|
1027
|
+
#
|
|
1028
|
+
# source://tty-prompt//lib/tty/prompt/enum_list.rb#147
|
|
1029
|
+
def call(question, possibilities, &block); end
|
|
1030
|
+
|
|
1031
|
+
# Add a single choice
|
|
1032
|
+
#
|
|
1033
|
+
# @api public
|
|
1034
|
+
#
|
|
1035
|
+
# source://tty-prompt//lib/tty/prompt/enum_list.rb#119
|
|
1036
|
+
def choice(*value, &block); end
|
|
1037
|
+
|
|
1038
|
+
# Add multiple choices
|
|
1039
|
+
#
|
|
1040
|
+
# @api public
|
|
1041
|
+
# @param values [Array[Object]] the values to add as choices
|
|
1042
|
+
#
|
|
1043
|
+
# source://tty-prompt//lib/tty/prompt/enum_list.rb#133
|
|
1044
|
+
def choices(values = T.unsafe(nil)); end
|
|
1045
|
+
|
|
1046
|
+
# Set default option selected
|
|
1047
|
+
#
|
|
1048
|
+
# @api public
|
|
1049
|
+
#
|
|
1050
|
+
# source://tty-prompt//lib/tty/prompt/enum_list.rb#62
|
|
1051
|
+
def default(default); end
|
|
1052
|
+
|
|
1053
|
+
# Check if default value is set
|
|
1054
|
+
#
|
|
1055
|
+
# @api public
|
|
1056
|
+
# @return [Boolean]
|
|
1057
|
+
#
|
|
1058
|
+
# source://tty-prompt//lib/tty/prompt/enum_list.rb#71
|
|
1059
|
+
def default?; end
|
|
1060
|
+
|
|
1061
|
+
# Set selecting active index using number pad
|
|
1062
|
+
#
|
|
1063
|
+
# @api public
|
|
1064
|
+
#
|
|
1065
|
+
# source://tty-prompt//lib/tty/prompt/enum_list.rb#105
|
|
1066
|
+
def enum(value); end
|
|
1067
|
+
|
|
1068
|
+
# @api private
|
|
1069
|
+
#
|
|
1070
|
+
# source://tty-prompt//lib/tty/prompt/enum_list.rb#182
|
|
1071
|
+
def keyenter(*_arg0); end
|
|
1072
|
+
|
|
1073
|
+
# @api private
|
|
1074
|
+
#
|
|
1075
|
+
# source://tty-prompt//lib/tty/prompt/enum_list.rb#193
|
|
1076
|
+
def keyleft(*_arg0); end
|
|
1077
|
+
|
|
1078
|
+
# @api private
|
|
1079
|
+
#
|
|
1080
|
+
# source://tty-prompt//lib/tty/prompt/enum_list.rb#157
|
|
1081
|
+
def keypress(event); end
|
|
1082
|
+
|
|
1083
|
+
# @api private
|
|
1084
|
+
#
|
|
1085
|
+
# source://tty-prompt//lib/tty/prompt/enum_list.rb#169
|
|
1086
|
+
def keyreturn(*_arg0); end
|
|
1087
|
+
|
|
1088
|
+
# @api private
|
|
1089
|
+
#
|
|
1090
|
+
# source://tty-prompt//lib/tty/prompt/enum_list.rb#184
|
|
1091
|
+
def keyright(*_arg0); end
|
|
1092
|
+
|
|
1093
|
+
# @api private
|
|
1094
|
+
#
|
|
1095
|
+
# source://tty-prompt//lib/tty/prompt/enum_list.rb#191
|
|
1096
|
+
def keytab(*_arg0); end
|
|
1097
|
+
|
|
1098
|
+
# @api pbulic
|
|
1099
|
+
# @param text [String] the help text to display per page
|
|
1100
|
+
#
|
|
1101
|
+
# source://tty-prompt//lib/tty/prompt/enum_list.rb#98
|
|
1102
|
+
def page_help(text); end
|
|
1103
|
+
|
|
1104
|
+
# @api private
|
|
1105
|
+
#
|
|
1106
|
+
# source://tty-prompt//lib/tty/prompt/enum_list.rb#82
|
|
1107
|
+
def page_size; end
|
|
1108
|
+
|
|
1109
|
+
# Check if list is paginated
|
|
1110
|
+
#
|
|
1111
|
+
# @api private
|
|
1112
|
+
# @return [Boolean]
|
|
1113
|
+
#
|
|
1114
|
+
# source://tty-prompt//lib/tty/prompt/enum_list.rb#91
|
|
1115
|
+
def paginated?; end
|
|
1116
|
+
|
|
1117
|
+
# Set number of items per page
|
|
1118
|
+
#
|
|
1119
|
+
# @api public
|
|
1120
|
+
#
|
|
1121
|
+
# source://tty-prompt//lib/tty/prompt/enum_list.rb#78
|
|
1122
|
+
def per_page(value); end
|
|
1123
|
+
|
|
1124
|
+
# Set quiet mode
|
|
1125
|
+
#
|
|
1126
|
+
# @api public
|
|
1127
|
+
#
|
|
1128
|
+
# source://tty-prompt//lib/tty/prompt/enum_list.rb#112
|
|
1129
|
+
def quiet(value); end
|
|
1130
|
+
|
|
1131
|
+
# Change symbols used by this prompt
|
|
1132
|
+
#
|
|
1133
|
+
# @api public
|
|
1134
|
+
# @param new_symbols [Hash] the new symbols to use
|
|
1135
|
+
#
|
|
1136
|
+
# source://tty-prompt//lib/tty/prompt/enum_list.rb#53
|
|
1137
|
+
def symbols(new_symbols = T.unsafe(nil)); end
|
|
1138
|
+
|
|
1139
|
+
private
|
|
1140
|
+
|
|
1141
|
+
# Find value for the choice selected
|
|
1142
|
+
#
|
|
1143
|
+
# @api private
|
|
1144
|
+
# @return [nil, Object]
|
|
1145
|
+
#
|
|
1146
|
+
# source://tty-prompt//lib/tty/prompt/enum_list.rb#307
|
|
1147
|
+
def answer; end
|
|
1148
|
+
|
|
1149
|
+
# Error message when incorrect index chosen
|
|
1150
|
+
#
|
|
1151
|
+
# @api private
|
|
1152
|
+
#
|
|
1153
|
+
# source://tty-prompt//lib/tty/prompt/enum_list.rb#341
|
|
1154
|
+
def error_message; end
|
|
1155
|
+
|
|
1156
|
+
# Find active choice or set to default
|
|
1157
|
+
#
|
|
1158
|
+
# @api private
|
|
1159
|
+
# @return [nil]
|
|
1160
|
+
#
|
|
1161
|
+
# source://tty-prompt//lib/tty/prompt/enum_list.rb#208
|
|
1162
|
+
def mark_choice_as_active; end
|
|
1163
|
+
|
|
1164
|
+
# Pagination help message
|
|
1165
|
+
#
|
|
1166
|
+
# @api private
|
|
1167
|
+
# @return [String]
|
|
1168
|
+
#
|
|
1169
|
+
# source://tty-prompt//lib/tty/prompt/enum_list.rb#387
|
|
1170
|
+
def page_help_message; end
|
|
1171
|
+
|
|
1172
|
+
# Count how many screen lines the question spans
|
|
1173
|
+
#
|
|
1174
|
+
# @api private
|
|
1175
|
+
# @return [Integer]
|
|
1176
|
+
#
|
|
1177
|
+
# source://tty-prompt//lib/tty/prompt/enum_list.rb#296
|
|
1178
|
+
def question_lines_count(question_lines); end
|
|
1179
|
+
|
|
1180
|
+
# Determine area of the screen to clear
|
|
1181
|
+
#
|
|
1182
|
+
# @api private
|
|
1183
|
+
# @param lines [Integer] the lines to clear
|
|
1184
|
+
# @return [String]
|
|
1185
|
+
#
|
|
1186
|
+
# source://tty-prompt//lib/tty/prompt/enum_list.rb#319
|
|
1187
|
+
def refresh(lines); end
|
|
1188
|
+
|
|
1189
|
+
# Render a selection list.
|
|
1190
|
+
#
|
|
1191
|
+
# By default the result is printed out.
|
|
1192
|
+
#
|
|
1193
|
+
# @api private
|
|
1194
|
+
# @return [Object] value
|
|
1195
|
+
# return the selected value
|
|
1196
|
+
#
|
|
1197
|
+
# source://tty-prompt//lib/tty/prompt/enum_list.rb#274
|
|
1198
|
+
def render; end
|
|
1199
|
+
|
|
1200
|
+
# Render error message and return cursor to position of input
|
|
1201
|
+
#
|
|
1202
|
+
# @api private
|
|
1203
|
+
# @return [String]
|
|
1204
|
+
#
|
|
1205
|
+
# source://tty-prompt//lib/tty/prompt/enum_list.rb#351
|
|
1206
|
+
def render_error; end
|
|
1207
|
+
|
|
1208
|
+
# Render footer for the indexed menu
|
|
1209
|
+
#
|
|
1210
|
+
# @api private
|
|
1211
|
+
# @return [String]
|
|
1212
|
+
#
|
|
1213
|
+
# source://tty-prompt//lib/tty/prompt/enum_list.rb#378
|
|
1214
|
+
def render_footer; end
|
|
1215
|
+
|
|
1216
|
+
# Render chosen option
|
|
1217
|
+
#
|
|
1218
|
+
# @api private
|
|
1219
|
+
# @return [String]
|
|
1220
|
+
#
|
|
1221
|
+
# source://tty-prompt//lib/tty/prompt/enum_list.rb#365
|
|
1222
|
+
def render_header; end
|
|
1223
|
+
|
|
1224
|
+
# Render menu with indexed choices to select from
|
|
1225
|
+
#
|
|
1226
|
+
# @api private
|
|
1227
|
+
# @return [String]
|
|
1228
|
+
#
|
|
1229
|
+
# source://tty-prompt//lib/tty/prompt/enum_list.rb#412
|
|
1230
|
+
def render_menu; end
|
|
1231
|
+
|
|
1232
|
+
# Render page help
|
|
1233
|
+
#
|
|
1234
|
+
# @api private
|
|
1235
|
+
# @return [String]
|
|
1236
|
+
#
|
|
1237
|
+
# source://tty-prompt//lib/tty/prompt/enum_list.rb#398
|
|
1238
|
+
def render_page_help; end
|
|
1239
|
+
|
|
1240
|
+
# Render question with the menu options
|
|
1241
|
+
#
|
|
1242
|
+
# @api private
|
|
1243
|
+
# @return [String]
|
|
1244
|
+
#
|
|
1245
|
+
# source://tty-prompt//lib/tty/prompt/enum_list.rb#329
|
|
1246
|
+
def render_question; end
|
|
1247
|
+
|
|
1248
|
+
# Setup default option and active selection
|
|
1249
|
+
#
|
|
1250
|
+
# @api private
|
|
1251
|
+
#
|
|
1252
|
+
# source://tty-prompt//lib/tty/prompt/enum_list.rb#255
|
|
1253
|
+
def setup_defaults; end
|
|
1254
|
+
|
|
1255
|
+
# Validate default choice name
|
|
1256
|
+
#
|
|
1257
|
+
# @api private
|
|
1258
|
+
# @return [String]
|
|
1259
|
+
#
|
|
1260
|
+
# source://tty-prompt//lib/tty/prompt/enum_list.rb#243
|
|
1261
|
+
def validate_default_name; end
|
|
1262
|
+
|
|
1263
|
+
# Validate default indexes to be within range
|
|
1264
|
+
#
|
|
1265
|
+
# @api private
|
|
1266
|
+
# @raise [ConfigurationError]
|
|
1267
|
+
#
|
|
1268
|
+
# source://tty-prompt//lib/tty/prompt/enum_list.rb#224
|
|
1269
|
+
def validate_defaults; end
|
|
1270
|
+
end
|
|
1271
|
+
|
|
1272
|
+
# Checks type of default parameter to be integer
|
|
1273
|
+
#
|
|
1274
|
+
# @api private
|
|
1275
|
+
#
|
|
1276
|
+
# source://tty-prompt//lib/tty/prompt/enum_list.rb#19
|
|
1277
|
+
TTY::Prompt::EnumList::INTEGER_MATCHER = T.let(T.unsafe(nil), Regexp)
|
|
1278
|
+
|
|
1279
|
+
# @api private
|
|
1280
|
+
#
|
|
1281
|
+
# source://tty-prompt//lib/tty/prompt/enum_list.rb#16
|
|
1282
|
+
TTY::Prompt::EnumList::PAGE_HELP = T.let(T.unsafe(nil), String)
|
|
1283
|
+
|
|
1284
|
+
# source://tty-prompt//lib/tty/prompt/errors.rb#5
|
|
1285
|
+
class TTY::Prompt::Error < ::StandardError; end
|
|
1286
|
+
|
|
1287
|
+
# Evaluates provided parameters and stops if any of them fails
|
|
1288
|
+
#
|
|
1289
|
+
# @api private
|
|
1290
|
+
#
|
|
1291
|
+
# source://tty-prompt//lib/tty/prompt/evaluator.rb#9
|
|
1292
|
+
class TTY::Prompt::Evaluator
|
|
1293
|
+
# @api private
|
|
1294
|
+
# @return [Evaluator] a new instance of Evaluator
|
|
1295
|
+
#
|
|
1296
|
+
# source://tty-prompt//lib/tty/prompt/evaluator.rb#12
|
|
1297
|
+
def initialize(question, &block); end
|
|
1298
|
+
|
|
1299
|
+
# @api private
|
|
1300
|
+
#
|
|
1301
|
+
# source://tty-prompt//lib/tty/prompt/evaluator.rb#26
|
|
1302
|
+
def <<(proc = T.unsafe(nil), &block); end
|
|
1303
|
+
|
|
1304
|
+
# @api private
|
|
1305
|
+
#
|
|
1306
|
+
# source://tty-prompt//lib/tty/prompt/evaluator.rb#18
|
|
1307
|
+
def call(initial); end
|
|
1308
|
+
|
|
1309
|
+
# @api private
|
|
1310
|
+
#
|
|
1311
|
+
# source://tty-prompt//lib/tty/prompt/evaluator.rb#23
|
|
1312
|
+
def check(proc = T.unsafe(nil), &block); end
|
|
1313
|
+
|
|
1314
|
+
# @api private
|
|
1315
|
+
#
|
|
1316
|
+
# source://tty-prompt//lib/tty/prompt/evaluator.rb#10
|
|
1317
|
+
def results; end
|
|
1318
|
+
end
|
|
1319
|
+
|
|
1320
|
+
# A class responsible for rendering expanding options
|
|
1321
|
+
# Used by {Prompt} to display key options question.
|
|
1322
|
+
#
|
|
1323
|
+
# @api private
|
|
1324
|
+
#
|
|
1325
|
+
# source://tty-prompt//lib/tty/prompt/expander.rb#11
|
|
1326
|
+
class TTY::Prompt::Expander
|
|
1327
|
+
# Create instance of Expander
|
|
1328
|
+
#
|
|
1329
|
+
# @api public
|
|
1330
|
+
# @return [Expander] a new instance of Expander
|
|
1331
|
+
#
|
|
1332
|
+
# source://tty-prompt//lib/tty/prompt/expander.rb#24
|
|
1333
|
+
def initialize(prompt, options = T.unsafe(nil)); end
|
|
1334
|
+
|
|
1335
|
+
# Execute this prompt
|
|
1336
|
+
#
|
|
1337
|
+
# @api public
|
|
1338
|
+
#
|
|
1339
|
+
# source://tty-prompt//lib/tty/prompt/expander.rb#142
|
|
1340
|
+
def call(message, possibilities, &block); end
|
|
1341
|
+
|
|
1342
|
+
# Add a single choice
|
|
1343
|
+
#
|
|
1344
|
+
# @api public
|
|
1345
|
+
#
|
|
1346
|
+
# source://tty-prompt//lib/tty/prompt/expander.rb#121
|
|
1347
|
+
def choice(value, &block); end
|
|
1348
|
+
|
|
1349
|
+
# Add multiple choices
|
|
1350
|
+
#
|
|
1351
|
+
# @api public
|
|
1352
|
+
# @param values [Array[Object]] the values to add as choices
|
|
1353
|
+
#
|
|
1354
|
+
# source://tty-prompt//lib/tty/prompt/expander.rb#135
|
|
1355
|
+
def choices(values); end
|
|
1356
|
+
|
|
1357
|
+
# @api private
|
|
1358
|
+
# @return [Boolean]
|
|
1359
|
+
#
|
|
1360
|
+
# source://tty-prompt//lib/tty/prompt/expander.rb#44
|
|
1361
|
+
def collapsed?; end
|
|
1362
|
+
|
|
1363
|
+
# Set default value.
|
|
1364
|
+
#
|
|
1365
|
+
# @api public
|
|
1366
|
+
#
|
|
1367
|
+
# source://tty-prompt//lib/tty/prompt/expander.rb#105
|
|
1368
|
+
def default(value = T.unsafe(nil)); end
|
|
1369
|
+
|
|
1370
|
+
# @api private
|
|
1371
|
+
#
|
|
1372
|
+
# source://tty-prompt//lib/tty/prompt/expander.rb#48
|
|
1373
|
+
def expand; end
|
|
1374
|
+
|
|
1375
|
+
# @api private
|
|
1376
|
+
# @return [Boolean]
|
|
1377
|
+
#
|
|
1378
|
+
# source://tty-prompt//lib/tty/prompt/expander.rb#40
|
|
1379
|
+
def expanded?; end
|
|
1380
|
+
|
|
1381
|
+
# Respond to submit event
|
|
1382
|
+
#
|
|
1383
|
+
# @api public
|
|
1384
|
+
#
|
|
1385
|
+
# source://tty-prompt//lib/tty/prompt/expander.rb#55
|
|
1386
|
+
def keyenter(_); end
|
|
1387
|
+
|
|
1388
|
+
# Respond to key press event
|
|
1389
|
+
#
|
|
1390
|
+
# @api public
|
|
1391
|
+
#
|
|
1392
|
+
# source://tty-prompt//lib/tty/prompt/expander.rb#80
|
|
1393
|
+
def keypress(event); end
|
|
1394
|
+
|
|
1395
|
+
# Respond to submit event
|
|
1396
|
+
#
|
|
1397
|
+
# @api public
|
|
1398
|
+
#
|
|
1399
|
+
# source://tty-prompt//lib/tty/prompt/expander.rb#75
|
|
1400
|
+
def keyreturn(_); end
|
|
1401
|
+
|
|
1402
|
+
# Set quiet mode.
|
|
1403
|
+
#
|
|
1404
|
+
# @api public
|
|
1405
|
+
#
|
|
1406
|
+
# source://tty-prompt//lib/tty/prompt/expander.rb#114
|
|
1407
|
+
def quiet(value); end
|
|
1408
|
+
|
|
1409
|
+
# Select choice by given key
|
|
1410
|
+
#
|
|
1411
|
+
# @api private
|
|
1412
|
+
# @return [Choice]
|
|
1413
|
+
#
|
|
1414
|
+
# source://tty-prompt//lib/tty/prompt/expander.rb#98
|
|
1415
|
+
def select_choice(key); end
|
|
1416
|
+
|
|
1417
|
+
private
|
|
1418
|
+
|
|
1419
|
+
# @api private
|
|
1420
|
+
#
|
|
1421
|
+
# source://tty-prompt//lib/tty/prompt/expander.rb#186
|
|
1422
|
+
def answer; end
|
|
1423
|
+
|
|
1424
|
+
# @api private
|
|
1425
|
+
#
|
|
1426
|
+
# source://tty-prompt//lib/tty/prompt/expander.rb#238
|
|
1427
|
+
def load_auto_hint; end
|
|
1428
|
+
|
|
1429
|
+
# Create possible keys with current choice highlighted
|
|
1430
|
+
#
|
|
1431
|
+
# @api private
|
|
1432
|
+
# @return [String]
|
|
1433
|
+
#
|
|
1434
|
+
# source://tty-prompt//lib/tty/prompt/expander.rb#160
|
|
1435
|
+
def possible_keys; end
|
|
1436
|
+
|
|
1437
|
+
# @api private
|
|
1438
|
+
#
|
|
1439
|
+
# source://tty-prompt//lib/tty/prompt/expander.rb#256
|
|
1440
|
+
def read_input; end
|
|
1441
|
+
|
|
1442
|
+
# Refresh the current input
|
|
1443
|
+
#
|
|
1444
|
+
# @api private
|
|
1445
|
+
# @param lines [Integer]
|
|
1446
|
+
# @return [String]
|
|
1447
|
+
#
|
|
1448
|
+
# source://tty-prompt//lib/tty/prompt/expander.rb#267
|
|
1449
|
+
def refresh(lines); end
|
|
1450
|
+
|
|
1451
|
+
# @api private
|
|
1452
|
+
#
|
|
1453
|
+
# source://tty-prompt//lib/tty/prompt/expander.rb#173
|
|
1454
|
+
def render; end
|
|
1455
|
+
|
|
1456
|
+
# @api private
|
|
1457
|
+
#
|
|
1458
|
+
# source://tty-prompt//lib/tty/prompt/expander.rb#252
|
|
1459
|
+
def render_footer; end
|
|
1460
|
+
|
|
1461
|
+
# Render message with options
|
|
1462
|
+
#
|
|
1463
|
+
# @api private
|
|
1464
|
+
# @return [String]
|
|
1465
|
+
#
|
|
1466
|
+
# source://tty-prompt//lib/tty/prompt/expander.rb#195
|
|
1467
|
+
def render_header; end
|
|
1468
|
+
|
|
1469
|
+
# Show hint for selected option key
|
|
1470
|
+
#
|
|
1471
|
+
# return [String]
|
|
1472
|
+
#
|
|
1473
|
+
# @api private
|
|
1474
|
+
#
|
|
1475
|
+
# source://tty-prompt//lib/tty/prompt/expander.rb#213
|
|
1476
|
+
def render_hint; end
|
|
1477
|
+
|
|
1478
|
+
# Render help menu
|
|
1479
|
+
#
|
|
1480
|
+
# @api private
|
|
1481
|
+
#
|
|
1482
|
+
# source://tty-prompt//lib/tty/prompt/expander.rb#282
|
|
1483
|
+
def render_menu; end
|
|
1484
|
+
|
|
1485
|
+
# Render question with menu
|
|
1486
|
+
#
|
|
1487
|
+
# @api private
|
|
1488
|
+
# @return [String]
|
|
1489
|
+
#
|
|
1490
|
+
# source://tty-prompt//lib/tty/prompt/expander.rb#225
|
|
1491
|
+
def render_question; end
|
|
1492
|
+
|
|
1493
|
+
# @api private
|
|
1494
|
+
#
|
|
1495
|
+
# source://tty-prompt//lib/tty/prompt/expander.rb#294
|
|
1496
|
+
def setup_defaults; end
|
|
1497
|
+
|
|
1498
|
+
# @api private
|
|
1499
|
+
#
|
|
1500
|
+
# source://tty-prompt//lib/tty/prompt/expander.rb#298
|
|
1501
|
+
def validate_choices; end
|
|
1502
|
+
end
|
|
1503
|
+
|
|
1504
|
+
# Names for delete keys
|
|
1505
|
+
#
|
|
1506
|
+
# @api private
|
|
1507
|
+
#
|
|
1508
|
+
# source://tty-prompt//lib/tty/prompt/expander.rb#19
|
|
1509
|
+
TTY::Prompt::Expander::DELETE_KEYS = T.let(T.unsafe(nil), Array)
|
|
1510
|
+
|
|
1511
|
+
# @api private
|
|
1512
|
+
#
|
|
1513
|
+
# source://tty-prompt//lib/tty/prompt/expander.rb#12
|
|
1514
|
+
TTY::Prompt::Expander::HELP_CHOICE = T.let(T.unsafe(nil), Hash)
|
|
1515
|
+
|
|
1516
|
+
# Raised when the argument is not expected
|
|
1517
|
+
#
|
|
1518
|
+
# source://tty-prompt//lib/tty/prompt/errors.rb#23
|
|
1519
|
+
class TTY::Prompt::InvalidArgument < ::TTY::Prompt::Error; end
|
|
1520
|
+
|
|
1521
|
+
# source://tty-prompt//lib/tty/prompt/keypress.rb#8
|
|
1522
|
+
class TTY::Prompt::Keypress < ::TTY::Prompt::Question
|
|
1523
|
+
# Create keypress question
|
|
1524
|
+
#
|
|
1525
|
+
# @api public
|
|
1526
|
+
# @param options [Hash]
|
|
1527
|
+
# @param prompt [Prompt]
|
|
1528
|
+
# @return [Keypress] a new instance of Keypress
|
|
1529
|
+
#
|
|
1530
|
+
# source://tty-prompt//lib/tty/prompt/keypress.rb#15
|
|
1531
|
+
def initialize(prompt, **options); end
|
|
1532
|
+
|
|
1533
|
+
# Check if any specific keys are set
|
|
1534
|
+
#
|
|
1535
|
+
# @return [Boolean]
|
|
1536
|
+
#
|
|
1537
|
+
# source://tty-prompt//lib/tty/prompt/keypress.rb#38
|
|
1538
|
+
def any_key?; end
|
|
1539
|
+
|
|
1540
|
+
# source://tty-prompt//lib/tty/prompt/keypress.rb#31
|
|
1541
|
+
def countdown(value = T.unsafe(nil)); end
|
|
1542
|
+
|
|
1543
|
+
# source://tty-prompt//lib/tty/prompt/keypress.rb#65
|
|
1544
|
+
def interval_handler(time); end
|
|
1545
|
+
|
|
1546
|
+
# source://tty-prompt//lib/tty/prompt/keypress.rb#47
|
|
1547
|
+
def keypress(event); end
|
|
1548
|
+
|
|
1549
|
+
# source://tty-prompt//lib/tty/prompt/keypress.rb#76
|
|
1550
|
+
def process_input(question); end
|
|
1551
|
+
|
|
1552
|
+
# source://tty-prompt//lib/tty/prompt/keypress.rb#93
|
|
1553
|
+
def refresh(lines, lines_to_clear); end
|
|
1554
|
+
|
|
1555
|
+
# source://tty-prompt//lib/tty/prompt/keypress.rb#57
|
|
1556
|
+
def render_question; end
|
|
1557
|
+
|
|
1558
|
+
# Check if timeout is set
|
|
1559
|
+
#
|
|
1560
|
+
# @return [Boolean]
|
|
1561
|
+
#
|
|
1562
|
+
# source://tty-prompt//lib/tty/prompt/keypress.rb#43
|
|
1563
|
+
def timeout?; end
|
|
1564
|
+
end
|
|
1565
|
+
|
|
1566
|
+
# A class responsible for rendering select list menu
|
|
1567
|
+
# Used by {Prompt} to display interactive menu.
|
|
1568
|
+
#
|
|
1569
|
+
# @api private
|
|
1570
|
+
#
|
|
1571
|
+
# source://tty-prompt//lib/tty/prompt/list.rb#15
|
|
1572
|
+
class TTY::Prompt::List
|
|
1573
|
+
# Create instance of TTY::Prompt::List menu.
|
|
1574
|
+
#
|
|
1575
|
+
# @api public
|
|
1576
|
+
# @option options
|
|
1577
|
+
# @option options
|
|
1578
|
+
# @option options
|
|
1579
|
+
# @option options
|
|
1580
|
+
# @param Hash options
|
|
1581
|
+
# the configuration options
|
|
1582
|
+
# @param options [Hash] a customizable set of options
|
|
1583
|
+
# @return [List] a new instance of List
|
|
1584
|
+
#
|
|
1585
|
+
# source://tty-prompt//lib/tty/prompt/list.rb#36
|
|
1586
|
+
def initialize(prompt, **options); end
|
|
1587
|
+
|
|
1588
|
+
# Information about arrow keys
|
|
1589
|
+
#
|
|
1590
|
+
# @api private
|
|
1591
|
+
# @return [String]
|
|
1592
|
+
#
|
|
1593
|
+
# source://tty-prompt//lib/tty/prompt/list.rb#156
|
|
1594
|
+
def arrows_help; end
|
|
1595
|
+
|
|
1596
|
+
# Call the list menu by passing question and choices
|
|
1597
|
+
#
|
|
1598
|
+
# @api public
|
|
1599
|
+
# @param
|
|
1600
|
+
# @param question [String]
|
|
1601
|
+
#
|
|
1602
|
+
# source://tty-prompt//lib/tty/prompt/list.rb#239
|
|
1603
|
+
def call(question, possibilities, &block); end
|
|
1604
|
+
|
|
1605
|
+
# Add a single choice
|
|
1606
|
+
#
|
|
1607
|
+
# @api public
|
|
1608
|
+
#
|
|
1609
|
+
# source://tty-prompt//lib/tty/prompt/list.rb#201
|
|
1610
|
+
def choice(*value, &block); end
|
|
1611
|
+
|
|
1612
|
+
# Add multiple choices, or return them.
|
|
1613
|
+
#
|
|
1614
|
+
# @api public
|
|
1615
|
+
# @param values [Array[Object]] the values to add as choices; if not passed, the current
|
|
1616
|
+
# choices are displayed.
|
|
1617
|
+
#
|
|
1618
|
+
# source://tty-prompt//lib/tty/prompt/list.rb#217
|
|
1619
|
+
def choices(values = T.unsafe(nil)); end
|
|
1620
|
+
|
|
1621
|
+
# Set default option selected
|
|
1622
|
+
#
|
|
1623
|
+
# @api public
|
|
1624
|
+
#
|
|
1625
|
+
# source://tty-prompt//lib/tty/prompt/list.rb#78
|
|
1626
|
+
def default(*default_values); end
|
|
1627
|
+
|
|
1628
|
+
# Default help text
|
|
1629
|
+
#
|
|
1630
|
+
# Note that enumeration and filter are mutually exclusive
|
|
1631
|
+
#
|
|
1632
|
+
# @api private
|
|
1633
|
+
#
|
|
1634
|
+
# source://tty-prompt//lib/tty/prompt/list.rb#171
|
|
1635
|
+
def default_help; end
|
|
1636
|
+
|
|
1637
|
+
# Set selecting active index using number pad
|
|
1638
|
+
#
|
|
1639
|
+
# @api public
|
|
1640
|
+
#
|
|
1641
|
+
# source://tty-prompt//lib/tty/prompt/list.rb#187
|
|
1642
|
+
def enum(value); end
|
|
1643
|
+
|
|
1644
|
+
# Check if list is enumerated
|
|
1645
|
+
#
|
|
1646
|
+
# @api private
|
|
1647
|
+
# @return [Boolean]
|
|
1648
|
+
#
|
|
1649
|
+
# source://tty-prompt//lib/tty/prompt/list.rb#252
|
|
1650
|
+
def enumerate?; end
|
|
1651
|
+
|
|
1652
|
+
# Provide help information
|
|
1653
|
+
#
|
|
1654
|
+
# @api public
|
|
1655
|
+
# @param value [String] the new help text
|
|
1656
|
+
# @return [String]
|
|
1657
|
+
#
|
|
1658
|
+
# source://tty-prompt//lib/tty/prompt/list.rb#136
|
|
1659
|
+
def help(value = T.unsafe(nil)); end
|
|
1660
|
+
|
|
1661
|
+
# @api private
|
|
1662
|
+
#
|
|
1663
|
+
# source://tty-prompt//lib/tty/prompt/list.rb#367
|
|
1664
|
+
def keybackspace(*_arg0); end
|
|
1665
|
+
|
|
1666
|
+
# @api private
|
|
1667
|
+
#
|
|
1668
|
+
# source://tty-prompt//lib/tty/prompt/list.rb#360
|
|
1669
|
+
def keydelete(*_arg0); end
|
|
1670
|
+
|
|
1671
|
+
# @api private
|
|
1672
|
+
#
|
|
1673
|
+
# source://tty-prompt//lib/tty/prompt/list.rb#293
|
|
1674
|
+
def keydown(*_arg0); end
|
|
1675
|
+
|
|
1676
|
+
# @api private
|
|
1677
|
+
#
|
|
1678
|
+
# source://tty-prompt//lib/tty/prompt/list.rb#266
|
|
1679
|
+
def keyenter(*_arg0); end
|
|
1680
|
+
|
|
1681
|
+
# @api private
|
|
1682
|
+
#
|
|
1683
|
+
# source://tty-prompt//lib/tty/prompt/list.rb#338
|
|
1684
|
+
def keyleft(*_arg0); end
|
|
1685
|
+
|
|
1686
|
+
# @api private
|
|
1687
|
+
#
|
|
1688
|
+
# source://tty-prompt//lib/tty/prompt/list.rb#256
|
|
1689
|
+
def keynum(event); end
|
|
1690
|
+
|
|
1691
|
+
# Moves all choices page by page keeping the current selected item
|
|
1692
|
+
# at the same level on each page.
|
|
1693
|
+
#
|
|
1694
|
+
# When the choice on a page is outside of next page range then
|
|
1695
|
+
# adjust it to the last item, otherwise leave unchanged.
|
|
1696
|
+
#
|
|
1697
|
+
# @api private
|
|
1698
|
+
#
|
|
1699
|
+
# source://tty-prompt//lib/tty/prompt/list.rb#336
|
|
1700
|
+
def keypage_down(*_arg0); end
|
|
1701
|
+
|
|
1702
|
+
# @api private
|
|
1703
|
+
#
|
|
1704
|
+
# source://tty-prompt//lib/tty/prompt/list.rb#349
|
|
1705
|
+
def keypage_up(*_arg0); end
|
|
1706
|
+
|
|
1707
|
+
# @api private
|
|
1708
|
+
#
|
|
1709
|
+
# source://tty-prompt//lib/tty/prompt/list.rb#351
|
|
1710
|
+
def keypress(event); end
|
|
1711
|
+
|
|
1712
|
+
# @api private
|
|
1713
|
+
#
|
|
1714
|
+
# source://tty-prompt//lib/tty/prompt/list.rb#269
|
|
1715
|
+
def keyreturn(*_arg0); end
|
|
1716
|
+
|
|
1717
|
+
# Moves all choices page by page keeping the current selected item
|
|
1718
|
+
# at the same level on each page.
|
|
1719
|
+
#
|
|
1720
|
+
# When the choice on a page is outside of next page range then
|
|
1721
|
+
# adjust it to the last item, otherwise leave unchanged.
|
|
1722
|
+
#
|
|
1723
|
+
# @api private
|
|
1724
|
+
#
|
|
1725
|
+
# source://tty-prompt//lib/tty/prompt/list.rb#315
|
|
1726
|
+
def keyright(*_arg0); end
|
|
1727
|
+
|
|
1728
|
+
# @api private
|
|
1729
|
+
#
|
|
1730
|
+
# source://tty-prompt//lib/tty/prompt/list.rb#270
|
|
1731
|
+
def keyspace(*_arg0); end
|
|
1732
|
+
|
|
1733
|
+
# @api private
|
|
1734
|
+
#
|
|
1735
|
+
# source://tty-prompt//lib/tty/prompt/list.rb#308
|
|
1736
|
+
def keytab(*_arg0); end
|
|
1737
|
+
|
|
1738
|
+
# @api private
|
|
1739
|
+
#
|
|
1740
|
+
# source://tty-prompt//lib/tty/prompt/list.rb#276
|
|
1741
|
+
def keyup(*_arg0); end
|
|
1742
|
+
|
|
1743
|
+
# @api private
|
|
1744
|
+
#
|
|
1745
|
+
# source://tty-prompt//lib/tty/prompt/list.rb#115
|
|
1746
|
+
def page_size; end
|
|
1747
|
+
|
|
1748
|
+
# Check if list is paginated
|
|
1749
|
+
#
|
|
1750
|
+
# @api private
|
|
1751
|
+
# @return [Boolean]
|
|
1752
|
+
#
|
|
1753
|
+
# source://tty-prompt//lib/tty/prompt/list.rb#124
|
|
1754
|
+
def paginated?; end
|
|
1755
|
+
|
|
1756
|
+
# Select paginator based on the current navigation key
|
|
1757
|
+
#
|
|
1758
|
+
# @api private
|
|
1759
|
+
# @return [Paginator]
|
|
1760
|
+
#
|
|
1761
|
+
# source://tty-prompt//lib/tty/prompt/list.rb#87
|
|
1762
|
+
def paginator; end
|
|
1763
|
+
|
|
1764
|
+
# Set number of items per page
|
|
1765
|
+
#
|
|
1766
|
+
# @api public
|
|
1767
|
+
#
|
|
1768
|
+
# source://tty-prompt//lib/tty/prompt/list.rb#111
|
|
1769
|
+
def per_page(value); end
|
|
1770
|
+
|
|
1771
|
+
# Set whether selected answers are echoed
|
|
1772
|
+
#
|
|
1773
|
+
# @api public
|
|
1774
|
+
#
|
|
1775
|
+
# source://tty-prompt//lib/tty/prompt/list.rb#194
|
|
1776
|
+
def quiet(value); end
|
|
1777
|
+
|
|
1778
|
+
# @api private
|
|
1779
|
+
#
|
|
1780
|
+
# source://tty-prompt//lib/tty/prompt/list.rb#272
|
|
1781
|
+
def search_choice_in(searchable); end
|
|
1782
|
+
|
|
1783
|
+
# Change when help is displayed
|
|
1784
|
+
#
|
|
1785
|
+
# @api public
|
|
1786
|
+
#
|
|
1787
|
+
# source://tty-prompt//lib/tty/prompt/list.rb#145
|
|
1788
|
+
def show_help(value = T.unsafe(nil)); end
|
|
1789
|
+
|
|
1790
|
+
# Change symbols used by this prompt
|
|
1791
|
+
#
|
|
1792
|
+
# @api public
|
|
1793
|
+
# @param new_symbols [Hash] the new symbols to use
|
|
1794
|
+
#
|
|
1795
|
+
# source://tty-prompt//lib/tty/prompt/list.rb#69
|
|
1796
|
+
def symbols(new_symbols = T.unsafe(nil)); end
|
|
1797
|
+
|
|
1798
|
+
# Synchronize paginators start positions
|
|
1799
|
+
#
|
|
1800
|
+
# @api private
|
|
1801
|
+
#
|
|
1802
|
+
# source://tty-prompt//lib/tty/prompt/list.rb#94
|
|
1803
|
+
def sync_paginators; end
|
|
1804
|
+
|
|
1805
|
+
private
|
|
1806
|
+
|
|
1807
|
+
# Find value for the choice selected
|
|
1808
|
+
#
|
|
1809
|
+
# @api private
|
|
1810
|
+
# @return [nil, Object]
|
|
1811
|
+
#
|
|
1812
|
+
# source://tty-prompt//lib/tty/prompt/list.rb#484
|
|
1813
|
+
def answer; end
|
|
1814
|
+
|
|
1815
|
+
# @api private
|
|
1816
|
+
#
|
|
1817
|
+
# source://tty-prompt//lib/tty/prompt/list.rb#376
|
|
1818
|
+
def check_options_consistency(options); end
|
|
1819
|
+
|
|
1820
|
+
# Header part showing the current filter
|
|
1821
|
+
#
|
|
1822
|
+
# @api private
|
|
1823
|
+
# @return String
|
|
1824
|
+
#
|
|
1825
|
+
# source://tty-prompt//lib/tty/prompt/list.rb#525
|
|
1826
|
+
def filter_help; end
|
|
1827
|
+
|
|
1828
|
+
# Is filtering enabled?
|
|
1829
|
+
#
|
|
1830
|
+
# @api private
|
|
1831
|
+
# @return [Boolean]
|
|
1832
|
+
#
|
|
1833
|
+
# source://tty-prompt//lib/tty/prompt/list.rb#516
|
|
1834
|
+
def filterable?; end
|
|
1835
|
+
|
|
1836
|
+
# Check if help is always displayed
|
|
1837
|
+
#
|
|
1838
|
+
# @api private
|
|
1839
|
+
# @return [Boolean]
|
|
1840
|
+
#
|
|
1841
|
+
# source://tty-prompt//lib/tty/prompt/list.rb#539
|
|
1842
|
+
def help_always?; end
|
|
1843
|
+
|
|
1844
|
+
# Check if help is shown only on start
|
|
1845
|
+
#
|
|
1846
|
+
# @api private
|
|
1847
|
+
# @return [Boolean]
|
|
1848
|
+
#
|
|
1849
|
+
# source://tty-prompt//lib/tty/prompt/list.rb#532
|
|
1850
|
+
def help_start?; end
|
|
1851
|
+
|
|
1852
|
+
# Count how many screen lines the question spans
|
|
1853
|
+
#
|
|
1854
|
+
# @api private
|
|
1855
|
+
# @return [Integer]
|
|
1856
|
+
#
|
|
1857
|
+
# source://tty-prompt//lib/tty/prompt/list.rb#473
|
|
1858
|
+
def question_lines_count(question_lines); end
|
|
1859
|
+
|
|
1860
|
+
# Clear screen lines
|
|
1861
|
+
#
|
|
1862
|
+
# @api private
|
|
1863
|
+
# @param [String]
|
|
1864
|
+
#
|
|
1865
|
+
# source://tty-prompt//lib/tty/prompt/list.rb#493
|
|
1866
|
+
def refresh(lines); end
|
|
1867
|
+
|
|
1868
|
+
# Render a selection list.
|
|
1869
|
+
#
|
|
1870
|
+
# By default the result is printed out.
|
|
1871
|
+
#
|
|
1872
|
+
# @api private
|
|
1873
|
+
# @return [Object] value
|
|
1874
|
+
# return the selected value
|
|
1875
|
+
#
|
|
1876
|
+
# source://tty-prompt//lib/tty/prompt/list.rb#449
|
|
1877
|
+
def render; end
|
|
1878
|
+
|
|
1879
|
+
# Render initial help and selected choice
|
|
1880
|
+
#
|
|
1881
|
+
# @api private
|
|
1882
|
+
# @return [String]
|
|
1883
|
+
#
|
|
1884
|
+
# source://tty-prompt//lib/tty/prompt/list.rb#548
|
|
1885
|
+
def render_header; end
|
|
1886
|
+
|
|
1887
|
+
# Render menu with choices to select from
|
|
1888
|
+
#
|
|
1889
|
+
# @api private
|
|
1890
|
+
# @return [String]
|
|
1891
|
+
#
|
|
1892
|
+
# source://tty-prompt//lib/tty/prompt/list.rb#565
|
|
1893
|
+
def render_menu; end
|
|
1894
|
+
|
|
1895
|
+
# Render question with instructions and menu
|
|
1896
|
+
#
|
|
1897
|
+
# @api private
|
|
1898
|
+
# @return [String]
|
|
1899
|
+
#
|
|
1900
|
+
# source://tty-prompt//lib/tty/prompt/list.rb#502
|
|
1901
|
+
def render_question; end
|
|
1902
|
+
|
|
1903
|
+
# Setup default option and active selection
|
|
1904
|
+
#
|
|
1905
|
+
# @api private
|
|
1906
|
+
# @return [Integer]
|
|
1907
|
+
#
|
|
1908
|
+
# source://tty-prompt//lib/tty/prompt/list.rb#388
|
|
1909
|
+
def setup_defaults; end
|
|
1910
|
+
|
|
1911
|
+
# Validate default choice name
|
|
1912
|
+
#
|
|
1913
|
+
# @api private
|
|
1914
|
+
# @param name [String] the name to verify
|
|
1915
|
+
# @return [String]
|
|
1916
|
+
#
|
|
1917
|
+
# source://tty-prompt//lib/tty/prompt/list.rb#432
|
|
1918
|
+
def validate_default_name(name); end
|
|
1919
|
+
|
|
1920
|
+
# Validate default indexes to be within range
|
|
1921
|
+
#
|
|
1922
|
+
# @api private
|
|
1923
|
+
# @raise [ConfigurationError] raised when the default index is either non-integer,
|
|
1924
|
+
# out of range or clashes with disabled choice item.
|
|
1925
|
+
#
|
|
1926
|
+
# source://tty-prompt//lib/tty/prompt/list.rb#408
|
|
1927
|
+
def validate_defaults; end
|
|
1928
|
+
end
|
|
1929
|
+
|
|
1930
|
+
# Allowed keys for filter, along with backspace and canc.
|
|
1931
|
+
#
|
|
1932
|
+
# @api private
|
|
1933
|
+
#
|
|
1934
|
+
# source://tty-prompt//lib/tty/prompt/list.rb#17
|
|
1935
|
+
TTY::Prompt::List::FILTER_KEYS_MATCHER = T.let(T.unsafe(nil), Regexp)
|
|
1936
|
+
|
|
1937
|
+
# Checks type of default parameter to be integer
|
|
1938
|
+
#
|
|
1939
|
+
# @api private
|
|
1940
|
+
#
|
|
1941
|
+
# source://tty-prompt//lib/tty/prompt/list.rb#20
|
|
1942
|
+
TTY::Prompt::List::INTEGER_MATCHER = T.let(T.unsafe(nil), Regexp)
|
|
1943
|
+
|
|
1944
|
+
# source://tty-prompt//lib/tty/prompt/mask_question.rb#7
|
|
1945
|
+
class TTY::Prompt::MaskQuestion < ::TTY::Prompt::Question
|
|
1946
|
+
# Create masked question
|
|
1947
|
+
#
|
|
1948
|
+
# @api public
|
|
1949
|
+
# @option options
|
|
1950
|
+
# @param options [Hash]
|
|
1951
|
+
# @return [MaskQuestion] a new instance of MaskQuestion
|
|
1952
|
+
#
|
|
1953
|
+
# source://tty-prompt//lib/tty/prompt/mask_question.rb#17
|
|
1954
|
+
def initialize(prompt, **options); end
|
|
1955
|
+
|
|
1956
|
+
# source://tty-prompt//lib/tty/prompt/mask_question.rb#41
|
|
1957
|
+
def keyenter(_event); end
|
|
1958
|
+
|
|
1959
|
+
# source://tty-prompt//lib/tty/prompt/mask_question.rb#45
|
|
1960
|
+
def keypress(event); end
|
|
1961
|
+
|
|
1962
|
+
# source://tty-prompt//lib/tty/prompt/mask_question.rb#37
|
|
1963
|
+
def keyreturn(_event); end
|
|
1964
|
+
|
|
1965
|
+
# Set character for masking the STDIN input
|
|
1966
|
+
#
|
|
1967
|
+
# @api public
|
|
1968
|
+
# @param char [String]
|
|
1969
|
+
# @return [self]
|
|
1970
|
+
#
|
|
1971
|
+
# source://tty-prompt//lib/tty/prompt/mask_question.rb#31
|
|
1972
|
+
def mask(char = T.unsafe(nil)); end
|
|
1973
|
+
|
|
1974
|
+
# Read input from user masked by character
|
|
1975
|
+
#
|
|
1976
|
+
# @private
|
|
1977
|
+
#
|
|
1978
|
+
# source://tty-prompt//lib/tty/prompt/mask_question.rb#79
|
|
1979
|
+
def read_input(question); end
|
|
1980
|
+
|
|
1981
|
+
# source://tty-prompt//lib/tty/prompt/mask_question.rb#71
|
|
1982
|
+
def render_error(errors); end
|
|
1983
|
+
|
|
1984
|
+
# Render question and input replaced with masked character
|
|
1985
|
+
#
|
|
1986
|
+
# @api private
|
|
1987
|
+
#
|
|
1988
|
+
# source://tty-prompt//lib/tty/prompt/mask_question.rb#56
|
|
1989
|
+
def render_question; end
|
|
1990
|
+
end
|
|
1991
|
+
|
|
1992
|
+
# Names for delete keys
|
|
1993
|
+
#
|
|
1994
|
+
# source://tty-prompt//lib/tty/prompt/mask_question.rb#9
|
|
1995
|
+
TTY::Prompt::MaskQuestion::DELETE_KEYS = T.let(T.unsafe(nil), Array)
|
|
1996
|
+
|
|
1997
|
+
# A class responsible for rendering multi select list menu.
|
|
1998
|
+
# Used by {Prompt} to display interactive choice menu.
|
|
1999
|
+
#
|
|
2000
|
+
# @api private
|
|
2001
|
+
#
|
|
2002
|
+
# source://tty-prompt//lib/tty/prompt/multi_list.rb#12
|
|
2003
|
+
class TTY::Prompt::MultiList < ::TTY::Prompt::List
|
|
2004
|
+
# Create instance of TTY::Prompt::MultiList menu.
|
|
2005
|
+
#
|
|
2006
|
+
# @api public
|
|
2007
|
+
# @param :prompt [Prompt]
|
|
2008
|
+
# @param options [Hash]
|
|
2009
|
+
# @return [MultiList] a new instance of MultiList
|
|
2010
|
+
#
|
|
2011
|
+
# source://tty-prompt//lib/tty/prompt/multi_list.rb#19
|
|
2012
|
+
def initialize(prompt, **options); end
|
|
2013
|
+
|
|
2014
|
+
# Selects all choices when Ctrl+A is pressed
|
|
2015
|
+
#
|
|
2016
|
+
# @api private
|
|
2017
|
+
#
|
|
2018
|
+
# source://tty-prompt//lib/tty/prompt/multi_list.rb#71
|
|
2019
|
+
def keyctrl_a(*_arg0); end
|
|
2020
|
+
|
|
2021
|
+
# Revert currently selected choices when Ctrl+I is pressed
|
|
2022
|
+
#
|
|
2023
|
+
# @api private
|
|
2024
|
+
#
|
|
2025
|
+
# source://tty-prompt//lib/tty/prompt/multi_list.rb#80
|
|
2026
|
+
def keyctrl_r(*_arg0); end
|
|
2027
|
+
|
|
2028
|
+
# Callback fired when enter/return key is pressed
|
|
2029
|
+
#
|
|
2030
|
+
# @api private
|
|
2031
|
+
#
|
|
2032
|
+
# source://tty-prompt//lib/tty/prompt/multi_list.rb#45
|
|
2033
|
+
def keyenter(*_arg0); end
|
|
2034
|
+
|
|
2035
|
+
# Callback fired when enter/return key is pressed
|
|
2036
|
+
#
|
|
2037
|
+
# @api private
|
|
2038
|
+
#
|
|
2039
|
+
# source://tty-prompt//lib/tty/prompt/multi_list.rb#52
|
|
2040
|
+
def keyreturn(*_arg0); end
|
|
2041
|
+
|
|
2042
|
+
# Callback fired when space key is pressed
|
|
2043
|
+
#
|
|
2044
|
+
# @api private
|
|
2045
|
+
#
|
|
2046
|
+
# source://tty-prompt//lib/tty/prompt/multi_list.rb#57
|
|
2047
|
+
def keyspace(*_arg0); end
|
|
2048
|
+
|
|
2049
|
+
# Set a maximum number of choices
|
|
2050
|
+
#
|
|
2051
|
+
# @api public
|
|
2052
|
+
#
|
|
2053
|
+
# source://tty-prompt//lib/tty/prompt/multi_list.rb#38
|
|
2054
|
+
def max(value); end
|
|
2055
|
+
|
|
2056
|
+
# Set a minimum number of choices
|
|
2057
|
+
#
|
|
2058
|
+
# @api public
|
|
2059
|
+
#
|
|
2060
|
+
# source://tty-prompt//lib/tty/prompt/multi_list.rb#31
|
|
2061
|
+
def min(value); end
|
|
2062
|
+
|
|
2063
|
+
private
|
|
2064
|
+
|
|
2065
|
+
# All values for the choices selected
|
|
2066
|
+
#
|
|
2067
|
+
# @api private
|
|
2068
|
+
# @return [Array[nil,Object]]
|
|
2069
|
+
#
|
|
2070
|
+
# source://tty-prompt//lib/tty/prompt/multi_list.rb#189
|
|
2071
|
+
def answer; end
|
|
2072
|
+
|
|
2073
|
+
# Build a default help text
|
|
2074
|
+
#
|
|
2075
|
+
# @api private
|
|
2076
|
+
# @return [String]
|
|
2077
|
+
#
|
|
2078
|
+
# source://tty-prompt//lib/tty/prompt/multi_list.rb#144
|
|
2079
|
+
def default_help; end
|
|
2080
|
+
|
|
2081
|
+
# Header part showing the minimum/maximum number of choices
|
|
2082
|
+
#
|
|
2083
|
+
# @api private
|
|
2084
|
+
# @return [String]
|
|
2085
|
+
#
|
|
2086
|
+
# source://tty-prompt//lib/tty/prompt/multi_list.rb#132
|
|
2087
|
+
def minmax_help; end
|
|
2088
|
+
|
|
2089
|
+
# Render initial help text and then currently selected choices
|
|
2090
|
+
#
|
|
2091
|
+
# @api private
|
|
2092
|
+
#
|
|
2093
|
+
# source://tty-prompt//lib/tty/prompt/multi_list.rb#163
|
|
2094
|
+
def render_header; end
|
|
2095
|
+
|
|
2096
|
+
# Render menu with choices to select from
|
|
2097
|
+
#
|
|
2098
|
+
# @api private
|
|
2099
|
+
# @return [String]
|
|
2100
|
+
#
|
|
2101
|
+
# source://tty-prompt//lib/tty/prompt/multi_list.rb#198
|
|
2102
|
+
def render_menu; end
|
|
2103
|
+
|
|
2104
|
+
# Generate selected items names
|
|
2105
|
+
#
|
|
2106
|
+
# @api private
|
|
2107
|
+
# @return [String]
|
|
2108
|
+
#
|
|
2109
|
+
# source://tty-prompt//lib/tty/prompt/multi_list.rb#123
|
|
2110
|
+
def selected_names; end
|
|
2111
|
+
|
|
2112
|
+
# Setup default options and active selection
|
|
2113
|
+
#
|
|
2114
|
+
# @api private
|
|
2115
|
+
#
|
|
2116
|
+
# source://tty-prompt//lib/tty/prompt/multi_list.rb#95
|
|
2117
|
+
def setup_defaults; end
|
|
2118
|
+
end
|
|
2119
|
+
|
|
2120
|
+
# A prompt responsible for multi line user input
|
|
2121
|
+
#
|
|
2122
|
+
# @api private
|
|
2123
|
+
#
|
|
2124
|
+
# source://tty-prompt//lib/tty/prompt/multiline.rb#11
|
|
2125
|
+
class TTY::Prompt::Multiline < ::TTY::Prompt::Question
|
|
2126
|
+
# @api private
|
|
2127
|
+
# @return [Multiline] a new instance of Multiline
|
|
2128
|
+
#
|
|
2129
|
+
# source://tty-prompt//lib/tty/prompt/multiline.rb#14
|
|
2130
|
+
def initialize(prompt, **options); end
|
|
2131
|
+
|
|
2132
|
+
# Provide help information
|
|
2133
|
+
#
|
|
2134
|
+
# @api public
|
|
2135
|
+
# @return [String]
|
|
2136
|
+
#
|
|
2137
|
+
# source://tty-prompt//lib/tty/prompt/multiline.rb#26
|
|
2138
|
+
def help(value = T.unsafe(nil)); end
|
|
2139
|
+
|
|
2140
|
+
# @api private
|
|
2141
|
+
#
|
|
2142
|
+
# source://tty-prompt//lib/tty/prompt/multiline.rb#39
|
|
2143
|
+
def keyenter(*_arg0); end
|
|
2144
|
+
|
|
2145
|
+
# @api private
|
|
2146
|
+
#
|
|
2147
|
+
# source://tty-prompt//lib/tty/prompt/multiline.rb#36
|
|
2148
|
+
def keyreturn(*_arg0); end
|
|
2149
|
+
|
|
2150
|
+
# @api private
|
|
2151
|
+
#
|
|
2152
|
+
# source://tty-prompt//lib/tty/prompt/multiline.rb#55
|
|
2153
|
+
def process_input(question); end
|
|
2154
|
+
|
|
2155
|
+
# @api private
|
|
2156
|
+
#
|
|
2157
|
+
# source://tty-prompt//lib/tty/prompt/multiline.rb#32
|
|
2158
|
+
def read_input; end
|
|
2159
|
+
|
|
2160
|
+
# @api private
|
|
2161
|
+
#
|
|
2162
|
+
# source://tty-prompt//lib/tty/prompt/multiline.rb#66
|
|
2163
|
+
def refresh(lines, lines_to_clear); end
|
|
2164
|
+
|
|
2165
|
+
# @api private
|
|
2166
|
+
#
|
|
2167
|
+
# source://tty-prompt//lib/tty/prompt/multiline.rb#41
|
|
2168
|
+
def render_question; end
|
|
2169
|
+
end
|
|
2170
|
+
|
|
2171
|
+
# @api private
|
|
2172
|
+
#
|
|
2173
|
+
# source://tty-prompt//lib/tty/prompt/multiline.rb#12
|
|
2174
|
+
TTY::Prompt::Multiline::HELP = T.let(T.unsafe(nil), String)
|
|
2175
|
+
|
|
2176
|
+
# source://tty-prompt//lib/tty/prompt/paginator.rb#5
|
|
2177
|
+
class TTY::Prompt::Paginator
|
|
2178
|
+
# Create a Paginator
|
|
2179
|
+
#
|
|
2180
|
+
# @api private
|
|
2181
|
+
# @return [Paginator] a new instance of Paginator
|
|
2182
|
+
#
|
|
2183
|
+
# source://tty-prompt//lib/tty/prompt/paginator.rb#23
|
|
2184
|
+
def initialize(**options); end
|
|
2185
|
+
|
|
2186
|
+
# Check if page size is valid
|
|
2187
|
+
#
|
|
2188
|
+
# @api private
|
|
2189
|
+
# @raise [InvalidArgument]
|
|
2190
|
+
#
|
|
2191
|
+
# source://tty-prompt//lib/tty/prompt/paginator.rb#42
|
|
2192
|
+
def check_page_size!; end
|
|
2193
|
+
|
|
2194
|
+
# The 0-based index of the active item on this page
|
|
2195
|
+
#
|
|
2196
|
+
# source://tty-prompt//lib/tty/prompt/paginator.rb#15
|
|
2197
|
+
def current_index; end
|
|
2198
|
+
|
|
2199
|
+
# The 0-based index of the last item on this page
|
|
2200
|
+
#
|
|
2201
|
+
# source://tty-prompt//lib/tty/prompt/paginator.rb#12
|
|
2202
|
+
def end_index; end
|
|
2203
|
+
|
|
2204
|
+
# The 0-based index of the previously active item on this page
|
|
2205
|
+
#
|
|
2206
|
+
# source://tty-prompt//lib/tty/prompt/paginator.rb#18
|
|
2207
|
+
def last_index; end
|
|
2208
|
+
|
|
2209
|
+
# Paginate collection given an active index
|
|
2210
|
+
#
|
|
2211
|
+
# @api public
|
|
2212
|
+
# @param active [Integer] current choice active index
|
|
2213
|
+
# @param list [Array[Choice]] a collection of choice items
|
|
2214
|
+
# @param per_page [Integer] number of choice items per page
|
|
2215
|
+
# @return [Enumerable] the list between start and end index
|
|
2216
|
+
#
|
|
2217
|
+
# source://tty-prompt//lib/tty/prompt/paginator.rb#59
|
|
2218
|
+
def paginate(list, active, per_page = T.unsafe(nil), &block); end
|
|
2219
|
+
|
|
2220
|
+
# Reset current page indexes
|
|
2221
|
+
#
|
|
2222
|
+
# @api private
|
|
2223
|
+
#
|
|
2224
|
+
# source://tty-prompt//lib/tty/prompt/paginator.rb#32
|
|
2225
|
+
def reset!; end
|
|
2226
|
+
|
|
2227
|
+
# The 0-based index of the first item on this page
|
|
2228
|
+
#
|
|
2229
|
+
# source://tty-prompt//lib/tty/prompt/paginator.rb#9
|
|
2230
|
+
def start_index; end
|
|
2231
|
+
|
|
2232
|
+
# The 0-based index of the first item on this page
|
|
2233
|
+
#
|
|
2234
|
+
# source://tty-prompt//lib/tty/prompt/paginator.rb#9
|
|
2235
|
+
def start_index=(_arg0); end
|
|
2236
|
+
end
|
|
2237
|
+
|
|
2238
|
+
# source://tty-prompt//lib/tty/prompt/paginator.rb#6
|
|
2239
|
+
TTY::Prompt::Paginator::DEFAULT_PAGE_SIZE = T.let(T.unsafe(nil), Integer)
|
|
2240
|
+
|
|
2241
|
+
# A class responsible for gathering user input
|
|
2242
|
+
#
|
|
2243
|
+
# @api public
|
|
2244
|
+
#
|
|
2245
|
+
# source://tty-prompt//lib/tty/prompt/question/modifier.rb#5
|
|
2246
|
+
class TTY::Prompt::Question
|
|
2247
|
+
include ::TTY::Prompt::Question::Checks
|
|
2248
|
+
|
|
2249
|
+
# Initialize a Question
|
|
2250
|
+
#
|
|
2251
|
+
# @api public
|
|
2252
|
+
# @return [Question] a new instance of Question
|
|
2253
|
+
#
|
|
2254
|
+
# source://tty-prompt//lib/tty/prompt/question.rb#37
|
|
2255
|
+
def initialize(prompt, **options); end
|
|
2256
|
+
|
|
2257
|
+
# Call the question
|
|
2258
|
+
#
|
|
2259
|
+
# @api public
|
|
2260
|
+
# @param message [String]
|
|
2261
|
+
# @return [self]
|
|
2262
|
+
#
|
|
2263
|
+
# source://tty-prompt//lib/tty/prompt/question.rb#107
|
|
2264
|
+
def call(message = T.unsafe(nil), &block); end
|
|
2265
|
+
|
|
2266
|
+
# Specify answer conversion
|
|
2267
|
+
#
|
|
2268
|
+
# @api public
|
|
2269
|
+
#
|
|
2270
|
+
# source://tty-prompt//lib/tty/prompt/question.rb#237
|
|
2271
|
+
def convert(value = T.unsafe(nil), message = T.unsafe(nil)); end
|
|
2272
|
+
|
|
2273
|
+
# Check if conversion is set
|
|
2274
|
+
#
|
|
2275
|
+
# @api public
|
|
2276
|
+
# @return [Boolean]
|
|
2277
|
+
#
|
|
2278
|
+
# source://tty-prompt//lib/tty/prompt/question.rb#251
|
|
2279
|
+
def convert?; end
|
|
2280
|
+
|
|
2281
|
+
# Convert value to expected type
|
|
2282
|
+
#
|
|
2283
|
+
# @api private
|
|
2284
|
+
# @param value [Object]
|
|
2285
|
+
#
|
|
2286
|
+
# source://tty-prompt//lib/tty/prompt/question.rb#221
|
|
2287
|
+
def convert_result(value); end
|
|
2288
|
+
|
|
2289
|
+
# Set default value.
|
|
2290
|
+
#
|
|
2291
|
+
# @api public
|
|
2292
|
+
#
|
|
2293
|
+
# source://tty-prompt//lib/tty/prompt/question.rb#258
|
|
2294
|
+
def default(value = T.unsafe(nil)); end
|
|
2295
|
+
|
|
2296
|
+
# Check if default value is set
|
|
2297
|
+
#
|
|
2298
|
+
# @api public
|
|
2299
|
+
# @return [Boolean]
|
|
2300
|
+
#
|
|
2301
|
+
# source://tty-prompt//lib/tty/prompt/question.rb#269
|
|
2302
|
+
def default?; end
|
|
2303
|
+
|
|
2304
|
+
# Turn terminal echo on or off. This is used to secure the display so
|
|
2305
|
+
# that the entered characters are not echoed back to the screen.
|
|
2306
|
+
#
|
|
2307
|
+
# @api public
|
|
2308
|
+
#
|
|
2309
|
+
# source://tty-prompt//lib/tty/prompt/question.rb#331
|
|
2310
|
+
def echo(value = T.unsafe(nil)); end
|
|
2311
|
+
|
|
2312
|
+
# Turn terminal echo on or off. This is used to secure the display so
|
|
2313
|
+
# that the entered characters are not echoed back to the screen.
|
|
2314
|
+
#
|
|
2315
|
+
# @api public
|
|
2316
|
+
#
|
|
2317
|
+
# source://tty-prompt//lib/tty/prompt/question.rb#336
|
|
2318
|
+
def echo?(value = T.unsafe(nil)); end
|
|
2319
|
+
|
|
2320
|
+
# Set expected range of values
|
|
2321
|
+
#
|
|
2322
|
+
# @api public
|
|
2323
|
+
# @param value [String]
|
|
2324
|
+
#
|
|
2325
|
+
# source://tty-prompt//lib/tty/prompt/question.rb#353
|
|
2326
|
+
def in(value = T.unsafe(nil), message = T.unsafe(nil)); end
|
|
2327
|
+
|
|
2328
|
+
# Check if range is set
|
|
2329
|
+
#
|
|
2330
|
+
# @api public
|
|
2331
|
+
# @return [Boolean]
|
|
2332
|
+
#
|
|
2333
|
+
# source://tty-prompt//lib/tty/prompt/question.rb#368
|
|
2334
|
+
def in?; end
|
|
2335
|
+
|
|
2336
|
+
# String representation of this question
|
|
2337
|
+
#
|
|
2338
|
+
# @api public
|
|
2339
|
+
#
|
|
2340
|
+
# source://tty-prompt//lib/tty/prompt/question.rb#386
|
|
2341
|
+
def inspect; end
|
|
2342
|
+
|
|
2343
|
+
# Store question message
|
|
2344
|
+
#
|
|
2345
|
+
# @api public
|
|
2346
|
+
#
|
|
2347
|
+
# source://tty-prompt//lib/tty/prompt/question.rb#28
|
|
2348
|
+
def message; end
|
|
2349
|
+
|
|
2350
|
+
# Retrieve message based on the key
|
|
2351
|
+
#
|
|
2352
|
+
# @api private
|
|
2353
|
+
# @param name [Symbol] the name of message key
|
|
2354
|
+
# @param tokens [Hash] the tokens to evaluate
|
|
2355
|
+
# @return [Array[String]]
|
|
2356
|
+
#
|
|
2357
|
+
# source://tty-prompt//lib/tty/prompt/question.rb#91
|
|
2358
|
+
def message_for(name, tokens = T.unsafe(nil)); end
|
|
2359
|
+
|
|
2360
|
+
# Stores all the error messages displayed to user
|
|
2361
|
+
# The currently supported messages are:
|
|
2362
|
+
# * :range?
|
|
2363
|
+
# * :required?
|
|
2364
|
+
# * :valid?
|
|
2365
|
+
#
|
|
2366
|
+
# @api public
|
|
2367
|
+
#
|
|
2368
|
+
# source://tty-prompt//lib/tty/prompt/question.rb#78
|
|
2369
|
+
def messages; end
|
|
2370
|
+
|
|
2371
|
+
# @api public
|
|
2372
|
+
#
|
|
2373
|
+
# source://tty-prompt//lib/tty/prompt/question.rb#30
|
|
2374
|
+
def modifier; end
|
|
2375
|
+
|
|
2376
|
+
# Modify string according to the rule given.
|
|
2377
|
+
#
|
|
2378
|
+
# @api public
|
|
2379
|
+
# @param rule [Symbol]
|
|
2380
|
+
#
|
|
2381
|
+
# source://tty-prompt//lib/tty/prompt/question.rb#323
|
|
2382
|
+
def modify(*rules); end
|
|
2383
|
+
|
|
2384
|
+
# Decide how to handle input from user
|
|
2385
|
+
#
|
|
2386
|
+
# @api private
|
|
2387
|
+
#
|
|
2388
|
+
# source://tty-prompt//lib/tty/prompt/question.rb#161
|
|
2389
|
+
def process_input(question); end
|
|
2390
|
+
|
|
2391
|
+
# Set quiet mode.
|
|
2392
|
+
#
|
|
2393
|
+
# @api public
|
|
2394
|
+
#
|
|
2395
|
+
# source://tty-prompt//lib/tty/prompt/question.rb#375
|
|
2396
|
+
def quiet(value); end
|
|
2397
|
+
|
|
2398
|
+
# Turn raw mode on or off. This enables character-based input.
|
|
2399
|
+
#
|
|
2400
|
+
# @api public
|
|
2401
|
+
#
|
|
2402
|
+
# source://tty-prompt//lib/tty/prompt/question.rb#341
|
|
2403
|
+
def raw(value = T.unsafe(nil)); end
|
|
2404
|
+
|
|
2405
|
+
# Turn raw mode on or off. This enables character-based input.
|
|
2406
|
+
#
|
|
2407
|
+
# @api public
|
|
2408
|
+
#
|
|
2409
|
+
# source://tty-prompt//lib/tty/prompt/question.rb#346
|
|
2410
|
+
def raw?(value = T.unsafe(nil)); end
|
|
2411
|
+
|
|
2412
|
+
# Process input
|
|
2413
|
+
#
|
|
2414
|
+
# @api private
|
|
2415
|
+
#
|
|
2416
|
+
# source://tty-prompt//lib/tty/prompt/question.rb#172
|
|
2417
|
+
def read_input(question); end
|
|
2418
|
+
|
|
2419
|
+
# Determine area of the screen to clear
|
|
2420
|
+
#
|
|
2421
|
+
# @api private
|
|
2422
|
+
# @param lines [Integer] number of lines to clear
|
|
2423
|
+
# @return [String]
|
|
2424
|
+
#
|
|
2425
|
+
# source://tty-prompt//lib/tty/prompt/question.rb#201
|
|
2426
|
+
def refresh(lines, lines_to_clear); end
|
|
2427
|
+
|
|
2428
|
+
# Read answer and convert to type
|
|
2429
|
+
#
|
|
2430
|
+
# @api private
|
|
2431
|
+
#
|
|
2432
|
+
# source://tty-prompt//lib/tty/prompt/question.rb#118
|
|
2433
|
+
def render; end
|
|
2434
|
+
|
|
2435
|
+
# Handle error condition
|
|
2436
|
+
#
|
|
2437
|
+
# @api private
|
|
2438
|
+
# @return [String]
|
|
2439
|
+
#
|
|
2440
|
+
# source://tty-prompt//lib/tty/prompt/question.rb#186
|
|
2441
|
+
def render_error(errors); end
|
|
2442
|
+
|
|
2443
|
+
# Render question
|
|
2444
|
+
#
|
|
2445
|
+
# @api private
|
|
2446
|
+
# @return [String]
|
|
2447
|
+
#
|
|
2448
|
+
# source://tty-prompt//lib/tty/prompt/question.rb#142
|
|
2449
|
+
def render_question; end
|
|
2450
|
+
|
|
2451
|
+
# Ensure that passed argument is present or not
|
|
2452
|
+
#
|
|
2453
|
+
# @api public
|
|
2454
|
+
# @return [Boolean]
|
|
2455
|
+
#
|
|
2456
|
+
# source://tty-prompt//lib/tty/prompt/question.rb#278
|
|
2457
|
+
def required(value = T.unsafe(nil), message = T.unsafe(nil)); end
|
|
2458
|
+
|
|
2459
|
+
# Ensure that passed argument is present or not
|
|
2460
|
+
#
|
|
2461
|
+
# @api public
|
|
2462
|
+
# @return [Boolean]
|
|
2463
|
+
#
|
|
2464
|
+
# source://tty-prompt//lib/tty/prompt/question.rb#284
|
|
2465
|
+
def required?(value = T.unsafe(nil), message = T.unsafe(nil)); end
|
|
2466
|
+
|
|
2467
|
+
# @api public
|
|
2468
|
+
#
|
|
2469
|
+
# source://tty-prompt//lib/tty/prompt/question.rb#380
|
|
2470
|
+
def to_s; end
|
|
2471
|
+
|
|
2472
|
+
# Set validation rule for an argument
|
|
2473
|
+
#
|
|
2474
|
+
# @api public
|
|
2475
|
+
# @param value [Object]
|
|
2476
|
+
# @return [Question]
|
|
2477
|
+
#
|
|
2478
|
+
# source://tty-prompt//lib/tty/prompt/question.rb#293
|
|
2479
|
+
def validate(value = T.unsafe(nil), message = T.unsafe(nil), &block); end
|
|
2480
|
+
|
|
2481
|
+
# @api public
|
|
2482
|
+
#
|
|
2483
|
+
# source://tty-prompt//lib/tty/prompt/question.rb#32
|
|
2484
|
+
def validation; end
|
|
2485
|
+
|
|
2486
|
+
# @api public
|
|
2487
|
+
# @return [Boolean]
|
|
2488
|
+
#
|
|
2489
|
+
# source://tty-prompt//lib/tty/prompt/question.rb#314
|
|
2490
|
+
def validation?; end
|
|
2491
|
+
|
|
2492
|
+
# Prepopulate input with custom content
|
|
2493
|
+
#
|
|
2494
|
+
# @api public
|
|
2495
|
+
#
|
|
2496
|
+
# source://tty-prompt//lib/tty/prompt/question.rb#301
|
|
2497
|
+
def value(val); end
|
|
2498
|
+
|
|
2499
|
+
# Check if custom value is present
|
|
2500
|
+
#
|
|
2501
|
+
# @api private
|
|
2502
|
+
# @return [Boolean]
|
|
2503
|
+
#
|
|
2504
|
+
# source://tty-prompt//lib/tty/prompt/question.rb#310
|
|
2505
|
+
def value?; end
|
|
2506
|
+
end
|
|
2507
|
+
|
|
2508
|
+
# source://tty-prompt//lib/tty/prompt/question/checks.rb#8
|
|
2509
|
+
module TTY::Prompt::Question::Checks; end
|
|
2510
|
+
|
|
2511
|
+
# source://tty-prompt//lib/tty/prompt/question/checks.rb#87
|
|
2512
|
+
class TTY::Prompt::Question::Checks::CheckConversion
|
|
2513
|
+
class << self
|
|
2514
|
+
# source://tty-prompt//lib/tty/prompt/question/checks.rb#88
|
|
2515
|
+
def call(question, value); end
|
|
2516
|
+
end
|
|
2517
|
+
end
|
|
2518
|
+
|
|
2519
|
+
# Check if default value provided
|
|
2520
|
+
#
|
|
2521
|
+
# source://tty-prompt//lib/tty/prompt/question/checks.rb#66
|
|
2522
|
+
class TTY::Prompt::Question::Checks::CheckDefault
|
|
2523
|
+
class << self
|
|
2524
|
+
# source://tty-prompt//lib/tty/prompt/question/checks.rb#67
|
|
2525
|
+
def call(question, value); end
|
|
2526
|
+
end
|
|
2527
|
+
end
|
|
2528
|
+
|
|
2529
|
+
# Check if modifications are applicable
|
|
2530
|
+
#
|
|
2531
|
+
# source://tty-prompt//lib/tty/prompt/question/checks.rb#10
|
|
2532
|
+
class TTY::Prompt::Question::Checks::CheckModifier
|
|
2533
|
+
class << self
|
|
2534
|
+
# source://tty-prompt//lib/tty/prompt/question/checks.rb#11
|
|
2535
|
+
def call(question, value); end
|
|
2536
|
+
end
|
|
2537
|
+
end
|
|
2538
|
+
|
|
2539
|
+
# Check if value is within range
|
|
2540
|
+
#
|
|
2541
|
+
# source://tty-prompt//lib/tty/prompt/question/checks.rb#21
|
|
2542
|
+
class TTY::Prompt::Question::Checks::CheckRange
|
|
2543
|
+
class << self
|
|
2544
|
+
# source://tty-prompt//lib/tty/prompt/question/checks.rb#40
|
|
2545
|
+
def call(question, value); end
|
|
2546
|
+
|
|
2547
|
+
# source://tty-prompt//lib/tty/prompt/question/checks.rb#30
|
|
2548
|
+
def cast(value); end
|
|
2549
|
+
|
|
2550
|
+
# @return [Boolean]
|
|
2551
|
+
#
|
|
2552
|
+
# source://tty-prompt//lib/tty/prompt/question/checks.rb#22
|
|
2553
|
+
def float?(value); end
|
|
2554
|
+
|
|
2555
|
+
# @return [Boolean]
|
|
2556
|
+
#
|
|
2557
|
+
# source://tty-prompt//lib/tty/prompt/question/checks.rb#26
|
|
2558
|
+
def int?(value); end
|
|
2559
|
+
end
|
|
2560
|
+
end
|
|
2561
|
+
|
|
2562
|
+
# Check if input is required
|
|
2563
|
+
#
|
|
2564
|
+
# source://tty-prompt//lib/tty/prompt/question/checks.rb#77
|
|
2565
|
+
class TTY::Prompt::Question::Checks::CheckRequired
|
|
2566
|
+
class << self
|
|
2567
|
+
# source://tty-prompt//lib/tty/prompt/question/checks.rb#78
|
|
2568
|
+
def call(question, value); end
|
|
2569
|
+
end
|
|
2570
|
+
end
|
|
2571
|
+
|
|
2572
|
+
# Check if input requires validation
|
|
2573
|
+
#
|
|
2574
|
+
# source://tty-prompt//lib/tty/prompt/question/checks.rb#52
|
|
2575
|
+
class TTY::Prompt::Question::Checks::CheckValidation
|
|
2576
|
+
class << self
|
|
2577
|
+
# source://tty-prompt//lib/tty/prompt/question/checks.rb#53
|
|
2578
|
+
def call(question, value); end
|
|
2579
|
+
end
|
|
2580
|
+
end
|
|
2581
|
+
|
|
2582
|
+
# A class representing String modifications.
|
|
2583
|
+
#
|
|
2584
|
+
# source://tty-prompt//lib/tty/prompt/question/modifier.rb#7
|
|
2585
|
+
class TTY::Prompt::Question::Modifier
|
|
2586
|
+
# Initialize a Modifier
|
|
2587
|
+
#
|
|
2588
|
+
# @api public
|
|
2589
|
+
# @return [Modifier] a new instance of Modifier
|
|
2590
|
+
#
|
|
2591
|
+
# source://tty-prompt//lib/tty/prompt/question/modifier.rb#13
|
|
2592
|
+
def initialize(modifiers); end
|
|
2593
|
+
|
|
2594
|
+
# Change supplied value according to the given string transformation.
|
|
2595
|
+
# Valid settings are:
|
|
2596
|
+
#
|
|
2597
|
+
# @api private
|
|
2598
|
+
# @param value [String] the string to be modified
|
|
2599
|
+
# @return [String]
|
|
2600
|
+
#
|
|
2601
|
+
# source://tty-prompt//lib/tty/prompt/question/modifier.rb#26
|
|
2602
|
+
def apply_to(value); end
|
|
2603
|
+
|
|
2604
|
+
# Returns the value of attribute modifiers.
|
|
2605
|
+
#
|
|
2606
|
+
# source://tty-prompt//lib/tty/prompt/question/modifier.rb#8
|
|
2607
|
+
def modifiers; end
|
|
2608
|
+
|
|
2609
|
+
class << self
|
|
2610
|
+
# Changes letter casing in a string according to valid modifications.
|
|
2611
|
+
# For invalid modification option the string is preserved.
|
|
2612
|
+
#
|
|
2613
|
+
# @api public
|
|
2614
|
+
# @option mod
|
|
2615
|
+
# @option mod
|
|
2616
|
+
# @option mod
|
|
2617
|
+
# @option mod
|
|
2618
|
+
# @option mod
|
|
2619
|
+
# @option mod
|
|
2620
|
+
# @param mod [Symbol] the modification to change the string
|
|
2621
|
+
# @return [String]
|
|
2622
|
+
#
|
|
2623
|
+
# source://tty-prompt//lib/tty/prompt/question/modifier.rb#50
|
|
2624
|
+
def letter_case(mod, value); end
|
|
2625
|
+
|
|
2626
|
+
# Changes whitespace in a string according to valid modifications.
|
|
2627
|
+
#
|
|
2628
|
+
# @api public
|
|
2629
|
+
# @option mod
|
|
2630
|
+
# @option mod
|
|
2631
|
+
# @option mod
|
|
2632
|
+
# @option mod
|
|
2633
|
+
# @param mod [Symbol] the modification to change the string
|
|
2634
|
+
#
|
|
2635
|
+
# source://tty-prompt//lib/tty/prompt/question/modifier.rb#77
|
|
2636
|
+
def whitespace(mod, value); end
|
|
2637
|
+
end
|
|
2638
|
+
end
|
|
2639
|
+
|
|
2640
|
+
# @api public
|
|
2641
|
+
#
|
|
2642
|
+
# source://tty-prompt//lib/tty/prompt/question.rb#19
|
|
2643
|
+
class TTY::Prompt::Question::UndefinedSetting
|
|
2644
|
+
# source://tty-prompt//lib/tty/prompt/question.rb#23
|
|
2645
|
+
def inspect; end
|
|
2646
|
+
|
|
2647
|
+
# source://tty-prompt//lib/tty/prompt/question.rb#20
|
|
2648
|
+
def to_s; end
|
|
2649
|
+
end
|
|
2650
|
+
|
|
2651
|
+
# A class representing question validation.
|
|
2652
|
+
#
|
|
2653
|
+
# source://tty-prompt//lib/tty/prompt/question/validation.rb#7
|
|
2654
|
+
class TTY::Prompt::Question::Validation
|
|
2655
|
+
# Initialize a Validation
|
|
2656
|
+
#
|
|
2657
|
+
# @api private
|
|
2658
|
+
# @param pattern [Object]
|
|
2659
|
+
# @return [undefined]
|
|
2660
|
+
#
|
|
2661
|
+
# source://tty-prompt//lib/tty/prompt/question/validation.rb#22
|
|
2662
|
+
def initialize(pattern); end
|
|
2663
|
+
|
|
2664
|
+
# Test if the input passes the validation
|
|
2665
|
+
#
|
|
2666
|
+
# @api public
|
|
2667
|
+
# @example
|
|
2668
|
+
# Validation.new(/pattern/)
|
|
2669
|
+
# validation.call(input) # => true
|
|
2670
|
+
# @param input [Object] the input to validate
|
|
2671
|
+
# @return [Boolean]
|
|
2672
|
+
#
|
|
2673
|
+
# source://tty-prompt//lib/tty/prompt/question/validation.rb#57
|
|
2674
|
+
def call(input); end
|
|
2675
|
+
|
|
2676
|
+
# Convert validation into known type.
|
|
2677
|
+
#
|
|
2678
|
+
# @api private
|
|
2679
|
+
# @param pattern [Object]
|
|
2680
|
+
# @raise [TTY::ValidationCoercion] raised when failed to convert validation
|
|
2681
|
+
#
|
|
2682
|
+
# source://tty-prompt//lib/tty/prompt/question/validation.rb#34
|
|
2683
|
+
def coerce(pattern); end
|
|
2684
|
+
|
|
2685
|
+
# Returns the value of attribute pattern.
|
|
2686
|
+
#
|
|
2687
|
+
# source://tty-prompt//lib/tty/prompt/question/validation.rb#13
|
|
2688
|
+
def pattern; end
|
|
2689
|
+
end
|
|
2690
|
+
|
|
2691
|
+
# Available validator names
|
|
2692
|
+
#
|
|
2693
|
+
# source://tty-prompt//lib/tty/prompt/question/validation.rb#9
|
|
2694
|
+
TTY::Prompt::Question::Validation::VALIDATORS = T.let(T.unsafe(nil), Hash)
|
|
2695
|
+
|
|
2696
|
+
# Accumulates errors
|
|
2697
|
+
#
|
|
2698
|
+
# source://tty-prompt//lib/tty/prompt/result.rb#6
|
|
2699
|
+
class TTY::Prompt::Result
|
|
2700
|
+
# @return [Result] a new instance of Result
|
|
2701
|
+
#
|
|
2702
|
+
# source://tty-prompt//lib/tty/prompt/result.rb#9
|
|
2703
|
+
def initialize(question, value, errors = T.unsafe(nil)); end
|
|
2704
|
+
|
|
2705
|
+
# Returns the value of attribute errors.
|
|
2706
|
+
#
|
|
2707
|
+
# source://tty-prompt//lib/tty/prompt/result.rb#7
|
|
2708
|
+
def errors; end
|
|
2709
|
+
|
|
2710
|
+
# @return [Boolean]
|
|
2711
|
+
#
|
|
2712
|
+
# source://tty-prompt//lib/tty/prompt/result.rb#31
|
|
2713
|
+
def failure?; end
|
|
2714
|
+
|
|
2715
|
+
# Returns the value of attribute question.
|
|
2716
|
+
#
|
|
2717
|
+
# source://tty-prompt//lib/tty/prompt/result.rb#7
|
|
2718
|
+
def question; end
|
|
2719
|
+
|
|
2720
|
+
# @return [Boolean]
|
|
2721
|
+
#
|
|
2722
|
+
# source://tty-prompt//lib/tty/prompt/result.rb#27
|
|
2723
|
+
def success?; end
|
|
2724
|
+
|
|
2725
|
+
# Returns the value of attribute value.
|
|
2726
|
+
#
|
|
2727
|
+
# source://tty-prompt//lib/tty/prompt/result.rb#7
|
|
2728
|
+
def value; end
|
|
2729
|
+
|
|
2730
|
+
# source://tty-prompt//lib/tty/prompt/result.rb#15
|
|
2731
|
+
def with(condition = T.unsafe(nil), &block); end
|
|
2732
|
+
end
|
|
2733
|
+
|
|
2734
|
+
# source://tty-prompt//lib/tty/prompt/result.rb#38
|
|
2735
|
+
class TTY::Prompt::Result::Failure < ::TTY::Prompt::Result; end
|
|
2736
|
+
|
|
2737
|
+
# source://tty-prompt//lib/tty/prompt/result.rb#35
|
|
2738
|
+
class TTY::Prompt::Result::Success < ::TTY::Prompt::Result; end
|
|
2739
|
+
|
|
2740
|
+
# @api private
|
|
2741
|
+
#
|
|
2742
|
+
# source://tty-prompt//lib/tty/prompt/selected_choices.rb#6
|
|
2743
|
+
class TTY::Prompt::SelectedChoices
|
|
2744
|
+
include ::Enumerable
|
|
2745
|
+
|
|
2746
|
+
# Create selected choices
|
|
2747
|
+
#
|
|
2748
|
+
# @api public
|
|
2749
|
+
# @param indexes [Array<Integer>]
|
|
2750
|
+
# @param selected [Array<Choice>]
|
|
2751
|
+
# @return [SelectedChoices] a new instance of SelectedChoices
|
|
2752
|
+
#
|
|
2753
|
+
# source://tty-prompt//lib/tty/prompt/selected_choices.rb#17
|
|
2754
|
+
def initialize(selected = T.unsafe(nil), indexes = T.unsafe(nil)); end
|
|
2755
|
+
|
|
2756
|
+
# Clear selected choices
|
|
2757
|
+
#
|
|
2758
|
+
# @api public
|
|
2759
|
+
#
|
|
2760
|
+
# source://tty-prompt//lib/tty/prompt/selected_choices.rb#26
|
|
2761
|
+
def clear; end
|
|
2762
|
+
|
|
2763
|
+
# Delete choice at index
|
|
2764
|
+
#
|
|
2765
|
+
# @api public
|
|
2766
|
+
# @return [Choice] the deleted choice
|
|
2767
|
+
#
|
|
2768
|
+
# source://tty-prompt//lib/tty/prompt/selected_choices.rb#62
|
|
2769
|
+
def delete_at(index); end
|
|
2770
|
+
|
|
2771
|
+
# Iterate over selected choices
|
|
2772
|
+
#
|
|
2773
|
+
# @api public
|
|
2774
|
+
#
|
|
2775
|
+
# source://tty-prompt//lib/tty/prompt/selected_choices.rb#35
|
|
2776
|
+
def each(&block); end
|
|
2777
|
+
|
|
2778
|
+
# @api private
|
|
2779
|
+
#
|
|
2780
|
+
# source://tty-prompt//lib/tty/prompt/selected_choices.rb#72
|
|
2781
|
+
def find_index_by(&search); end
|
|
2782
|
+
|
|
2783
|
+
# Insert choice at index
|
|
2784
|
+
#
|
|
2785
|
+
# @api public
|
|
2786
|
+
# @param choice [Choice]
|
|
2787
|
+
# @param index [Integer]
|
|
2788
|
+
#
|
|
2789
|
+
# source://tty-prompt//lib/tty/prompt/selected_choices.rb#47
|
|
2790
|
+
def insert(index, choice); end
|
|
2791
|
+
|
|
2792
|
+
# @api private
|
|
2793
|
+
#
|
|
2794
|
+
# source://tty-prompt//lib/tty/prompt/selected_choices.rb#9
|
|
2795
|
+
def size; end
|
|
2796
|
+
end
|
|
2797
|
+
|
|
2798
|
+
# A class responsible for gathering numeric input from range
|
|
2799
|
+
#
|
|
2800
|
+
# @api public
|
|
2801
|
+
#
|
|
2802
|
+
# source://tty-prompt//lib/tty/prompt/slider.rb#9
|
|
2803
|
+
class TTY::Prompt::Slider
|
|
2804
|
+
# Initailize a Slider
|
|
2805
|
+
#
|
|
2806
|
+
# @api public
|
|
2807
|
+
# @option options
|
|
2808
|
+
# @option options
|
|
2809
|
+
# @option options
|
|
2810
|
+
# @option options
|
|
2811
|
+
# @param options [Hash] the options to configure this slider
|
|
2812
|
+
# @param prompt [Prompt] the prompt
|
|
2813
|
+
# @return [Slider] a new instance of Slider
|
|
2814
|
+
#
|
|
2815
|
+
# source://tty-prompt//lib/tty/prompt/slider.rb#26
|
|
2816
|
+
def initialize(prompt, **options); end
|
|
2817
|
+
|
|
2818
|
+
# Call the slider by passing question
|
|
2819
|
+
#
|
|
2820
|
+
# @api public
|
|
2821
|
+
# @param question [String] the question to ask
|
|
2822
|
+
#
|
|
2823
|
+
# source://tty-prompt//lib/tty/prompt/slider.rb#166
|
|
2824
|
+
def call(question, possibilities = T.unsafe(nil), &block); end
|
|
2825
|
+
|
|
2826
|
+
# Add a single choice
|
|
2827
|
+
#
|
|
2828
|
+
# @api public
|
|
2829
|
+
#
|
|
2830
|
+
# source://tty-prompt//lib/tty/prompt/slider.rb#126
|
|
2831
|
+
def choice(*value, &block); end
|
|
2832
|
+
|
|
2833
|
+
# Add multiple choices
|
|
2834
|
+
#
|
|
2835
|
+
# @api public
|
|
2836
|
+
# @param values [Array[Object]] the values to add as choices
|
|
2837
|
+
#
|
|
2838
|
+
# source://tty-prompt//lib/tty/prompt/slider.rb#140
|
|
2839
|
+
def choices(values = T.unsafe(nil)); end
|
|
2840
|
+
|
|
2841
|
+
# @api public
|
|
2842
|
+
#
|
|
2843
|
+
# source://tty-prompt//lib/tty/prompt/slider.rb#104
|
|
2844
|
+
def default(value); end
|
|
2845
|
+
|
|
2846
|
+
# Default help text
|
|
2847
|
+
#
|
|
2848
|
+
# @api public
|
|
2849
|
+
#
|
|
2850
|
+
# source://tty-prompt//lib/tty/prompt/slider.rb#78
|
|
2851
|
+
def default_help; end
|
|
2852
|
+
|
|
2853
|
+
# @api public
|
|
2854
|
+
#
|
|
2855
|
+
# source://tty-prompt//lib/tty/prompt/slider.rb#149
|
|
2856
|
+
def format(value); end
|
|
2857
|
+
|
|
2858
|
+
# Set help text
|
|
2859
|
+
#
|
|
2860
|
+
# @api private
|
|
2861
|
+
# @param text [String]
|
|
2862
|
+
#
|
|
2863
|
+
# source://tty-prompt//lib/tty/prompt/slider.rb#88
|
|
2864
|
+
def help(text = T.unsafe(nil)); end
|
|
2865
|
+
|
|
2866
|
+
# Setup initial active position
|
|
2867
|
+
#
|
|
2868
|
+
# @api private
|
|
2869
|
+
# @return [Integer]
|
|
2870
|
+
#
|
|
2871
|
+
# source://tty-prompt//lib/tty/prompt/slider.rb#62
|
|
2872
|
+
def initial; end
|
|
2873
|
+
|
|
2874
|
+
# @api public
|
|
2875
|
+
#
|
|
2876
|
+
# source://tty-prompt//lib/tty/prompt/slider.rb#183
|
|
2877
|
+
def keydown(*_arg0); end
|
|
2878
|
+
|
|
2879
|
+
# @api public
|
|
2880
|
+
#
|
|
2881
|
+
# source://tty-prompt//lib/tty/prompt/slider.rb#194
|
|
2882
|
+
def keyenter(*_arg0); end
|
|
2883
|
+
|
|
2884
|
+
# @api public
|
|
2885
|
+
#
|
|
2886
|
+
# source://tty-prompt//lib/tty/prompt/slider.rb#180
|
|
2887
|
+
def keyleft(*_arg0); end
|
|
2888
|
+
|
|
2889
|
+
# @api public
|
|
2890
|
+
#
|
|
2891
|
+
# source://tty-prompt//lib/tty/prompt/slider.rb#190
|
|
2892
|
+
def keyreturn(*_arg0); end
|
|
2893
|
+
|
|
2894
|
+
# @api public
|
|
2895
|
+
#
|
|
2896
|
+
# source://tty-prompt//lib/tty/prompt/slider.rb#185
|
|
2897
|
+
def keyright(*_arg0); end
|
|
2898
|
+
|
|
2899
|
+
# @api public
|
|
2900
|
+
#
|
|
2901
|
+
# source://tty-prompt//lib/tty/prompt/slider.rb#193
|
|
2902
|
+
def keyspace(*_arg0); end
|
|
2903
|
+
|
|
2904
|
+
# @api public
|
|
2905
|
+
#
|
|
2906
|
+
# source://tty-prompt//lib/tty/prompt/slider.rb#188
|
|
2907
|
+
def keyup(*_arg0); end
|
|
2908
|
+
|
|
2909
|
+
# @api public
|
|
2910
|
+
#
|
|
2911
|
+
# source://tty-prompt//lib/tty/prompt/slider.rb#114
|
|
2912
|
+
def max(value); end
|
|
2913
|
+
|
|
2914
|
+
# @api public
|
|
2915
|
+
#
|
|
2916
|
+
# source://tty-prompt//lib/tty/prompt/slider.rb#109
|
|
2917
|
+
def min(value); end
|
|
2918
|
+
|
|
2919
|
+
# Set quiet mode.
|
|
2920
|
+
#
|
|
2921
|
+
# @api public
|
|
2922
|
+
#
|
|
2923
|
+
# source://tty-prompt//lib/tty/prompt/slider.rb#156
|
|
2924
|
+
def quiet(value); end
|
|
2925
|
+
|
|
2926
|
+
# Change when help is displayed
|
|
2927
|
+
#
|
|
2928
|
+
# @api public
|
|
2929
|
+
#
|
|
2930
|
+
# source://tty-prompt//lib/tty/prompt/slider.rb#97
|
|
2931
|
+
def show_help(value = T.unsafe(nil)); end
|
|
2932
|
+
|
|
2933
|
+
# @api public
|
|
2934
|
+
#
|
|
2935
|
+
# source://tty-prompt//lib/tty/prompt/slider.rb#119
|
|
2936
|
+
def step(value); end
|
|
2937
|
+
|
|
2938
|
+
# Change symbols used by this prompt
|
|
2939
|
+
#
|
|
2940
|
+
# @api public
|
|
2941
|
+
# @param new_symbols [Hash] the new symbols to use
|
|
2942
|
+
#
|
|
2943
|
+
# source://tty-prompt//lib/tty/prompt/slider.rb#51
|
|
2944
|
+
def symbols(new_symbols = T.unsafe(nil)); end
|
|
2945
|
+
|
|
2946
|
+
private
|
|
2947
|
+
|
|
2948
|
+
# @api private
|
|
2949
|
+
# @return [Integer, String]
|
|
2950
|
+
#
|
|
2951
|
+
# source://tty-prompt//lib/tty/prompt/slider.rb#242
|
|
2952
|
+
def answer; end
|
|
2953
|
+
|
|
2954
|
+
# Check if help is always displayed
|
|
2955
|
+
#
|
|
2956
|
+
# @api private
|
|
2957
|
+
# @return [Boolean]
|
|
2958
|
+
#
|
|
2959
|
+
# source://tty-prompt//lib/tty/prompt/slider.rb#208
|
|
2960
|
+
def help_always?; end
|
|
2961
|
+
|
|
2962
|
+
# Check if help is shown only on start
|
|
2963
|
+
#
|
|
2964
|
+
# @api private
|
|
2965
|
+
# @return [Boolean]
|
|
2966
|
+
#
|
|
2967
|
+
# source://tty-prompt//lib/tty/prompt/slider.rb#201
|
|
2968
|
+
def help_start?; end
|
|
2969
|
+
|
|
2970
|
+
# Clear screen
|
|
2971
|
+
#
|
|
2972
|
+
# @api private
|
|
2973
|
+
# @param lines [Integer] the lines to clear
|
|
2974
|
+
#
|
|
2975
|
+
# source://tty-prompt//lib/tty/prompt/slider.rb#235
|
|
2976
|
+
def refresh(lines); end
|
|
2977
|
+
|
|
2978
|
+
# Render an interactive range slider.
|
|
2979
|
+
#
|
|
2980
|
+
# @api private
|
|
2981
|
+
#
|
|
2982
|
+
# source://tty-prompt//lib/tty/prompt/slider.rb#215
|
|
2983
|
+
def render; end
|
|
2984
|
+
|
|
2985
|
+
# Render question with the slider
|
|
2986
|
+
#
|
|
2987
|
+
# @api private
|
|
2988
|
+
# @return [String]
|
|
2989
|
+
#
|
|
2990
|
+
# source://tty-prompt//lib/tty/prompt/slider.rb#251
|
|
2991
|
+
def render_question; end
|
|
2992
|
+
|
|
2993
|
+
# Render slider representation
|
|
2994
|
+
#
|
|
2995
|
+
# @api private
|
|
2996
|
+
# @return [String]
|
|
2997
|
+
#
|
|
2998
|
+
# source://tty-prompt//lib/tty/prompt/slider.rb#272
|
|
2999
|
+
def render_slider; end
|
|
3000
|
+
end
|
|
3001
|
+
|
|
3002
|
+
# @api public
|
|
3003
|
+
#
|
|
3004
|
+
# source://tty-prompt//lib/tty/prompt/slider.rb#12
|
|
3005
|
+
TTY::Prompt::Slider::FORMAT = T.let(T.unsafe(nil), String)
|
|
3006
|
+
|
|
3007
|
+
# @api public
|
|
3008
|
+
#
|
|
3009
|
+
# source://tty-prompt//lib/tty/prompt/slider.rb#10
|
|
3010
|
+
TTY::Prompt::Slider::HELP = T.let(T.unsafe(nil), String)
|
|
3011
|
+
|
|
3012
|
+
# A class representing a statement output to prompt.
|
|
3013
|
+
#
|
|
3014
|
+
# source://tty-prompt//lib/tty/prompt/statement.rb#7
|
|
3015
|
+
class TTY::Prompt::Statement
|
|
3016
|
+
# Initialize a Statement
|
|
3017
|
+
#
|
|
3018
|
+
# @api public
|
|
3019
|
+
# @option options
|
|
3020
|
+
# @option options
|
|
3021
|
+
# @param options [Hash]
|
|
3022
|
+
# @param prompt [TTY::Prompt]
|
|
3023
|
+
# @return [Statement] a new instance of Statement
|
|
3024
|
+
#
|
|
3025
|
+
# source://tty-prompt//lib/tty/prompt/statement.rb#31
|
|
3026
|
+
def initialize(prompt, newline: T.unsafe(nil), color: T.unsafe(nil)); end
|
|
3027
|
+
|
|
3028
|
+
# Output the message to the prompt
|
|
3029
|
+
#
|
|
3030
|
+
# @api public
|
|
3031
|
+
# @param message [String] the message to be printed to stdout
|
|
3032
|
+
#
|
|
3033
|
+
# source://tty-prompt//lib/tty/prompt/statement.rb#43
|
|
3034
|
+
def call(message); end
|
|
3035
|
+
|
|
3036
|
+
# Color used to display statement
|
|
3037
|
+
#
|
|
3038
|
+
# @api public
|
|
3039
|
+
#
|
|
3040
|
+
# source://tty-prompt//lib/tty/prompt/statement.rb#16
|
|
3041
|
+
def color; end
|
|
3042
|
+
|
|
3043
|
+
# Flag to display newline
|
|
3044
|
+
#
|
|
3045
|
+
# @api public
|
|
3046
|
+
#
|
|
3047
|
+
# source://tty-prompt//lib/tty/prompt/statement.rb#11
|
|
3048
|
+
def newline; end
|
|
3049
|
+
end
|
|
3050
|
+
|
|
3051
|
+
# A class representing a suggestion out of possible choices
|
|
3052
|
+
#
|
|
3053
|
+
# @api public
|
|
3054
|
+
#
|
|
3055
|
+
# source://tty-prompt//lib/tty/prompt/suggestion.rb#11
|
|
3056
|
+
class TTY::Prompt::Suggestion
|
|
3057
|
+
# Initialize a Suggestion
|
|
3058
|
+
#
|
|
3059
|
+
# @api public
|
|
3060
|
+
# @return [Suggestion] a new instance of Suggestion
|
|
3061
|
+
#
|
|
3062
|
+
# source://tty-prompt//lib/tty/prompt/suggestion.rb#36
|
|
3063
|
+
def initialize(**options); end
|
|
3064
|
+
|
|
3065
|
+
# Number of spaces
|
|
3066
|
+
#
|
|
3067
|
+
# @api public
|
|
3068
|
+
#
|
|
3069
|
+
# source://tty-prompt//lib/tty/prompt/suggestion.rb#21
|
|
3070
|
+
def indent; end
|
|
3071
|
+
|
|
3072
|
+
# Text for multiple suggestions
|
|
3073
|
+
#
|
|
3074
|
+
# @api public
|
|
3075
|
+
#
|
|
3076
|
+
# source://tty-prompt//lib/tty/prompt/suggestion.rb#31
|
|
3077
|
+
def plural_text; end
|
|
3078
|
+
|
|
3079
|
+
# Text for a single suggestion
|
|
3080
|
+
#
|
|
3081
|
+
# @api public
|
|
3082
|
+
#
|
|
3083
|
+
# source://tty-prompt//lib/tty/prompt/suggestion.rb#26
|
|
3084
|
+
def single_text; end
|
|
3085
|
+
|
|
3086
|
+
# Suggest matches out of possibile strings
|
|
3087
|
+
#
|
|
3088
|
+
# @api public
|
|
3089
|
+
# @param message [String]
|
|
3090
|
+
# @param possibilities [Array[String]]
|
|
3091
|
+
#
|
|
3092
|
+
# source://tty-prompt//lib/tty/prompt/suggestion.rb#51
|
|
3093
|
+
def suggest(message, possibilities); end
|
|
3094
|
+
|
|
3095
|
+
private
|
|
3096
|
+
|
|
3097
|
+
# @api private
|
|
3098
|
+
#
|
|
3099
|
+
# source://tty-prompt//lib/tty/prompt/suggestion.rb#105
|
|
3100
|
+
def build_multiple_suggestions; end
|
|
3101
|
+
|
|
3102
|
+
# @api private
|
|
3103
|
+
#
|
|
3104
|
+
# source://tty-prompt//lib/tty/prompt/suggestion.rb#100
|
|
3105
|
+
def build_single_suggestion; end
|
|
3106
|
+
|
|
3107
|
+
# Build up a suggestion string
|
|
3108
|
+
#
|
|
3109
|
+
# @api private
|
|
3110
|
+
# @param suggestions [Array[String]]
|
|
3111
|
+
# @return [String]
|
|
3112
|
+
#
|
|
3113
|
+
# source://tty-prompt//lib/tty/prompt/suggestion.rb#89
|
|
3114
|
+
def evaluate; end
|
|
3115
|
+
|
|
3116
|
+
# Measure distances between messag and possibilities
|
|
3117
|
+
#
|
|
3118
|
+
# @api private
|
|
3119
|
+
# @param message [String]
|
|
3120
|
+
# @param possibilities [Array[String]]
|
|
3121
|
+
# @return [Hash]
|
|
3122
|
+
#
|
|
3123
|
+
# source://tty-prompt//lib/tty/prompt/suggestion.rb#73
|
|
3124
|
+
def measure_distances(message, possibilities); end
|
|
3125
|
+
end
|
|
3126
|
+
|
|
3127
|
+
# @api public
|
|
3128
|
+
#
|
|
3129
|
+
# source://tty-prompt//lib/tty/prompt/suggestion.rb#12
|
|
3130
|
+
TTY::Prompt::Suggestion::DEFAULT_INDENT = T.let(T.unsafe(nil), Integer)
|
|
3131
|
+
|
|
3132
|
+
# @api public
|
|
3133
|
+
#
|
|
3134
|
+
# source://tty-prompt//lib/tty/prompt/suggestion.rb#16
|
|
3135
|
+
TTY::Prompt::Suggestion::PLURAL_TEXT = T.let(T.unsafe(nil), String)
|
|
3136
|
+
|
|
3137
|
+
# @api public
|
|
3138
|
+
#
|
|
3139
|
+
# source://tty-prompt//lib/tty/prompt/suggestion.rb#14
|
|
3140
|
+
TTY::Prompt::Suggestion::SINGLE_TEXT = T.let(T.unsafe(nil), String)
|
|
3141
|
+
|
|
3142
|
+
# Cross platform common Unicode symbols.
|
|
3143
|
+
#
|
|
3144
|
+
# @api public
|
|
3145
|
+
#
|
|
3146
|
+
# source://tty-prompt//lib/tty/prompt/symbols.rb#8
|
|
3147
|
+
module TTY::Prompt::Symbols
|
|
3148
|
+
private
|
|
3149
|
+
|
|
3150
|
+
# @api public
|
|
3151
|
+
#
|
|
3152
|
+
# source://tty-prompt//lib/tty/prompt/symbols.rb#73
|
|
3153
|
+
def symbols; end
|
|
3154
|
+
|
|
3155
|
+
# Check if Windowz
|
|
3156
|
+
#
|
|
3157
|
+
# @api public
|
|
3158
|
+
# @return [Boolean]
|
|
3159
|
+
#
|
|
3160
|
+
# source://tty-prompt//lib/tty/prompt/symbols.rb#83
|
|
3161
|
+
def windows?; end
|
|
3162
|
+
|
|
3163
|
+
class << self
|
|
3164
|
+
# @api public
|
|
3165
|
+
#
|
|
3166
|
+
# source://tty-prompt//lib/tty/prompt/symbols.rb#76
|
|
3167
|
+
def symbols; end
|
|
3168
|
+
|
|
3169
|
+
# Check if Windowz
|
|
3170
|
+
#
|
|
3171
|
+
# @api public
|
|
3172
|
+
# @return [Boolean]
|
|
3173
|
+
#
|
|
3174
|
+
# source://tty-prompt//lib/tty/prompt/symbols.rb#86
|
|
3175
|
+
def windows?; end
|
|
3176
|
+
end
|
|
3177
|
+
end
|
|
3178
|
+
|
|
3179
|
+
# @api public
|
|
3180
|
+
#
|
|
3181
|
+
# source://tty-prompt//lib/tty/prompt/symbols.rb#9
|
|
3182
|
+
TTY::Prompt::Symbols::KEYS = T.let(T.unsafe(nil), Hash)
|
|
3183
|
+
|
|
3184
|
+
# @api public
|
|
3185
|
+
#
|
|
3186
|
+
# source://tty-prompt//lib/tty/prompt/symbols.rb#41
|
|
3187
|
+
TTY::Prompt::Symbols::WIN_KEYS = T.let(T.unsafe(nil), Hash)
|
|
3188
|
+
|
|
3189
|
+
# source://tty-prompt//lib/tty/prompt/timer.rb#5
|
|
3190
|
+
class TTY::Prompt::Timer
|
|
3191
|
+
# @return [Timer] a new instance of Timer
|
|
3192
|
+
#
|
|
3193
|
+
# source://tty-prompt//lib/tty/prompt/timer.rb#12
|
|
3194
|
+
def initialize(duration, interval); end
|
|
3195
|
+
|
|
3196
|
+
# Returns the value of attribute duration.
|
|
3197
|
+
#
|
|
3198
|
+
# source://tty-prompt//lib/tty/prompt/timer.rb#6
|
|
3199
|
+
def duration; end
|
|
3200
|
+
|
|
3201
|
+
# Returns the value of attribute interval.
|
|
3202
|
+
#
|
|
3203
|
+
# source://tty-prompt//lib/tty/prompt/timer.rb#10
|
|
3204
|
+
def interval; end
|
|
3205
|
+
|
|
3206
|
+
# source://tty-prompt//lib/tty/prompt/timer.rb#36
|
|
3207
|
+
def on_tick(&block); end
|
|
3208
|
+
|
|
3209
|
+
# source://tty-prompt//lib/tty/prompt/timer.rb#32
|
|
3210
|
+
def runtime; end
|
|
3211
|
+
|
|
3212
|
+
# source://tty-prompt//lib/tty/prompt/timer.rb#20
|
|
3213
|
+
def start; end
|
|
3214
|
+
|
|
3215
|
+
# source://tty-prompt//lib/tty/prompt/timer.rb#26
|
|
3216
|
+
def stop; end
|
|
3217
|
+
|
|
3218
|
+
# Object represeting current time
|
|
3219
|
+
#
|
|
3220
|
+
# source://tty-prompt//lib/tty/prompt/timer.rb#64
|
|
3221
|
+
def time_now; end
|
|
3222
|
+
|
|
3223
|
+
# Returns the value of attribute total.
|
|
3224
|
+
#
|
|
3225
|
+
# source://tty-prompt//lib/tty/prompt/timer.rb#8
|
|
3226
|
+
def total; end
|
|
3227
|
+
|
|
3228
|
+
# source://tty-prompt//lib/tty/prompt/timer.rb#40
|
|
3229
|
+
def while_remaining; end
|
|
3230
|
+
end
|
|
3231
|
+
|
|
3232
|
+
# Raised when conversion type isn't registered
|
|
3233
|
+
#
|
|
3234
|
+
# source://tty-prompt//lib/tty/prompt/errors.rb#29
|
|
3235
|
+
class TTY::Prompt::UnsupportedConversion < ::TTY::Prompt::Error; end
|
|
3236
|
+
|
|
3237
|
+
# source://tty-prompt//lib/tty/prompt/version.rb#5
|
|
3238
|
+
TTY::Prompt::VERSION = T.let(T.unsafe(nil), String)
|
|
3239
|
+
|
|
3240
|
+
# Raised when the passed in validation argument is of wrong type
|
|
3241
|
+
#
|
|
3242
|
+
# source://tty-prompt//lib/tty/prompt/errors.rb#14
|
|
3243
|
+
class TTY::Prompt::ValidationCoercion < ::TTY::Prompt::Error; end
|
|
3244
|
+
|
|
3245
|
+
# source://tty-prompt//lib/tty/prompt/utils.rb#4
|
|
3246
|
+
module TTY::Utils
|
|
3247
|
+
private
|
|
3248
|
+
|
|
3249
|
+
# Check if value is nil or an empty string
|
|
3250
|
+
#
|
|
3251
|
+
# @api public
|
|
3252
|
+
# @param value [Object] the value to check
|
|
3253
|
+
# @return [Boolean]
|
|
3254
|
+
#
|
|
3255
|
+
# source://tty-prompt//lib/tty/prompt/utils.rb#31
|
|
3256
|
+
def blank?(value); end
|
|
3257
|
+
|
|
3258
|
+
# Deep copy object
|
|
3259
|
+
#
|
|
3260
|
+
# @api public
|
|
3261
|
+
#
|
|
3262
|
+
# source://tty-prompt//lib/tty/prompt/utils.rb#38
|
|
3263
|
+
def deep_copy(object); end
|
|
3264
|
+
|
|
3265
|
+
# Extract options hash from array argument
|
|
3266
|
+
#
|
|
3267
|
+
# @api public
|
|
3268
|
+
# @param args [Array[Object]]
|
|
3269
|
+
#
|
|
3270
|
+
# source://tty-prompt//lib/tty/prompt/utils.rb#14
|
|
3271
|
+
def extract_options(args); end
|
|
3272
|
+
|
|
3273
|
+
# source://tty-prompt//lib/tty/prompt/utils.rb#19
|
|
3274
|
+
def extract_options!(args); end
|
|
3275
|
+
|
|
3276
|
+
class << self
|
|
3277
|
+
# Check if value is nil or an empty string
|
|
3278
|
+
#
|
|
3279
|
+
# @api public
|
|
3280
|
+
# @param value [Object] the value to check
|
|
3281
|
+
# @return [Boolean]
|
|
3282
|
+
#
|
|
3283
|
+
# source://tty-prompt//lib/tty/prompt/utils.rb#31
|
|
3284
|
+
def blank?(value); end
|
|
3285
|
+
|
|
3286
|
+
# Deep copy object
|
|
3287
|
+
#
|
|
3288
|
+
# @api public
|
|
3289
|
+
#
|
|
3290
|
+
# source://tty-prompt//lib/tty/prompt/utils.rb#38
|
|
3291
|
+
def deep_copy(object); end
|
|
3292
|
+
|
|
3293
|
+
# Extract options hash from array argument
|
|
3294
|
+
#
|
|
3295
|
+
# @api public
|
|
3296
|
+
# @param args [Array[Object]]
|
|
3297
|
+
#
|
|
3298
|
+
# source://tty-prompt//lib/tty/prompt/utils.rb#14
|
|
3299
|
+
def extract_options(args); end
|
|
3300
|
+
|
|
3301
|
+
# source://tty-prompt//lib/tty/prompt/utils.rb#19
|
|
3302
|
+
def extract_options!(args); end
|
|
3303
|
+
end
|
|
3304
|
+
end
|
|
3305
|
+
|
|
3306
|
+
# source://tty-prompt//lib/tty/prompt/utils.rb#7
|
|
3307
|
+
TTY::Utils::BLANK_REGEX = T.let(T.unsafe(nil), Regexp)
|