cli-ui 2.3.1 → 2.6.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/lib/cli/ui/ansi.rb +23 -27
- data/lib/cli/ui/color.rb +8 -13
- data/lib/cli/ui/formatter.rb +24 -23
- data/lib/cli/ui/frame/frame_stack.rb +9 -21
- data/lib/cli/ui/frame/frame_style/box.rb +11 -10
- data/lib/cli/ui/frame/frame_style/bracket.rb +11 -10
- data/lib/cli/ui/frame/frame_style.rb +31 -22
- data/lib/cli/ui/frame.rb +12 -43
- data/lib/cli/ui/glyph.rb +8 -14
- data/lib/cli/ui/os.rb +9 -10
- data/lib/cli/ui/printer.rb +1 -15
- data/lib/cli/ui/progress.rb +20 -23
- data/lib/cli/ui/progress_reporter.rb +209 -0
- data/lib/cli/ui/prompt/interactive_options.rb +85 -53
- data/lib/cli/ui/prompt/options_handler.rb +4 -6
- data/lib/cli/ui/prompt.rb +22 -45
- data/lib/cli/ui/spinner/async.rb +3 -7
- data/lib/cli/ui/spinner/spin_group.rb +205 -135
- data/lib/cli/ui/spinner.rb +3 -16
- data/lib/cli/ui/stdout_router.rb +38 -55
- data/lib/cli/ui/table.rb +3 -7
- data/lib/cli/ui/terminal.rb +4 -8
- data/lib/cli/ui/truncater.rb +5 -6
- data/lib/cli/ui/version.rb +1 -1
- data/lib/cli/ui/widgets/base.rb +13 -14
- data/lib/cli/ui/widgets/status.rb +10 -10
- data/lib/cli/ui/widgets.rb +7 -15
- data/lib/cli/ui/work_queue.rb +23 -27
- data/lib/cli/ui/wrap.rb +3 -5
- data/lib/cli/ui.rb +42 -97
- metadata +4 -7
- data/lib/cli/ui/sorbet_runtime_stub.rb +0 -169
data/lib/cli/ui/work_queue.rb
CHANGED
@@ -4,22 +4,18 @@
|
|
4
4
|
module CLI
|
5
5
|
module UI
|
6
6
|
class WorkQueue
|
7
|
-
extend T::Sig
|
8
|
-
|
9
7
|
class Future
|
10
|
-
|
11
|
-
|
12
|
-
sig { void }
|
8
|
+
#: -> void
|
13
9
|
def initialize
|
14
|
-
@mutex =
|
15
|
-
@condition =
|
16
|
-
@completed =
|
17
|
-
@started =
|
18
|
-
@result =
|
19
|
-
@error =
|
10
|
+
@mutex = Mutex.new #: Mutex
|
11
|
+
@condition = ConditionVariable.new #: ConditionVariable
|
12
|
+
@completed = false #: bool
|
13
|
+
@started = false #: bool
|
14
|
+
@result = nil #: untyped
|
15
|
+
@error = nil #: Exception?
|
20
16
|
end
|
21
17
|
|
22
|
-
|
18
|
+
#: (untyped result) -> void
|
23
19
|
def complete(result)
|
24
20
|
@mutex.synchronize do
|
25
21
|
@completed = true
|
@@ -28,7 +24,7 @@ module CLI
|
|
28
24
|
end
|
29
25
|
end
|
30
26
|
|
31
|
-
|
27
|
+
#: (Exception error) -> void
|
32
28
|
def fail(error)
|
33
29
|
@mutex.synchronize do
|
34
30
|
return if @completed
|
@@ -39,7 +35,7 @@ module CLI
|
|
39
35
|
end
|
40
36
|
end
|
41
37
|
|
42
|
-
|
38
|
+
#: -> untyped
|
43
39
|
def value
|
44
40
|
@mutex.synchronize do
|
45
41
|
@condition.wait(@mutex) until @completed
|
@@ -49,17 +45,17 @@ module CLI
|
|
49
45
|
end
|
50
46
|
end
|
51
47
|
|
52
|
-
|
48
|
+
#: -> bool
|
53
49
|
def completed?
|
54
50
|
@mutex.synchronize { @completed }
|
55
51
|
end
|
56
52
|
|
57
|
-
|
53
|
+
#: -> bool
|
58
54
|
def started?
|
59
55
|
@mutex.synchronize { @started }
|
60
56
|
end
|
61
57
|
|
62
|
-
|
58
|
+
#: -> void
|
63
59
|
def start
|
64
60
|
@mutex.synchronize do
|
65
61
|
@started = true
|
@@ -68,16 +64,16 @@ module CLI
|
|
68
64
|
end
|
69
65
|
end
|
70
66
|
|
71
|
-
|
67
|
+
#: (Integer max_concurrent) -> void
|
72
68
|
def initialize(max_concurrent)
|
73
69
|
@max_concurrent = max_concurrent
|
74
|
-
@queue =
|
75
|
-
@mutex =
|
76
|
-
@condition =
|
77
|
-
@workers =
|
70
|
+
@queue = Queue.new #: Queue
|
71
|
+
@mutex = Mutex.new #: Mutex
|
72
|
+
@condition = ConditionVariable.new #: ConditionVariable
|
73
|
+
@workers = [] #: Array[Thread]
|
78
74
|
end
|
79
75
|
|
80
|
-
|
76
|
+
#: { -> untyped } -> Future
|
81
77
|
def enqueue(&block)
|
82
78
|
future = Future.new
|
83
79
|
@mutex.synchronize do
|
@@ -87,18 +83,18 @@ module CLI
|
|
87
83
|
future
|
88
84
|
end
|
89
85
|
|
90
|
-
|
86
|
+
#: -> void
|
91
87
|
def close
|
92
88
|
@queue.close
|
93
89
|
end
|
94
90
|
|
95
|
-
|
91
|
+
#: -> void
|
96
92
|
def wait
|
97
93
|
@queue.close
|
98
94
|
@workers.each(&:join)
|
99
95
|
end
|
100
96
|
|
101
|
-
|
97
|
+
#: -> void
|
102
98
|
def interrupt
|
103
99
|
@mutex.synchronize do
|
104
100
|
@queue.close
|
@@ -116,7 +112,7 @@ module CLI
|
|
116
112
|
|
117
113
|
private
|
118
114
|
|
119
|
-
|
115
|
+
#: -> void
|
120
116
|
def start_worker
|
121
117
|
@workers << Thread.new do
|
122
118
|
loop do
|
data/lib/cli/ui/wrap.rb
CHANGED
@@ -9,17 +9,15 @@ require 'cli/ui/frame/frame_style'
|
|
9
9
|
module CLI
|
10
10
|
module UI
|
11
11
|
class Wrap
|
12
|
-
|
13
|
-
|
14
|
-
sig { params(input: String).void }
|
12
|
+
#: (String input) -> void
|
15
13
|
def initialize(input)
|
16
14
|
@input = input
|
17
15
|
end
|
18
16
|
|
19
|
-
|
17
|
+
#: (?Integer total_width) -> String
|
20
18
|
def wrap(total_width = Terminal.width)
|
21
19
|
max_width = total_width - Frame.prefix_width
|
22
|
-
width =
|
20
|
+
width = 0 #: Integer
|
23
21
|
final = []
|
24
22
|
# Create an alternation of format codes of parameter lengths 1-20, since + and {1,n} not allowed in lookbehind
|
25
23
|
format_codes = (1..20).map { |n| /\x1b\[[\d;]{#{n}}m/ }.join('|')
|
data/lib/cli/ui.rb
CHANGED
@@ -1,40 +1,33 @@
|
|
1
1
|
# typed: true
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
|
-
unless defined?(T)
|
5
|
-
require('cli/ui/sorbet_runtime_stub')
|
6
|
-
end
|
7
|
-
|
8
4
|
module CLI
|
9
5
|
module UI
|
10
|
-
|
11
|
-
|
12
|
-
autoload :
|
13
|
-
autoload :
|
14
|
-
autoload :
|
15
|
-
autoload :
|
16
|
-
autoload :
|
17
|
-
autoload :
|
18
|
-
autoload :
|
19
|
-
autoload :
|
20
|
-
autoload :
|
21
|
-
autoload :
|
22
|
-
autoload :
|
23
|
-
autoload :
|
24
|
-
autoload :
|
25
|
-
autoload :
|
26
|
-
autoload :Wrap, 'cli/ui/wrap'
|
6
|
+
autoload :ANSI, 'cli/ui/ansi'
|
7
|
+
autoload :Glyph, 'cli/ui/glyph'
|
8
|
+
autoload :Color, 'cli/ui/color'
|
9
|
+
autoload :Frame, 'cli/ui/frame'
|
10
|
+
autoload :OS, 'cli/ui/os'
|
11
|
+
autoload :Printer, 'cli/ui/printer'
|
12
|
+
autoload :Progress, 'cli/ui/progress'
|
13
|
+
autoload :ProgressReporter, 'cli/ui/progress_reporter'
|
14
|
+
autoload :Prompt, 'cli/ui/prompt'
|
15
|
+
autoload :Table, 'cli/ui/table'
|
16
|
+
autoload :Terminal, 'cli/ui/terminal'
|
17
|
+
autoload :Truncater, 'cli/ui/truncater'
|
18
|
+
autoload :Formatter, 'cli/ui/formatter'
|
19
|
+
autoload :Spinner, 'cli/ui/spinner'
|
20
|
+
autoload :Widgets, 'cli/ui/widgets'
|
21
|
+
autoload :Wrap, 'cli/ui/wrap'
|
27
22
|
|
28
23
|
# Convenience accessor to +CLI::UI::Spinner::SpinGroup+
|
29
24
|
SpinGroup = Spinner::SpinGroup
|
30
25
|
|
31
|
-
|
32
|
-
|
33
|
-
|
26
|
+
#: type colorable = Symbol | String | CLI::UI::Color
|
27
|
+
#: type frame_stylable = Symbol | String | CLI::UI::Frame::FrameStyle
|
28
|
+
#: type io_like = IO | StringIO
|
34
29
|
|
35
30
|
class << self
|
36
|
-
extend T::Sig
|
37
|
-
|
38
31
|
# Glyph resolution using +CLI::UI::Glyph.lookup+
|
39
32
|
# Look at the method signature for +Glyph.lookup+ for more details
|
40
33
|
#
|
@@ -42,7 +35,7 @@ module CLI
|
|
42
35
|
#
|
43
36
|
# * +handle+ - handle of the glyph to resolve
|
44
37
|
#
|
45
|
-
|
38
|
+
#: (String handle) -> Glyph
|
46
39
|
def glyph(handle)
|
47
40
|
CLI::UI::Glyph.lookup(handle)
|
48
41
|
end
|
@@ -54,7 +47,7 @@ module CLI
|
|
54
47
|
#
|
55
48
|
# * +input+ - color to resolve
|
56
49
|
#
|
57
|
-
|
50
|
+
#: (colorable input) -> CLI::UI::Color
|
58
51
|
def resolve_color(input)
|
59
52
|
case input
|
60
53
|
when CLI::UI::Color
|
@@ -70,7 +63,7 @@ module CLI
|
|
70
63
|
# ==== Attributes
|
71
64
|
#
|
72
65
|
# * +input+ - frame style to resolve
|
73
|
-
|
66
|
+
#: (frame_stylable input) -> CLI::UI::Frame::FrameStyle
|
74
67
|
def resolve_style(input)
|
75
68
|
case input
|
76
69
|
when CLI::UI::Frame::FrameStyle
|
@@ -86,7 +79,7 @@ module CLI
|
|
86
79
|
#
|
87
80
|
# * +question+ - question to confirm
|
88
81
|
#
|
89
|
-
|
82
|
+
#: (String question, ?default: bool) -> bool
|
90
83
|
def confirm(question, default: true)
|
91
84
|
CLI::UI::Prompt.confirm(question, default: default)
|
92
85
|
end
|
@@ -97,25 +90,13 @@ module CLI
|
|
97
90
|
#
|
98
91
|
# * +prompt+ - prompt to present
|
99
92
|
#
|
100
|
-
|
93
|
+
#: (?String prompt) -> String?
|
101
94
|
def any_key(prompt = 'Press any key to continue')
|
102
95
|
CLI::UI::Prompt.any_key(prompt)
|
103
96
|
end
|
104
97
|
|
105
98
|
# Convenience Method for +CLI::UI::Prompt.ask+
|
106
|
-
|
107
|
-
params(
|
108
|
-
question: String,
|
109
|
-
options: T.nilable(T::Array[String]),
|
110
|
-
default: T.nilable(T.any(String, T::Array[String])),
|
111
|
-
is_file: T::Boolean,
|
112
|
-
allow_empty: T::Boolean,
|
113
|
-
multiple: T::Boolean,
|
114
|
-
filter_ui: T::Boolean,
|
115
|
-
select_ui: T::Boolean,
|
116
|
-
options_proc: T.nilable(T.proc.params(handler: Prompt::OptionsHandler).void),
|
117
|
-
).returns(T.any(String, T::Array[String]))
|
118
|
-
end
|
99
|
+
#: (String question, ?options: Array[String]?, ?default: (String | Array[String])?, ?is_file: bool, ?allow_empty: bool, ?multiple: bool, ?filter_ui: bool, ?select_ui: bool) ?{ (Prompt::OptionsHandler handler) -> void } -> (String | Array[String])
|
119
100
|
def ask(
|
120
101
|
question,
|
121
102
|
options: nil,
|
@@ -149,7 +130,7 @@ module CLI
|
|
149
130
|
# * +truncate_to+ - number of characters to truncate the string to (or nil)
|
150
131
|
# * +enable_color+ - should color be used? default to true unless output is redirected.
|
151
132
|
#
|
152
|
-
|
133
|
+
#: (String input, ?truncate_to: Integer?, ?enable_color: bool) -> String
|
153
134
|
def resolve_text(input, truncate_to: nil, enable_color: enable_color?)
|
154
135
|
formatted = CLI::UI::Formatter.new(input).format(enable_color: enable_color)
|
155
136
|
return formatted unless truncate_to
|
@@ -171,12 +152,12 @@ module CLI
|
|
171
152
|
#
|
172
153
|
# * +enable_color+ - should color be used? default to true unless output is redirected.
|
173
154
|
#
|
174
|
-
|
155
|
+
#: (String input, ?enable_color: bool) -> String
|
175
156
|
def fmt(input, enable_color: enable_color?)
|
176
157
|
CLI::UI::Formatter.new(input).format(enable_color: enable_color)
|
177
158
|
end
|
178
159
|
|
179
|
-
|
160
|
+
#: (String input) -> String
|
180
161
|
def wrap(input)
|
181
162
|
CLI::UI::Wrap.new(input).wrap
|
182
163
|
end
|
@@ -188,17 +169,7 @@ module CLI
|
|
188
169
|
# * +msg+ - Message to print
|
189
170
|
# * +kwargs+ - keyword arguments for +Printer.puts+
|
190
171
|
#
|
191
|
-
|
192
|
-
params(
|
193
|
-
msg: String,
|
194
|
-
frame_color: T.nilable(Colorable),
|
195
|
-
to: IOLike,
|
196
|
-
encoding: Encoding,
|
197
|
-
format: T::Boolean,
|
198
|
-
graceful: T::Boolean,
|
199
|
-
wrap: T::Boolean,
|
200
|
-
).void
|
201
|
-
end
|
172
|
+
#: (String msg, ?frame_color: colorable?, ?to: io_like, ?encoding: Encoding, ?format: bool, ?graceful: bool, ?wrap: bool) -> void
|
202
173
|
def puts(
|
203
174
|
msg,
|
204
175
|
frame_color: nil,
|
@@ -226,18 +197,7 @@ module CLI
|
|
226
197
|
# * +args+ - arguments for +Frame.open+
|
227
198
|
# * +block+ - block for +Frame.open+
|
228
199
|
#
|
229
|
-
|
230
|
-
type_parameters(:T).params(
|
231
|
-
text: String,
|
232
|
-
color: T.nilable(Colorable),
|
233
|
-
failure_text: T.nilable(String),
|
234
|
-
success_text: T.nilable(String),
|
235
|
-
timing: T.any(T::Boolean, Numeric),
|
236
|
-
frame_style: FrameStylable,
|
237
|
-
to: IOLike,
|
238
|
-
block: T.nilable(T.proc.returns(T.type_parameter(:T))),
|
239
|
-
).returns(T.nilable(T.type_parameter(:T)))
|
240
|
-
end
|
200
|
+
#: [T] (String text, ?color: colorable?, ?failure_text: String?, ?success_text: String?, ?timing: (Numeric | bool), ?frame_style: frame_stylable, ?to: io_like) ?{ -> T } -> T?
|
241
201
|
def frame(
|
242
202
|
text,
|
243
203
|
color: Frame::DEFAULT_FRAME_COLOR,
|
@@ -267,14 +227,7 @@ module CLI
|
|
267
227
|
# * +args+ - arguments for +Spinner.open+
|
268
228
|
# * +block+ - block for +Spinner.open+
|
269
229
|
#
|
270
|
-
|
271
|
-
params(
|
272
|
-
title: String,
|
273
|
-
auto_debrief: T::Boolean,
|
274
|
-
to: IOLike,
|
275
|
-
block: T.proc.params(task: Spinner::SpinGroup::Task).void,
|
276
|
-
).returns(T::Boolean)
|
277
|
-
end
|
230
|
+
#: (String title, ?auto_debrief: bool, ?to: io_like) { (Spinner::SpinGroup::Task task) -> void } -> bool
|
278
231
|
def spinner(title, auto_debrief: true, to: $stdout, &block)
|
279
232
|
CLI::UI::Spinner.spin(title, auto_debrief: auto_debrief, to: to, &block)
|
280
233
|
end
|
@@ -286,11 +239,7 @@ module CLI
|
|
286
239
|
# * +color+ - color to override to
|
287
240
|
# * +block+ - block for +Frame.with_frame_color_override+
|
288
241
|
#
|
289
|
-
|
290
|
-
type_parameters(:T)
|
291
|
-
.params(color: Colorable, block: T.proc.returns(T.type_parameter(:T)))
|
292
|
-
.returns(T.type_parameter(:T))
|
293
|
-
end
|
242
|
+
#: [T] (colorable color) { -> T } -> T
|
294
243
|
def with_frame_color(color, &block)
|
295
244
|
CLI::UI::Frame.with_frame_color_override(color, &block)
|
296
245
|
end
|
@@ -301,11 +250,7 @@ module CLI
|
|
301
250
|
#
|
302
251
|
# * +path+ - path to duplicate output to
|
303
252
|
#
|
304
|
-
|
305
|
-
type_parameters(:T)
|
306
|
-
.params(path: String, block: T.proc.returns(T.type_parameter(:T)))
|
307
|
-
.returns(T.type_parameter(:T))
|
308
|
-
end
|
253
|
+
#: [T] (String path) { -> T } -> T
|
309
254
|
def log_output_to(path, &block)
|
310
255
|
if CLI::UI::StdoutRouter.duplicate_output_to
|
311
256
|
raise 'multiple logs not allowed'
|
@@ -330,7 +275,7 @@ module CLI
|
|
330
275
|
#
|
331
276
|
# * +block+ - block in which to disable frames
|
332
277
|
#
|
333
|
-
|
278
|
+
#: [T] { -> T } -> T
|
334
279
|
def raw(&block)
|
335
280
|
prev = Thread.current[:no_cliui_frame_inset]
|
336
281
|
Thread.current[:no_cliui_frame_inset] = true
|
@@ -343,7 +288,7 @@ module CLI
|
|
343
288
|
# By default, colour is enabled when STDOUT is a TTY; that is, when output
|
344
289
|
# has not been directed to another program or to a file.
|
345
290
|
#
|
346
|
-
|
291
|
+
#: -> bool
|
347
292
|
def enable_color?
|
348
293
|
@enable_color
|
349
294
|
end
|
@@ -354,7 +299,7 @@ module CLI
|
|
354
299
|
#
|
355
300
|
# * +bool+ - true or false; enable or disable colour.
|
356
301
|
#
|
357
|
-
|
302
|
+
#: (bool bool) -> void
|
358
303
|
def enable_color=(bool)
|
359
304
|
@enable_color = !!bool
|
360
305
|
end
|
@@ -363,7 +308,7 @@ module CLI
|
|
363
308
|
# By default, cursor control is enabled when STDOUT is a TTY; that is, when output
|
364
309
|
# has not been directed to another program or to a file.
|
365
310
|
#
|
366
|
-
|
311
|
+
#: -> bool
|
367
312
|
def enable_cursor?
|
368
313
|
@enable_cursor
|
369
314
|
end
|
@@ -374,7 +319,7 @@ module CLI
|
|
374
319
|
#
|
375
320
|
# * +bool+ - true or false; enable or disable cursor control.
|
376
321
|
#
|
377
|
-
|
322
|
+
#: (bool bool) -> void
|
378
323
|
def enable_cursor=(bool)
|
379
324
|
@enable_cursor = !!bool
|
380
325
|
end
|
@@ -388,13 +333,13 @@ module CLI
|
|
388
333
|
#
|
389
334
|
# * +symbol+ - the default frame style to use for frames
|
390
335
|
#
|
391
|
-
|
336
|
+
#: (frame_stylable frame_style) -> void
|
392
337
|
def frame_style=(frame_style)
|
393
338
|
Frame.frame_style = frame_style
|
394
339
|
end
|
395
340
|
|
396
341
|
# Create a terminal link
|
397
|
-
|
342
|
+
#: (String url, String text, ?format: bool, ?blue_underline: bool) -> String
|
398
343
|
def link(url, text, format: true, blue_underline: format)
|
399
344
|
raise 'cannot use blue_underline without format' if blue_underline && !format
|
400
345
|
|
@@ -404,10 +349,10 @@ module CLI
|
|
404
349
|
end
|
405
350
|
end
|
406
351
|
|
407
|
-
self.enable_color = $stdout.tty?
|
352
|
+
self.enable_color = $stdout.tty? && ENV['TERM'] != 'dumb' #: as !nil
|
408
353
|
|
409
354
|
# Shopify's CI system supports color, but not cursor control
|
410
|
-
self.enable_cursor =
|
355
|
+
self.enable_cursor = $stdout.tty? && ENV['TERM'] != 'dumb' && ENV['CI'].nil? && ENV['JOURNAL_STREAM'].nil? #: as !nil
|
411
356
|
end
|
412
357
|
end
|
413
358
|
|
metadata
CHANGED
@@ -1,16 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cli-ui
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Burke Libbey
|
8
8
|
- Julian Nadeau
|
9
9
|
- Lisa Ugray
|
10
|
-
autorequire:
|
11
10
|
bindir: exe
|
12
11
|
cert_chain: []
|
13
|
-
date:
|
12
|
+
date: 1980-01-01 00:00:00.000000000 Z
|
14
13
|
dependencies:
|
15
14
|
- !ruby/object:Gem::Dependency
|
16
15
|
name: minitest
|
@@ -64,10 +63,10 @@ files:
|
|
64
63
|
- lib/cli/ui/os.rb
|
65
64
|
- lib/cli/ui/printer.rb
|
66
65
|
- lib/cli/ui/progress.rb
|
66
|
+
- lib/cli/ui/progress_reporter.rb
|
67
67
|
- lib/cli/ui/prompt.rb
|
68
68
|
- lib/cli/ui/prompt/interactive_options.rb
|
69
69
|
- lib/cli/ui/prompt/options_handler.rb
|
70
|
-
- lib/cli/ui/sorbet_runtime_stub.rb
|
71
70
|
- lib/cli/ui/spinner.rb
|
72
71
|
- lib/cli/ui/spinner/async.rb
|
73
72
|
- lib/cli/ui/spinner/spin_group.rb
|
@@ -86,7 +85,6 @@ homepage: https://github.com/shopify/cli-ui
|
|
86
85
|
licenses:
|
87
86
|
- MIT
|
88
87
|
metadata: {}
|
89
|
-
post_install_message:
|
90
88
|
rdoc_options: []
|
91
89
|
require_paths:
|
92
90
|
- lib
|
@@ -101,8 +99,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
101
99
|
- !ruby/object:Gem::Version
|
102
100
|
version: '0'
|
103
101
|
requirements: []
|
104
|
-
rubygems_version: 3.
|
105
|
-
signing_key:
|
102
|
+
rubygems_version: 3.6.7
|
106
103
|
specification_version: 4
|
107
104
|
summary: Terminal UI framework
|
108
105
|
test_files: []
|
@@ -1,169 +0,0 @@
|
|
1
|
-
# typed: ignore
|
2
|
-
# frozen_string_literal: true
|
3
|
-
|
4
|
-
module T
|
5
|
-
class << self
|
6
|
-
def absurd(value); end
|
7
|
-
def all(type_a, type_b, *types); end
|
8
|
-
def any(type_a, type_b, *types); end
|
9
|
-
def attached_class; end
|
10
|
-
def class_of(klass); end
|
11
|
-
def enum(values); end
|
12
|
-
def nilable(type); end
|
13
|
-
def noreturn; end
|
14
|
-
def self_type; end
|
15
|
-
def type_alias(type = nil, &_blk); end
|
16
|
-
def type_parameter(name); end
|
17
|
-
def untyped; end
|
18
|
-
|
19
|
-
def assert_type!(value, _type, _checked: true)
|
20
|
-
value
|
21
|
-
end
|
22
|
-
|
23
|
-
def cast(value, _type, _checked: true)
|
24
|
-
value
|
25
|
-
end
|
26
|
-
|
27
|
-
def let(value, _type, _checked: true)
|
28
|
-
value
|
29
|
-
end
|
30
|
-
|
31
|
-
def must(arg, _msg = nil)
|
32
|
-
arg
|
33
|
-
end
|
34
|
-
|
35
|
-
def proc
|
36
|
-
T::Proc.new
|
37
|
-
end
|
38
|
-
|
39
|
-
def reveal_type(value)
|
40
|
-
value
|
41
|
-
end
|
42
|
-
|
43
|
-
def unsafe(value)
|
44
|
-
value
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
module Sig
|
49
|
-
def sig(arg0 = nil, &blk); end
|
50
|
-
end
|
51
|
-
|
52
|
-
module Helpers
|
53
|
-
def abstract!; end
|
54
|
-
def interface!; end
|
55
|
-
def final!; end
|
56
|
-
def sealed!; end
|
57
|
-
def mixes_in_class_methods(mod); end
|
58
|
-
end
|
59
|
-
|
60
|
-
module Generic
|
61
|
-
include(T::Helpers)
|
62
|
-
|
63
|
-
def type_parameters(*params); end
|
64
|
-
def type_member(variance = :invariant, fixed: nil, lower: nil, upper: BasicObject); end
|
65
|
-
def type_template(variance = :invariant, fixed: nil, lower: nil, upper: BasicObject); end
|
66
|
-
|
67
|
-
def [](*types)
|
68
|
-
self
|
69
|
-
end
|
70
|
-
end
|
71
|
-
|
72
|
-
module Array
|
73
|
-
class << self
|
74
|
-
def [](type); end
|
75
|
-
end
|
76
|
-
end
|
77
|
-
|
78
|
-
Boolean = Object.new.freeze
|
79
|
-
|
80
|
-
module Configuration
|
81
|
-
class << self
|
82
|
-
def call_validation_error_handler(signature, opts); end
|
83
|
-
def call_validation_error_handler=(value); end
|
84
|
-
def default_checked_level=(default_checked_level); end
|
85
|
-
def enable_checking_for_sigs_marked_checked_tests; end
|
86
|
-
def enable_final_checks_on_hooks; end
|
87
|
-
def enable_legacy_t_enum_migration_mode; end
|
88
|
-
def reset_final_checks_on_hooks; end
|
89
|
-
def hard_assert_handler(str, extra); end
|
90
|
-
def hard_assert_handler=(value); end
|
91
|
-
def inline_type_error_handler(error); end
|
92
|
-
def inline_type_error_handler=(value); end
|
93
|
-
def log_info_handler(str, extra); end
|
94
|
-
def log_info_handler=(value); end
|
95
|
-
def scalar_types; end
|
96
|
-
def scalar_types=(values); end
|
97
|
-
# rubocop:disable Naming/InclusiveLanguage
|
98
|
-
def sealed_violation_whitelist; end
|
99
|
-
def sealed_violation_whitelist=(sealed_violation_whitelist); end
|
100
|
-
# rubocop:enable Naming/InclusiveLanguage
|
101
|
-
def sig_builder_error_handler(error, location); end
|
102
|
-
def sig_builder_error_handler=(value); end
|
103
|
-
def sig_validation_error_handler(error, opts); end
|
104
|
-
def sig_validation_error_handler=(value); end
|
105
|
-
def soft_assert_handler(str, extra); end
|
106
|
-
def soft_assert_handler=(value); end
|
107
|
-
end
|
108
|
-
end
|
109
|
-
|
110
|
-
module Enumerable
|
111
|
-
class << self
|
112
|
-
def [](type); end
|
113
|
-
end
|
114
|
-
end
|
115
|
-
|
116
|
-
module Enumerator
|
117
|
-
class << self
|
118
|
-
def [](type); end
|
119
|
-
end
|
120
|
-
end
|
121
|
-
|
122
|
-
module Hash
|
123
|
-
class << self
|
124
|
-
def [](keys, values); end
|
125
|
-
end
|
126
|
-
end
|
127
|
-
|
128
|
-
class Proc
|
129
|
-
def bind(*_)
|
130
|
-
self
|
131
|
-
end
|
132
|
-
|
133
|
-
def params(*_param)
|
134
|
-
self
|
135
|
-
end
|
136
|
-
|
137
|
-
def void
|
138
|
-
self
|
139
|
-
end
|
140
|
-
|
141
|
-
def returns(_type)
|
142
|
-
self
|
143
|
-
end
|
144
|
-
end
|
145
|
-
|
146
|
-
module Range
|
147
|
-
class << self
|
148
|
-
def [](type); end
|
149
|
-
end
|
150
|
-
end
|
151
|
-
|
152
|
-
module Set
|
153
|
-
class << self
|
154
|
-
def [](type); end
|
155
|
-
end
|
156
|
-
end
|
157
|
-
|
158
|
-
class << self
|
159
|
-
def const_added(name)
|
160
|
-
super
|
161
|
-
raise 'When using both cli-ui and sorbet, you must require sorbet before cli-ui'
|
162
|
-
end
|
163
|
-
|
164
|
-
def method_added(name)
|
165
|
-
super
|
166
|
-
raise 'When using both cli-ui and sorbet, you must require sorbet before cli-ui'
|
167
|
-
end
|
168
|
-
end
|
169
|
-
end
|