capistrano-data_plane_api 0.1.4 → 0.2.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/.rubocop.yml +5 -2
- data/.ruby-version +1 -1
- data/CHANGELOG.md +6 -0
- data/Gemfile +7 -4
- data/Gemfile.lock +108 -69
- data/README.md +5 -0
- data/capistrano-data_plane_api.gemspec +5 -2
- data/exe/cap_data_plane_api +3 -2
- data/lib/capistrano/data_plane_api/configuration/backend.rb +2 -0
- data/lib/capistrano/data_plane_api/configuration/server.rb +4 -2
- data/lib/capistrano/data_plane_api/configuration/symbol.rb +2 -0
- data/lib/capistrano/data_plane_api/configuration.rb +3 -3
- data/lib/capistrano/data_plane_api/deploy/args.rb +71 -40
- data/lib/capistrano/data_plane_api/deploy/deployment_stats.rb +29 -25
- data/lib/capistrano/data_plane_api/deploy/group.rb +33 -24
- data/lib/capistrano/data_plane_api/deploy/helper.rb +3 -5
- data/lib/capistrano/data_plane_api/deploy/server_stats.rb +60 -43
- data/lib/capistrano/data_plane_api/deploy.rb +3 -2
- data/lib/capistrano/data_plane_api/diggable.rb +5 -2
- data/lib/capistrano/data_plane_api/equatable.rb +4 -2
- data/lib/capistrano/data_plane_api/helper.rb +31 -27
- data/lib/capistrano/data_plane_api/hooks.rb +1 -0
- data/lib/capistrano/data_plane_api/show_state.rb +15 -12
- data/lib/capistrano/data_plane_api/tasks.rb +26 -2
- data/lib/capistrano/data_plane_api/terminal_print_loop.rb +7 -4
- data/lib/capistrano/data_plane_api/type.rb +9 -5
- data/lib/capistrano/data_plane_api/version.rb +2 -2
- data/lib/capistrano/data_plane_api.rb +96 -74
- data/lib/capistrano-data_plane_api.rb +4 -0
- data/rbi/capistrano-data_plane_api.rbi +283 -0
- data/sorbet/config +6 -0
- data/sorbet/rbi/annotations/.gitattributes +1 -0
- data/sorbet/rbi/annotations/faraday.rbi +17 -0
- data/sorbet/rbi/annotations/minitest.rbi +119 -0
- data/sorbet/rbi/annotations/rainbow.rbi +269 -0
- data/sorbet/rbi/annotations/webmock.rbi +9 -0
- data/sorbet/rbi/dsl/.gitattributes +1 -0
- data/sorbet/rbi/dsl/capistrano/data_plane_api/configuration/backend.rbi +50 -0
- data/sorbet/rbi/dsl/capistrano/data_plane_api/configuration/server.rbi +24 -0
- data/sorbet/rbi/dsl/capistrano/data_plane_api/configuration.rbi +52 -0
- data/sorbet/rbi/dsl/capistrano/data_plane_api/type.rbi +12 -0
- data/sorbet/rbi/gems/.gitattributes +1 -0
- data/sorbet/rbi/gems/addressable@2.8.7.rbi +1994 -0
- data/sorbet/rbi/gems/ast@2.4.3.rbi +585 -0
- data/sorbet/rbi/gems/base64@0.2.0.rbi +509 -0
- data/sorbet/rbi/gems/bigdecimal@3.1.9.rbi +8 -0
- data/sorbet/rbi/gems/booleans@0.1.3.rbi +28 -0
- data/sorbet/rbi/gems/byebug@12.0.0.rbi +37 -0
- data/sorbet/rbi/gems/crack@1.0.0.rbi +145 -0
- data/sorbet/rbi/gems/data_plane_api@0.2.0.rbi +238 -0
- data/sorbet/rbi/gems/faraday-net_http@3.4.0.rbi +147 -0
- data/sorbet/rbi/gems/faraday@2.13.0.rbi +2974 -0
- data/sorbet/rbi/gems/hashdiff@1.1.2.rbi +353 -0
- data/sorbet/rbi/gems/json@2.10.2.rbi +2113 -0
- data/sorbet/rbi/gems/lint_roller@1.1.0.rbi +240 -0
- data/sorbet/rbi/gems/logger@1.7.0.rbi +963 -0
- data/sorbet/rbi/gems/minitest@5.25.5.rbi +1547 -0
- data/sorbet/rbi/gems/net-http@0.6.0.rbi +4247 -0
- data/sorbet/rbi/gems/parallel@1.26.3.rbi +291 -0
- data/sorbet/rbi/gems/pastel@0.8.0.rbi +733 -0
- data/sorbet/rbi/gems/public_suffix@6.0.1.rbi +936 -0
- data/sorbet/rbi/gems/racc@1.8.1.rbi +160 -0
- data/sorbet/rbi/gems/rainbow@3.1.1.rbi +404 -0
- data/sorbet/rbi/gems/rake@13.0.6.rbi +3030 -0
- data/sorbet/rbi/gems/rexml@3.4.1.rbi +5346 -0
- data/sorbet/rbi/gems/rubocop-espago@1.1.8.rbi +9 -0
- data/sorbet/rbi/gems/ruby-progressbar@1.13.0.rbi +1318 -0
- data/sorbet/rbi/gems/shale-builder@0.2.4.rbi +9 -0
- data/sorbet/rbi/gems/shale@1.2.2.rbi +2323 -0
- data/sorbet/rbi/gems/shoulda-context@2.0.0.rbi +563 -0
- data/sorbet/rbi/gems/strings-ansi@0.2.0.rbi +178 -0
- data/sorbet/rbi/gems/strings@0.2.1.rbi +830 -0
- data/sorbet/rbi/gems/thor@1.2.1.rbi +3957 -0
- data/sorbet/rbi/gems/tty-box@0.7.0.rbi +593 -0
- data/sorbet/rbi/gems/tty-color@0.6.0.rbi +241 -0
- data/sorbet/rbi/gems/tty-cursor@0.7.1.rbi +443 -0
- data/sorbet/rbi/gems/unicode-display_width@2.6.0.rbi +66 -0
- data/sorbet/rbi/gems/unicode_utils@1.4.0.rbi +184 -0
- data/sorbet/rbi/gems/uri@1.0.3.rbi +2349 -0
- data/sorbet/rbi/gems/vcr@6.3.1.rbi +3040 -0
- data/sorbet/rbi/gems/webmock@3.25.1.rbi +1792 -0
- data/sorbet/rbi/shims/gems/faraday.rbi +21 -0
- data/sorbet/rbi/shims/gems/shoulda-context@2.0.0.rbi +15 -0
- data/sorbet/rbi/todo.rbi +7 -0
- data/sorbet/tapioca/config.yml +28 -0
- data/sorbet/tapioca/extensions/load_gem.rb +1 -0
- data/sorbet/tapioca/require.rb +4 -0
- data/templates/bin/deploy.rb +1 -0
- metadata +106 -8
@@ -0,0 +1,830 @@
|
|
1
|
+
# typed: true
|
2
|
+
|
3
|
+
# DO NOT EDIT MANUALLY
|
4
|
+
# This is an autogenerated file for types exported from the `strings` gem.
|
5
|
+
# Please instead update this file by running `bin/tapioca gem strings`.
|
6
|
+
|
7
|
+
|
8
|
+
# source://strings//lib/strings/align.rb#6
|
9
|
+
module Strings
|
10
|
+
private
|
11
|
+
|
12
|
+
# Align text within the width.
|
13
|
+
#
|
14
|
+
# @api public
|
15
|
+
# @see Strings::Align#align
|
16
|
+
#
|
17
|
+
# source://strings//lib/strings.rb#18
|
18
|
+
def align(*args, **kws); end
|
19
|
+
|
20
|
+
# Align text with the width.
|
21
|
+
#
|
22
|
+
# @api public
|
23
|
+
# @see Strings::Align#align
|
24
|
+
#
|
25
|
+
# source://strings//lib/strings.rb#38
|
26
|
+
def align_center(*args); end
|
27
|
+
|
28
|
+
# Align text left within the width.
|
29
|
+
#
|
30
|
+
# @api public
|
31
|
+
# @see Strings::Align#align_left
|
32
|
+
#
|
33
|
+
# source://strings//lib/strings.rb#28
|
34
|
+
def align_left(*args); end
|
35
|
+
|
36
|
+
# Align text with the width.
|
37
|
+
#
|
38
|
+
# @api public
|
39
|
+
# @see Strings::Align#align
|
40
|
+
#
|
41
|
+
# source://strings//lib/strings.rb#48
|
42
|
+
def align_right(*args); end
|
43
|
+
|
44
|
+
# Check if string contains ANSI codes
|
45
|
+
#
|
46
|
+
# @api public
|
47
|
+
# @return [Boolean]
|
48
|
+
# @see Strings::ANSI#ansi?
|
49
|
+
#
|
50
|
+
# source://strings//lib/strings.rb#58
|
51
|
+
def ansi?(string); end
|
52
|
+
|
53
|
+
# Remove any line break characters from the text
|
54
|
+
#
|
55
|
+
# @api public
|
56
|
+
# @see Strings::Fold#fold
|
57
|
+
#
|
58
|
+
# source://strings//lib/strings.rb#68
|
59
|
+
def fold(*args); end
|
60
|
+
|
61
|
+
# Apply padding to multiline text with ANSI codes
|
62
|
+
#
|
63
|
+
# @api public
|
64
|
+
# @see Strings::Pad#pad
|
65
|
+
#
|
66
|
+
# source://strings//lib/strings.rb#78
|
67
|
+
def pad(*args); end
|
68
|
+
|
69
|
+
# Remove ANSI codes from the string
|
70
|
+
#
|
71
|
+
# @api public
|
72
|
+
# @see Strings::ANSI#sanitize
|
73
|
+
#
|
74
|
+
# source://strings//lib/strings.rb#88
|
75
|
+
def sanitize(string); end
|
76
|
+
|
77
|
+
# Truncate a text at a given length
|
78
|
+
#
|
79
|
+
# @api public
|
80
|
+
# @see Strings::Truncate#truncate
|
81
|
+
#
|
82
|
+
# source://strings//lib/strings.rb#98
|
83
|
+
def truncate(*args); end
|
84
|
+
|
85
|
+
# Wrap a text into lines at wrap length
|
86
|
+
#
|
87
|
+
# @api public
|
88
|
+
# @see Strings::Wrap#wrap
|
89
|
+
#
|
90
|
+
# source://strings//lib/strings.rb#108
|
91
|
+
def wrap(*args); end
|
92
|
+
|
93
|
+
class << self
|
94
|
+
# Align text within the width.
|
95
|
+
#
|
96
|
+
# @api public
|
97
|
+
# @see Strings::Align#align
|
98
|
+
#
|
99
|
+
# source://strings//lib/strings.rb#18
|
100
|
+
def align(*args, **kws); end
|
101
|
+
|
102
|
+
# Align text with the width.
|
103
|
+
#
|
104
|
+
# @api public
|
105
|
+
# @see Strings::Align#align
|
106
|
+
#
|
107
|
+
# source://strings//lib/strings.rb#38
|
108
|
+
def align_center(*args); end
|
109
|
+
|
110
|
+
# Align text left within the width.
|
111
|
+
#
|
112
|
+
# @api public
|
113
|
+
# @see Strings::Align#align_left
|
114
|
+
#
|
115
|
+
# source://strings//lib/strings.rb#28
|
116
|
+
def align_left(*args); end
|
117
|
+
|
118
|
+
# Align text with the width.
|
119
|
+
#
|
120
|
+
# @api public
|
121
|
+
# @see Strings::Align#align
|
122
|
+
#
|
123
|
+
# source://strings//lib/strings.rb#48
|
124
|
+
def align_right(*args); end
|
125
|
+
|
126
|
+
# Check if string contains ANSI codes
|
127
|
+
#
|
128
|
+
# @api public
|
129
|
+
# @return [Boolean]
|
130
|
+
# @see Strings::ANSI#ansi?
|
131
|
+
#
|
132
|
+
# source://strings//lib/strings.rb#58
|
133
|
+
def ansi?(string); end
|
134
|
+
|
135
|
+
# Remove any line break characters from the text
|
136
|
+
#
|
137
|
+
# @api public
|
138
|
+
# @see Strings::Fold#fold
|
139
|
+
#
|
140
|
+
# source://strings//lib/strings.rb#68
|
141
|
+
def fold(*args); end
|
142
|
+
|
143
|
+
# Apply padding to multiline text with ANSI codes
|
144
|
+
#
|
145
|
+
# @api public
|
146
|
+
# @see Strings::Pad#pad
|
147
|
+
#
|
148
|
+
# source://strings//lib/strings.rb#78
|
149
|
+
def pad(*args); end
|
150
|
+
|
151
|
+
# Remove ANSI codes from the string
|
152
|
+
#
|
153
|
+
# @api public
|
154
|
+
# @see Strings::ANSI#sanitize
|
155
|
+
#
|
156
|
+
# source://strings//lib/strings.rb#88
|
157
|
+
def sanitize(string); end
|
158
|
+
|
159
|
+
# Truncate a text at a given length
|
160
|
+
#
|
161
|
+
# @api public
|
162
|
+
# @see Strings::Truncate#truncate
|
163
|
+
#
|
164
|
+
# source://strings//lib/strings.rb#98
|
165
|
+
def truncate(*args); end
|
166
|
+
|
167
|
+
# Wrap a text into lines at wrap length
|
168
|
+
#
|
169
|
+
# @api public
|
170
|
+
# @see Strings::Wrap#wrap
|
171
|
+
#
|
172
|
+
# source://strings//lib/strings.rb#108
|
173
|
+
def wrap(*args); end
|
174
|
+
end
|
175
|
+
end
|
176
|
+
|
177
|
+
# Responsible for text alignment
|
178
|
+
#
|
179
|
+
# source://strings//lib/strings/align.rb#8
|
180
|
+
module Strings::Align
|
181
|
+
private
|
182
|
+
|
183
|
+
# Aligns text within the width.
|
184
|
+
#
|
185
|
+
# If the text is greater than the width then unmodified
|
186
|
+
# string is returned.
|
187
|
+
#
|
188
|
+
# @api public
|
189
|
+
# @example
|
190
|
+
# text = "the madness of men"
|
191
|
+
#
|
192
|
+
# Strings::Align.align(text, 22, direction: :left)
|
193
|
+
# # => "the madness of men "
|
194
|
+
#
|
195
|
+
# Strings::Align.align(text, 22, direction: :center)
|
196
|
+
# # => " the madness of men "
|
197
|
+
#
|
198
|
+
# Strings::Align(text, 22, direction: :right)
|
199
|
+
# # => " the madness of men"
|
200
|
+
#
|
201
|
+
# Strings::Align.align(text, 22, direction: :center, fill: "*")
|
202
|
+
# # => "***the madness of men***"
|
203
|
+
# @param text [String] the text to align lines of
|
204
|
+
# @param width [Integer] the maximum width to align to
|
205
|
+
#
|
206
|
+
# source://strings//lib/strings/align.rb#39
|
207
|
+
def align(text, width, direction: T.unsafe(nil), **options); end
|
208
|
+
|
209
|
+
# Centers text within the width
|
210
|
+
#
|
211
|
+
# @api public
|
212
|
+
# @return [String]
|
213
|
+
#
|
214
|
+
# source://strings//lib/strings/align.rb#86
|
215
|
+
def align_center(text, width, fill: T.unsafe(nil), separator: T.unsafe(nil)); end
|
216
|
+
|
217
|
+
# Aligns text to the left at given length
|
218
|
+
#
|
219
|
+
# @api public
|
220
|
+
# @return [String]
|
221
|
+
#
|
222
|
+
# source://strings//lib/strings/align.rb#66
|
223
|
+
def align_left(text, width, fill: T.unsafe(nil), separator: T.unsafe(nil)); end
|
224
|
+
|
225
|
+
# Aligns text to the right at given length
|
226
|
+
#
|
227
|
+
# @api public
|
228
|
+
# @return [String]
|
229
|
+
#
|
230
|
+
# source://strings//lib/strings/align.rb#108
|
231
|
+
def align_right(text, width, fill: T.unsafe(nil), separator: T.unsafe(nil)); end
|
232
|
+
|
233
|
+
# Visible width of a string
|
234
|
+
#
|
235
|
+
# @api private
|
236
|
+
#
|
237
|
+
# source://strings//lib/strings/align.rb#142
|
238
|
+
def display_width(string); end
|
239
|
+
|
240
|
+
# Enumerate text line by line
|
241
|
+
#
|
242
|
+
# @api private
|
243
|
+
# @param text [String]
|
244
|
+
# @return [String]
|
245
|
+
#
|
246
|
+
# source://strings//lib/strings/align.rb#130
|
247
|
+
def each_line(text, separator); end
|
248
|
+
|
249
|
+
# Convert direction to method name
|
250
|
+
#
|
251
|
+
# @api private
|
252
|
+
#
|
253
|
+
# source://strings//lib/strings/align.rb#50
|
254
|
+
def to_alignment(direction); end
|
255
|
+
|
256
|
+
class << self
|
257
|
+
# Aligns text within the width.
|
258
|
+
#
|
259
|
+
# If the text is greater than the width then unmodified
|
260
|
+
# string is returned.
|
261
|
+
#
|
262
|
+
# @api public
|
263
|
+
# @example
|
264
|
+
# text = "the madness of men"
|
265
|
+
#
|
266
|
+
# Strings::Align.align(text, 22, direction: :left)
|
267
|
+
# # => "the madness of men "
|
268
|
+
#
|
269
|
+
# Strings::Align.align(text, 22, direction: :center)
|
270
|
+
# # => " the madness of men "
|
271
|
+
#
|
272
|
+
# Strings::Align(text, 22, direction: :right)
|
273
|
+
# # => " the madness of men"
|
274
|
+
#
|
275
|
+
# Strings::Align.align(text, 22, direction: :center, fill: "*")
|
276
|
+
# # => "***the madness of men***"
|
277
|
+
# @param text [String] the text to align lines of
|
278
|
+
# @param width [Integer] the maximum width to align to
|
279
|
+
#
|
280
|
+
# source://strings//lib/strings/align.rb#39
|
281
|
+
def align(text, width, direction: T.unsafe(nil), **options); end
|
282
|
+
|
283
|
+
# Centers text within the width
|
284
|
+
#
|
285
|
+
# @api public
|
286
|
+
# @return [String]
|
287
|
+
#
|
288
|
+
# source://strings//lib/strings/align.rb#86
|
289
|
+
def align_center(text, width, fill: T.unsafe(nil), separator: T.unsafe(nil)); end
|
290
|
+
|
291
|
+
# Aligns text to the left at given length
|
292
|
+
#
|
293
|
+
# @api public
|
294
|
+
# @return [String]
|
295
|
+
#
|
296
|
+
# source://strings//lib/strings/align.rb#66
|
297
|
+
def align_left(text, width, fill: T.unsafe(nil), separator: T.unsafe(nil)); end
|
298
|
+
|
299
|
+
# Aligns text to the right at given length
|
300
|
+
#
|
301
|
+
# @api public
|
302
|
+
# @return [String]
|
303
|
+
#
|
304
|
+
# source://strings//lib/strings/align.rb#108
|
305
|
+
def align_right(text, width, fill: T.unsafe(nil), separator: T.unsafe(nil)); end
|
306
|
+
|
307
|
+
# Visible width of a string
|
308
|
+
#
|
309
|
+
# @api private
|
310
|
+
#
|
311
|
+
# source://strings//lib/strings/align.rb#142
|
312
|
+
def display_width(string); end
|
313
|
+
|
314
|
+
# Enumerate text line by line
|
315
|
+
#
|
316
|
+
# @api private
|
317
|
+
# @param text [String]
|
318
|
+
# @return [String]
|
319
|
+
#
|
320
|
+
# source://strings//lib/strings/align.rb#130
|
321
|
+
def each_line(text, separator); end
|
322
|
+
|
323
|
+
# Convert direction to method name
|
324
|
+
#
|
325
|
+
# @api private
|
326
|
+
#
|
327
|
+
# source://strings//lib/strings/align.rb#50
|
328
|
+
def to_alignment(direction); end
|
329
|
+
end
|
330
|
+
end
|
331
|
+
|
332
|
+
# source://strings//lib/strings/align.rb#11
|
333
|
+
Strings::Align::LINE_BREAK = T.let(T.unsafe(nil), Regexp)
|
334
|
+
|
335
|
+
# source://strings//lib/strings/align.rb#9
|
336
|
+
Strings::Align::NEWLINE = T.let(T.unsafe(nil), String)
|
337
|
+
|
338
|
+
# source://strings//lib/strings/align.rb#10
|
339
|
+
Strings::Align::SPACE = T.let(T.unsafe(nil), String)
|
340
|
+
|
341
|
+
# source://strings//lib/strings/fold.rb#4
|
342
|
+
module Strings::Fold
|
343
|
+
private
|
344
|
+
|
345
|
+
# Fold a multiline text into a single line string
|
346
|
+
#
|
347
|
+
# @api public
|
348
|
+
# @example
|
349
|
+
# fold("\tfoo \r\n\n bar") # => " foo bar"
|
350
|
+
# @param text [String]
|
351
|
+
# @param separator [String] the separators to be removed from the text, default: (\r\n+|\r+|\n+|\t+)
|
352
|
+
# @return [String]
|
353
|
+
#
|
354
|
+
# source://strings//lib/strings/fold.rb#20
|
355
|
+
def fold(text, separator = T.unsafe(nil)); end
|
356
|
+
|
357
|
+
class << self
|
358
|
+
# Fold a multiline text into a single line string
|
359
|
+
#
|
360
|
+
# @api public
|
361
|
+
# @example
|
362
|
+
# fold("\tfoo \r\n\n bar") # => " foo bar"
|
363
|
+
# @param text [String]
|
364
|
+
# @param separator [String] the separators to be removed from the text, default: (\r\n+|\r+|\n+|\t+)
|
365
|
+
# @return [String]
|
366
|
+
#
|
367
|
+
# source://strings//lib/strings/fold.rb#20
|
368
|
+
def fold(text, separator = T.unsafe(nil)); end
|
369
|
+
end
|
370
|
+
end
|
371
|
+
|
372
|
+
# source://strings//lib/strings/fold.rb#5
|
373
|
+
Strings::Fold::LINE_BREAK = T.let(T.unsafe(nil), String)
|
374
|
+
|
375
|
+
# Responsible for text padding
|
376
|
+
#
|
377
|
+
# source://strings//lib/strings/pad.rb#10
|
378
|
+
module Strings::Pad
|
379
|
+
private
|
380
|
+
|
381
|
+
# Calculate visible string width
|
382
|
+
#
|
383
|
+
# @api private
|
384
|
+
# @return [Integer]
|
385
|
+
#
|
386
|
+
# source://strings//lib/strings/pad.rb#91
|
387
|
+
def display_width(string); end
|
388
|
+
|
389
|
+
# Determine maximum length for all multiline content
|
390
|
+
#
|
391
|
+
# @api private
|
392
|
+
# @param text [String]
|
393
|
+
# @param separator [String]
|
394
|
+
# @return [Integer]
|
395
|
+
#
|
396
|
+
# source://strings//lib/strings/pad.rb#80
|
397
|
+
def max_line_length(text, separator); end
|
398
|
+
|
399
|
+
# Apply padding to multiline text with ANSI codes
|
400
|
+
#
|
401
|
+
# @api private
|
402
|
+
# @example
|
403
|
+
# text = "Ignorance is the parent of fear."
|
404
|
+
#
|
405
|
+
# Strings::Pad.pad(text, [1, 2], fill: "*")
|
406
|
+
# # =>
|
407
|
+
# # "************************************\n"
|
408
|
+
# # "**Ignorance is the parent of fear.**\n"
|
409
|
+
# # "************************************\n"
|
410
|
+
# @param text [String] the text to pad out
|
411
|
+
# @param padding [Integer, Array[Integer]] the padding to apply to text
|
412
|
+
# @return [String]
|
413
|
+
#
|
414
|
+
# source://strings//lib/strings/pad.rb#34
|
415
|
+
def pad(text, padding, fill: T.unsafe(nil), separator: T.unsafe(nil)); end
|
416
|
+
|
417
|
+
# Apply padding to left and right side of string
|
418
|
+
#
|
419
|
+
# @api private
|
420
|
+
# @param text [String]
|
421
|
+
# @return [String]
|
422
|
+
#
|
423
|
+
# source://strings//lib/strings/pad.rb#67
|
424
|
+
def pad_around(text, padding, fill: T.unsafe(nil)); end
|
425
|
+
|
426
|
+
class << self
|
427
|
+
# Calculate visible string width
|
428
|
+
#
|
429
|
+
# @api private
|
430
|
+
# @return [Integer]
|
431
|
+
#
|
432
|
+
# source://strings//lib/strings/pad.rb#91
|
433
|
+
def display_width(string); end
|
434
|
+
|
435
|
+
# Determine maximum length for all multiline content
|
436
|
+
#
|
437
|
+
# @api private
|
438
|
+
# @param text [String]
|
439
|
+
# @param separator [String]
|
440
|
+
# @return [Integer]
|
441
|
+
#
|
442
|
+
# source://strings//lib/strings/pad.rb#80
|
443
|
+
def max_line_length(text, separator); end
|
444
|
+
|
445
|
+
# Apply padding to multiline text with ANSI codes
|
446
|
+
#
|
447
|
+
# @api private
|
448
|
+
# @example
|
449
|
+
# text = "Ignorance is the parent of fear."
|
450
|
+
#
|
451
|
+
# Strings::Pad.pad(text, [1, 2], fill: "*")
|
452
|
+
# # =>
|
453
|
+
# # "************************************\n"
|
454
|
+
# # "**Ignorance is the parent of fear.**\n"
|
455
|
+
# # "************************************\n"
|
456
|
+
# @param text [String] the text to pad out
|
457
|
+
# @param padding [Integer, Array[Integer]] the padding to apply to text
|
458
|
+
# @return [String]
|
459
|
+
#
|
460
|
+
# source://strings//lib/strings/pad.rb#34
|
461
|
+
def pad(text, padding, fill: T.unsafe(nil), separator: T.unsafe(nil)); end
|
462
|
+
|
463
|
+
# Apply padding to left and right side of string
|
464
|
+
#
|
465
|
+
# @api private
|
466
|
+
# @param text [String]
|
467
|
+
# @return [String]
|
468
|
+
#
|
469
|
+
# source://strings//lib/strings/pad.rb#67
|
470
|
+
def pad_around(text, padding, fill: T.unsafe(nil)); end
|
471
|
+
end
|
472
|
+
end
|
473
|
+
|
474
|
+
# source://strings//lib/strings/pad.rb#13
|
475
|
+
Strings::Pad::LINE_BREAK = T.let(T.unsafe(nil), Regexp)
|
476
|
+
|
477
|
+
# source://strings//lib/strings/pad.rb#11
|
478
|
+
Strings::Pad::NEWLINE = T.let(T.unsafe(nil), String)
|
479
|
+
|
480
|
+
# source://strings//lib/strings/pad.rb#12
|
481
|
+
Strings::Pad::SPACE = T.let(T.unsafe(nil), String)
|
482
|
+
|
483
|
+
# A class responsible for parsing padding value
|
484
|
+
#
|
485
|
+
# Used internally by {Strings::Pad}
|
486
|
+
#
|
487
|
+
# @api private
|
488
|
+
#
|
489
|
+
# source://strings//lib/strings/padder.rb#9
|
490
|
+
class Strings::Padder
|
491
|
+
# Initialize a Padder
|
492
|
+
#
|
493
|
+
# @api public
|
494
|
+
# @return [Padder] a new instance of Padder
|
495
|
+
#
|
496
|
+
# source://strings//lib/strings/padder.rb#60
|
497
|
+
def initialize(padding); end
|
498
|
+
|
499
|
+
# Bottom padding
|
500
|
+
#
|
501
|
+
# @api public
|
502
|
+
# @return [Integer]
|
503
|
+
#
|
504
|
+
# source://strings//lib/strings/padder.rb#107
|
505
|
+
def bottom; end
|
506
|
+
|
507
|
+
# Set bottom padding
|
508
|
+
#
|
509
|
+
# @api public
|
510
|
+
# @param value [Integer]
|
511
|
+
# @return [nil]
|
512
|
+
#
|
513
|
+
# source://strings//lib/strings/padder.rb#118
|
514
|
+
def bottom=(value); end
|
515
|
+
|
516
|
+
# Check if padding is set
|
517
|
+
#
|
518
|
+
# @api public
|
519
|
+
# @return [Boolean]
|
520
|
+
#
|
521
|
+
# source://strings//lib/strings/padder.rb#147
|
522
|
+
def empty?; end
|
523
|
+
|
524
|
+
# Left padding
|
525
|
+
#
|
526
|
+
# @api public
|
527
|
+
# @return [Integer]
|
528
|
+
#
|
529
|
+
# source://strings//lib/strings/padder.rb#127
|
530
|
+
def left; end
|
531
|
+
|
532
|
+
# Set left padding
|
533
|
+
#
|
534
|
+
# @api public
|
535
|
+
# @param value [Integer]
|
536
|
+
# @return [nil]
|
537
|
+
#
|
538
|
+
# source://strings//lib/strings/padder.rb#138
|
539
|
+
def left=(value); end
|
540
|
+
|
541
|
+
# Padding
|
542
|
+
#
|
543
|
+
# @api private
|
544
|
+
# @return [Array[Integer]]
|
545
|
+
#
|
546
|
+
# source://strings//lib/strings/padder.rb#55
|
547
|
+
def padding; end
|
548
|
+
|
549
|
+
# Right padding
|
550
|
+
#
|
551
|
+
# @api public
|
552
|
+
# @return [Integer]
|
553
|
+
#
|
554
|
+
# source://strings//lib/strings/padder.rb#89
|
555
|
+
def right; end
|
556
|
+
|
557
|
+
# Set right padding
|
558
|
+
#
|
559
|
+
# @api public
|
560
|
+
# @param value [Integer]
|
561
|
+
#
|
562
|
+
# source://strings//lib/strings/padder.rb#98
|
563
|
+
def right=(value); end
|
564
|
+
|
565
|
+
# String represenation of this padder with padding values
|
566
|
+
#
|
567
|
+
# @api public
|
568
|
+
# @return [String]
|
569
|
+
#
|
570
|
+
# source://strings//lib/strings/padder.rb#156
|
571
|
+
def to_s; end
|
572
|
+
|
573
|
+
# Top padding
|
574
|
+
#
|
575
|
+
# @api public
|
576
|
+
# @return [Integer]
|
577
|
+
#
|
578
|
+
# source://strings//lib/strings/padder.rb#69
|
579
|
+
def top; end
|
580
|
+
|
581
|
+
# Set top padding
|
582
|
+
#
|
583
|
+
# @api public
|
584
|
+
# @param value [Integer]
|
585
|
+
# @return [nil]
|
586
|
+
#
|
587
|
+
# source://strings//lib/strings/padder.rb#80
|
588
|
+
def top=(value); end
|
589
|
+
|
590
|
+
class << self
|
591
|
+
# Convert value to 4 element array
|
592
|
+
#
|
593
|
+
# @api private
|
594
|
+
# @return [Array[Integer]] the 4 element padding array
|
595
|
+
#
|
596
|
+
# source://strings//lib/strings/padder.rb#38
|
597
|
+
def convert_to_ary(value); end
|
598
|
+
|
599
|
+
# Parse padding options
|
600
|
+
#
|
601
|
+
# Turn possible values into 4 element array
|
602
|
+
#
|
603
|
+
# @api public
|
604
|
+
# @example
|
605
|
+
# padder = TTY::Table::Padder.parse(5)
|
606
|
+
# padder.padding # => [5, 5, 5, 5]
|
607
|
+
# @param value [Object]
|
608
|
+
# @return [TTY::Padder] the new padder with padding values
|
609
|
+
#
|
610
|
+
# source://strings//lib/strings/padder.rb#26
|
611
|
+
def parse(value = T.unsafe(nil)); end
|
612
|
+
end
|
613
|
+
end
|
614
|
+
|
615
|
+
# @api private
|
616
|
+
#
|
617
|
+
# source://strings//lib/strings/padder.rb#10
|
618
|
+
class Strings::Padder::ParseError < ::ArgumentError; end
|
619
|
+
|
620
|
+
# A module responsible for text truncation
|
621
|
+
#
|
622
|
+
# source://strings//lib/strings/truncate.rb#9
|
623
|
+
module Strings::Truncate
|
624
|
+
private
|
625
|
+
|
626
|
+
# Visible width of a string
|
627
|
+
#
|
628
|
+
# @api private
|
629
|
+
#
|
630
|
+
# source://strings//lib/strings/truncate.rb#102
|
631
|
+
def display_width(string); end
|
632
|
+
|
633
|
+
# Perform actual shortening of the text
|
634
|
+
#
|
635
|
+
# @api private
|
636
|
+
# @return [String]
|
637
|
+
#
|
638
|
+
# source://strings//lib/strings/truncate.rb#71
|
639
|
+
def shorten(original_chars, chars, length_without_trailing); end
|
640
|
+
|
641
|
+
# @api private
|
642
|
+
#
|
643
|
+
# source://strings//lib/strings/truncate.rb#94
|
644
|
+
def to_chars(text); end
|
645
|
+
|
646
|
+
# Truncate a text at a given length (defualts to 30)
|
647
|
+
#
|
648
|
+
# @api public
|
649
|
+
# @example
|
650
|
+
# text = "The sovereignest thing on earth is parmacetti for an inward bruise."
|
651
|
+
#
|
652
|
+
# Strings::Truncate.truncate(text)
|
653
|
+
# # => "The sovereignest thing on ea…"
|
654
|
+
#
|
655
|
+
# Strings::Truncate.truncate(text, 20)
|
656
|
+
# # => "The sovereignest t…"
|
657
|
+
#
|
658
|
+
# Strings::Truncate.truncate(text, 20, separator: " " )
|
659
|
+
# # => "The sovereignest…"
|
660
|
+
#
|
661
|
+
# Strings::Truncate.truncate(text, 40, trailing: "... (see more)" )
|
662
|
+
# # => "The sovereignest thing on... (see more)"
|
663
|
+
# @param text [String] the text to be truncated
|
664
|
+
# @param truncate_at [Integer] the width at which to truncate the text
|
665
|
+
# @param options [Hash] @option options [Symbol] :separator the character for splitting words
|
666
|
+
# @option options [Symbol] :trailing the character for ending sentence
|
667
|
+
#
|
668
|
+
# source://strings//lib/strings/truncate.rb#42
|
669
|
+
def truncate(text, truncate_at = T.unsafe(nil), options = T.unsafe(nil)); end
|
670
|
+
|
671
|
+
class << self
|
672
|
+
# Visible width of a string
|
673
|
+
#
|
674
|
+
# @api private
|
675
|
+
#
|
676
|
+
# source://strings//lib/strings/truncate.rb#102
|
677
|
+
def display_width(string); end
|
678
|
+
|
679
|
+
# Perform actual shortening of the text
|
680
|
+
#
|
681
|
+
# @api private
|
682
|
+
# @return [String]
|
683
|
+
#
|
684
|
+
# source://strings//lib/strings/truncate.rb#71
|
685
|
+
def shorten(original_chars, chars, length_without_trailing); end
|
686
|
+
|
687
|
+
# @api private
|
688
|
+
#
|
689
|
+
# source://strings//lib/strings/truncate.rb#94
|
690
|
+
def to_chars(text); end
|
691
|
+
|
692
|
+
# Truncate a text at a given length (defualts to 30)
|
693
|
+
#
|
694
|
+
# @api public
|
695
|
+
# @example
|
696
|
+
# text = "The sovereignest thing on earth is parmacetti for an inward bruise."
|
697
|
+
#
|
698
|
+
# Strings::Truncate.truncate(text)
|
699
|
+
# # => "The sovereignest thing on ea…"
|
700
|
+
#
|
701
|
+
# Strings::Truncate.truncate(text, 20)
|
702
|
+
# # => "The sovereignest t…"
|
703
|
+
#
|
704
|
+
# Strings::Truncate.truncate(text, 20, separator: " " )
|
705
|
+
# # => "The sovereignest…"
|
706
|
+
#
|
707
|
+
# Strings::Truncate.truncate(text, 40, trailing: "... (see more)" )
|
708
|
+
# # => "The sovereignest thing on... (see more)"
|
709
|
+
# @param text [String] the text to be truncated
|
710
|
+
# @param truncate_at [Integer] the width at which to truncate the text
|
711
|
+
# @param options [Hash] @option options [Symbol] :separator the character for splitting words
|
712
|
+
# @option options [Symbol] :trailing the character for ending sentence
|
713
|
+
#
|
714
|
+
# source://strings//lib/strings/truncate.rb#42
|
715
|
+
def truncate(text, truncate_at = T.unsafe(nil), options = T.unsafe(nil)); end
|
716
|
+
end
|
717
|
+
end
|
718
|
+
|
719
|
+
# source://strings//lib/strings/truncate.rb#12
|
720
|
+
Strings::Truncate::DEFAULT_LENGTH = T.let(T.unsafe(nil), Integer)
|
721
|
+
|
722
|
+
# source://strings//lib/strings/truncate.rb#10
|
723
|
+
Strings::Truncate::DEFAULT_TRAILING = T.let(T.unsafe(nil), String)
|
724
|
+
|
725
|
+
# source://strings//lib/strings/version.rb#4
|
726
|
+
Strings::VERSION = T.let(T.unsafe(nil), String)
|
727
|
+
|
728
|
+
# source://strings//lib/strings/wrap.rb#8
|
729
|
+
module Strings::Wrap
|
730
|
+
private
|
731
|
+
|
732
|
+
# Visible width of a string
|
733
|
+
#
|
734
|
+
# @api private
|
735
|
+
#
|
736
|
+
# source://strings//lib/strings/wrap.rb#170
|
737
|
+
def display_width(string); end
|
738
|
+
|
739
|
+
# Format line to be maximum of wrap_at length
|
740
|
+
#
|
741
|
+
# @api private
|
742
|
+
# @param text_line [String] the line to format
|
743
|
+
# @param wrap_at [Integer] the maximum length to wrap the line
|
744
|
+
# @return [Array[String]] the wrapped lines
|
745
|
+
#
|
746
|
+
# source://strings//lib/strings/wrap.rb#46
|
747
|
+
def format_line(text_line, wrap_at, ansi_stack); end
|
748
|
+
|
749
|
+
# Insert ANSI code into string
|
750
|
+
#
|
751
|
+
# Check if there are any ANSI states, if present
|
752
|
+
# insert ANSI codes at given positions unwinding the stack.
|
753
|
+
#
|
754
|
+
# @api private
|
755
|
+
# @param string [String] the string to insert ANSI codes into
|
756
|
+
# @param ansi_stack [Array[Array[String, Integer]]] the ANSI codes to apply
|
757
|
+
# @return [String]
|
758
|
+
#
|
759
|
+
# source://strings//lib/strings/wrap.rb#131
|
760
|
+
def insert_ansi(string, ansi_stack = T.unsafe(nil)); end
|
761
|
+
|
762
|
+
# Wrap a text into lines no longer than wrap_at length.
|
763
|
+
# Preserves existing lines and existing word boundaries.
|
764
|
+
#
|
765
|
+
# @api public
|
766
|
+
# @example
|
767
|
+
# Strings::Wrap.wrap("Some longish text", 8)
|
768
|
+
# # => "Some \nlongish \ntext"
|
769
|
+
#
|
770
|
+
# source://strings//lib/strings/wrap.rb#23
|
771
|
+
def wrap(text, wrap_at = T.unsafe(nil), separator: T.unsafe(nil)); end
|
772
|
+
|
773
|
+
class << self
|
774
|
+
# Visible width of a string
|
775
|
+
#
|
776
|
+
# @api private
|
777
|
+
#
|
778
|
+
# source://strings//lib/strings/wrap.rb#170
|
779
|
+
def display_width(string); end
|
780
|
+
|
781
|
+
# Format line to be maximum of wrap_at length
|
782
|
+
#
|
783
|
+
# @api private
|
784
|
+
# @param text_line [String] the line to format
|
785
|
+
# @param wrap_at [Integer] the maximum length to wrap the line
|
786
|
+
# @return [Array[String]] the wrapped lines
|
787
|
+
#
|
788
|
+
# source://strings//lib/strings/wrap.rb#46
|
789
|
+
def format_line(text_line, wrap_at, ansi_stack); end
|
790
|
+
|
791
|
+
# Insert ANSI code into string
|
792
|
+
#
|
793
|
+
# Check if there are any ANSI states, if present
|
794
|
+
# insert ANSI codes at given positions unwinding the stack.
|
795
|
+
#
|
796
|
+
# @api private
|
797
|
+
# @param string [String] the string to insert ANSI codes into
|
798
|
+
# @param ansi_stack [Array[Array[String, Integer]]] the ANSI codes to apply
|
799
|
+
# @return [String]
|
800
|
+
#
|
801
|
+
# source://strings//lib/strings/wrap.rb#131
|
802
|
+
def insert_ansi(string, ansi_stack = T.unsafe(nil)); end
|
803
|
+
|
804
|
+
# Wrap a text into lines no longer than wrap_at length.
|
805
|
+
# Preserves existing lines and existing word boundaries.
|
806
|
+
#
|
807
|
+
# @api public
|
808
|
+
# @example
|
809
|
+
# Strings::Wrap.wrap("Some longish text", 8)
|
810
|
+
# # => "Some \nlongish \ntext"
|
811
|
+
#
|
812
|
+
# source://strings//lib/strings/wrap.rb#23
|
813
|
+
def wrap(text, wrap_at = T.unsafe(nil), separator: T.unsafe(nil)); end
|
814
|
+
end
|
815
|
+
end
|
816
|
+
|
817
|
+
# source://strings//lib/strings/wrap.rb#9
|
818
|
+
Strings::Wrap::DEFAULT_WIDTH = T.let(T.unsafe(nil), Integer)
|
819
|
+
|
820
|
+
# source://strings//lib/strings/wrap.rb#12
|
821
|
+
Strings::Wrap::LINE_BREAK = T.let(T.unsafe(nil), Regexp)
|
822
|
+
|
823
|
+
# source://strings//lib/strings/wrap.rb#13
|
824
|
+
Strings::Wrap::LINE_BREAKS = T.let(T.unsafe(nil), String)
|
825
|
+
|
826
|
+
# source://strings//lib/strings/wrap.rb#10
|
827
|
+
Strings::Wrap::NEWLINE = T.let(T.unsafe(nil), String)
|
828
|
+
|
829
|
+
# source://strings//lib/strings/wrap.rb#11
|
830
|
+
Strings::Wrap::SPACE = T.let(T.unsafe(nil), String)
|