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,733 @@
|
|
1
|
+
# typed: true
|
2
|
+
|
3
|
+
# DO NOT EDIT MANUALLY
|
4
|
+
# This is an autogenerated file for types exported from the `pastel` gem.
|
5
|
+
# Please instead update this file by running `bin/tapioca gem pastel`.
|
6
|
+
|
7
|
+
|
8
|
+
# source://pastel//lib/pastel/alias_importer.rb#3
|
9
|
+
module Pastel
|
10
|
+
private
|
11
|
+
|
12
|
+
# Create Pastel chainable API
|
13
|
+
#
|
14
|
+
# @api public
|
15
|
+
# @example
|
16
|
+
# pastel = Pastel.new enabled: true
|
17
|
+
# @param :enabled [Boolean] whether or not to disable coloring
|
18
|
+
# @param :eachline [Boolean] whether or not to wrap eachline with separate coloring
|
19
|
+
# @return [Delegator]
|
20
|
+
#
|
21
|
+
# source://pastel//lib/pastel.rb#31
|
22
|
+
def new(enabled: T.unsafe(nil), eachline: T.unsafe(nil)); end
|
23
|
+
|
24
|
+
class << self
|
25
|
+
# Create Pastel chainable API
|
26
|
+
#
|
27
|
+
# @api public
|
28
|
+
# @example
|
29
|
+
# pastel = Pastel.new enabled: true
|
30
|
+
# @param :enabled [Boolean] whether or not to disable coloring
|
31
|
+
# @param :eachline [Boolean] whether or not to wrap eachline with separate coloring
|
32
|
+
# @return [Delegator]
|
33
|
+
#
|
34
|
+
# source://pastel//lib/pastel.rb#31
|
35
|
+
def new(enabled: T.unsafe(nil), eachline: T.unsafe(nil)); end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
# Mixin that provides ANSI codes
|
40
|
+
#
|
41
|
+
# source://pastel//lib/pastel/ansi.rb#5
|
42
|
+
module Pastel::ANSI
|
43
|
+
private
|
44
|
+
|
45
|
+
# source://pastel//lib/pastel/ansi.rb#62
|
46
|
+
def background?(code); end
|
47
|
+
|
48
|
+
# source://pastel//lib/pastel/ansi.rb#58
|
49
|
+
def foreground?(code); end
|
50
|
+
|
51
|
+
# source://pastel//lib/pastel/ansi.rb#66
|
52
|
+
def style?(code); end
|
53
|
+
|
54
|
+
class << self
|
55
|
+
# @return [Boolean]
|
56
|
+
#
|
57
|
+
# source://pastel//lib/pastel/ansi.rb#62
|
58
|
+
def background?(code); end
|
59
|
+
|
60
|
+
# @return [Boolean]
|
61
|
+
#
|
62
|
+
# source://pastel//lib/pastel/ansi.rb#58
|
63
|
+
def foreground?(code); end
|
64
|
+
|
65
|
+
# @return [Boolean]
|
66
|
+
#
|
67
|
+
# source://pastel//lib/pastel/ansi.rb#66
|
68
|
+
def style?(code); end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
# source://pastel//lib/pastel/ansi.rb#6
|
73
|
+
Pastel::ANSI::ATTRIBUTES = T.let(T.unsafe(nil), Hash)
|
74
|
+
|
75
|
+
# A class responsible for importing color aliases
|
76
|
+
#
|
77
|
+
# source://pastel//lib/pastel/alias_importer.rb#5
|
78
|
+
class Pastel::AliasImporter
|
79
|
+
# Create alias importer
|
80
|
+
#
|
81
|
+
# @api public
|
82
|
+
# @example
|
83
|
+
# importer = Pastel::AliasImporter.new(Pastel::Color.new, {})
|
84
|
+
# @return [AliasImporter] a new instance of AliasImporter
|
85
|
+
#
|
86
|
+
# source://pastel//lib/pastel/alias_importer.rb#12
|
87
|
+
def initialize(color, env, output = T.unsafe(nil)); end
|
88
|
+
|
89
|
+
# Import aliases from the environment
|
90
|
+
#
|
91
|
+
# @api public
|
92
|
+
# @example
|
93
|
+
# importer = Pastel::AliasImporter.new(Pastel::Color.new, {})
|
94
|
+
# importer.import
|
95
|
+
# @return [nil]
|
96
|
+
#
|
97
|
+
# source://pastel//lib/pastel/alias_importer.rb#27
|
98
|
+
def import; end
|
99
|
+
|
100
|
+
protected
|
101
|
+
|
102
|
+
# Returns the value of attribute color.
|
103
|
+
#
|
104
|
+
# source://pastel//lib/pastel/alias_importer.rb#44
|
105
|
+
def color; end
|
106
|
+
|
107
|
+
# Returns the value of attribute env.
|
108
|
+
#
|
109
|
+
# source://pastel//lib/pastel/alias_importer.rb#44
|
110
|
+
def env; end
|
111
|
+
|
112
|
+
# Returns the value of attribute output.
|
113
|
+
#
|
114
|
+
# source://pastel//lib/pastel/alias_importer.rb#44
|
115
|
+
def output; end
|
116
|
+
end
|
117
|
+
|
118
|
+
# A class responsible for coloring strings.
|
119
|
+
#
|
120
|
+
# source://pastel//lib/pastel/color.rb#7
|
121
|
+
class Pastel::Color
|
122
|
+
include ::Pastel::ANSI
|
123
|
+
|
124
|
+
# Initialize a Terminal Color
|
125
|
+
#
|
126
|
+
# @api public
|
127
|
+
# @return [Color] a new instance of Color
|
128
|
+
#
|
129
|
+
# source://pastel//lib/pastel/color.rb#24
|
130
|
+
def initialize(enabled: T.unsafe(nil), eachline: T.unsafe(nil)); end
|
131
|
+
|
132
|
+
# Compare colors for equivalence of attributes
|
133
|
+
#
|
134
|
+
# @api public
|
135
|
+
# @return [Boolean]
|
136
|
+
#
|
137
|
+
# source://pastel//lib/pastel/color.rb#235
|
138
|
+
def ==(other); end
|
139
|
+
|
140
|
+
# Define a new colors alias
|
141
|
+
#
|
142
|
+
# @api public
|
143
|
+
# @param alias_name [String] the colors alias to define
|
144
|
+
# @param color [Array[Symbol,String]] the colors the alias will correspond to
|
145
|
+
# @return [Array[String]] the standard color values of the alias
|
146
|
+
#
|
147
|
+
# source://pastel//lib/pastel/color.rb#206
|
148
|
+
def alias_color(alias_name, *colors); end
|
149
|
+
|
150
|
+
# Apply escape codes to the string
|
151
|
+
#
|
152
|
+
# @api private
|
153
|
+
# @param string [String] the string to apply escapes to
|
154
|
+
# @param ansi_colors [Strin] the ansi colors to apply
|
155
|
+
# @return [String] return the string surrounded by escape codes
|
156
|
+
#
|
157
|
+
# source://pastel//lib/pastel/color.rb#78
|
158
|
+
def apply_codes(string, ansi_colors); end
|
159
|
+
|
160
|
+
# Reset sequence
|
161
|
+
#
|
162
|
+
# @api public
|
163
|
+
#
|
164
|
+
# source://pastel//lib/pastel/color.rb#85
|
165
|
+
def clear; end
|
166
|
+
|
167
|
+
# Return raw color code without embeding it into a string.
|
168
|
+
#
|
169
|
+
# @api public
|
170
|
+
# @return [Array[String]] ANSI escape codes
|
171
|
+
#
|
172
|
+
# source://pastel//lib/pastel/color.rb#148
|
173
|
+
def code(*colors); end
|
174
|
+
|
175
|
+
# Check if string has color escape codes
|
176
|
+
#
|
177
|
+
# @api public
|
178
|
+
# @param string [String] the string to check for color strings
|
179
|
+
# @return [Boolean] true when string contains color codes, false otherwise
|
180
|
+
#
|
181
|
+
# source://pastel//lib/pastel/color.rb#117
|
182
|
+
def colored?(string); end
|
183
|
+
|
184
|
+
# Apply ANSI color to the given string.
|
185
|
+
#
|
186
|
+
# Wraps eachline with clear escape.
|
187
|
+
#
|
188
|
+
# @api public
|
189
|
+
# @example
|
190
|
+
# color.decorate "text", :yellow, :on_green, :underline
|
191
|
+
# @param string [String] text to add ANSI strings
|
192
|
+
# @param colors [Array[Symbol]] the color names
|
193
|
+
# @return [String] the colored string
|
194
|
+
#
|
195
|
+
# source://pastel//lib/pastel/color.rb#54
|
196
|
+
def decorate(string, *colors); end
|
197
|
+
|
198
|
+
# Disable coloring of this terminal session
|
199
|
+
#
|
200
|
+
# @api public
|
201
|
+
#
|
202
|
+
# source://pastel//lib/pastel/color.rb#33
|
203
|
+
def disable!; end
|
204
|
+
|
205
|
+
# Returns the value of attribute eachline.
|
206
|
+
#
|
207
|
+
# source://pastel//lib/pastel/color.rb#19
|
208
|
+
def eachline; end
|
209
|
+
|
210
|
+
# Returns the value of attribute enabled.
|
211
|
+
#
|
212
|
+
# source://pastel//lib/pastel/color.rb#16
|
213
|
+
def enabled; end
|
214
|
+
|
215
|
+
# Returns the value of attribute enabled.
|
216
|
+
#
|
217
|
+
# source://pastel//lib/pastel/color.rb#16
|
218
|
+
def enabled?; end
|
219
|
+
|
220
|
+
# Compare colors for equality of attributes
|
221
|
+
#
|
222
|
+
# @api public
|
223
|
+
# @return [Boolean]
|
224
|
+
#
|
225
|
+
# source://pastel//lib/pastel/color.rb#225
|
226
|
+
def eql?(other); end
|
227
|
+
|
228
|
+
# Hash for this instance and its attributes
|
229
|
+
#
|
230
|
+
# @api public
|
231
|
+
# @return [Numeric]
|
232
|
+
#
|
233
|
+
# source://pastel//lib/pastel/color.rb#254
|
234
|
+
def hash; end
|
235
|
+
|
236
|
+
# Inspect this instance attributes
|
237
|
+
#
|
238
|
+
# @api public
|
239
|
+
# @return [String]
|
240
|
+
#
|
241
|
+
# source://pastel//lib/pastel/color.rb#245
|
242
|
+
def inspect; end
|
243
|
+
|
244
|
+
# Find the escape code for a given set of color attributes
|
245
|
+
#
|
246
|
+
# @api private
|
247
|
+
# @example
|
248
|
+
# color.lookup(:red, :on_green) # => "\e[31;42m"
|
249
|
+
# @param colors [Array[Symbol]] the list of color name(s) to lookup
|
250
|
+
# @raise [InvalidAttributeNameError] exception raised for any invalid color name
|
251
|
+
# @return [String] the ANSI code(s)
|
252
|
+
#
|
253
|
+
# source://pastel//lib/pastel/color.rb#136
|
254
|
+
def lookup(*colors); end
|
255
|
+
|
256
|
+
# Strip ANSI color codes from a string.
|
257
|
+
#
|
258
|
+
# Only ANSI color codes are removed, not movement codes or
|
259
|
+
# other escapes sequences are stripped.
|
260
|
+
#
|
261
|
+
# @api public
|
262
|
+
# @example
|
263
|
+
# strip("foo\e[1mbar\e[0m") # => "foobar"
|
264
|
+
# @param strings [Array[String]] a string or array of strings to sanitize
|
265
|
+
# @return [String]
|
266
|
+
#
|
267
|
+
# source://pastel//lib/pastel/color.rb#103
|
268
|
+
def strip(*strings); end
|
269
|
+
|
270
|
+
# List all available style names
|
271
|
+
#
|
272
|
+
# @api public
|
273
|
+
# @return [Array[Symbol]]
|
274
|
+
#
|
275
|
+
# source://pastel//lib/pastel/color.rb#175
|
276
|
+
def style_names; end
|
277
|
+
|
278
|
+
# Expose all ANSI color names and their codes
|
279
|
+
#
|
280
|
+
# @api public
|
281
|
+
# @return [Hash[Symbol]]
|
282
|
+
#
|
283
|
+
# source://pastel//lib/pastel/color.rb#166
|
284
|
+
def styles; end
|
285
|
+
|
286
|
+
# Check if provided colors are known colors
|
287
|
+
#
|
288
|
+
# @api public
|
289
|
+
# @example
|
290
|
+
# valid?(:red) # => true
|
291
|
+
# @param the [Array[Symbol,String]] list of colors to check
|
292
|
+
# @return [Boolean] true if all colors are valid, false otherwise
|
293
|
+
#
|
294
|
+
# source://pastel//lib/pastel/color.rb#191
|
295
|
+
def valid?(*colors); end
|
296
|
+
|
297
|
+
private
|
298
|
+
|
299
|
+
# Check if value contains anything to style
|
300
|
+
#
|
301
|
+
# @api private
|
302
|
+
# @return [Boolean]
|
303
|
+
#
|
304
|
+
# source://pastel//lib/pastel/color.rb#265
|
305
|
+
def blank?(value); end
|
306
|
+
|
307
|
+
# @api private
|
308
|
+
# @raise [InvalidAttributeNameError]
|
309
|
+
#
|
310
|
+
# source://pastel//lib/pastel/color.rb#270
|
311
|
+
def validate(*colors); end
|
312
|
+
end
|
313
|
+
|
314
|
+
# All color aliases
|
315
|
+
#
|
316
|
+
# source://pastel//lib/pastel/color.rb#11
|
317
|
+
Pastel::Color::ALIASES = T.let(T.unsafe(nil), Hash)
|
318
|
+
|
319
|
+
# Match all color escape sequences
|
320
|
+
#
|
321
|
+
# source://pastel//lib/pastel/color.rb#14
|
322
|
+
Pastel::Color::ANSI_COLOR_REGEXP = T.let(T.unsafe(nil), Regexp)
|
323
|
+
|
324
|
+
# Responsible for parsing color symbols out of text with color escapes
|
325
|
+
#
|
326
|
+
# Used internally by {Color}.
|
327
|
+
#
|
328
|
+
# @api private
|
329
|
+
#
|
330
|
+
# source://pastel//lib/pastel/color_parser.rb#13
|
331
|
+
class Pastel::ColorParser
|
332
|
+
include ::Pastel::ANSI
|
333
|
+
|
334
|
+
class << self
|
335
|
+
# Decide attribute name for ansi
|
336
|
+
#
|
337
|
+
# @api private
|
338
|
+
# @param ansi [Integer] the ansi escape code
|
339
|
+
# @return [Symbol]
|
340
|
+
#
|
341
|
+
# source://pastel//lib/pastel/color_parser.rb#104
|
342
|
+
def attribute_name(ansi); end
|
343
|
+
|
344
|
+
# Convert ANSI code to color name
|
345
|
+
#
|
346
|
+
# @api private
|
347
|
+
# @return [String]
|
348
|
+
#
|
349
|
+
# source://pastel//lib/pastel/color_parser.rb#119
|
350
|
+
def color_name(ansi_code); end
|
351
|
+
|
352
|
+
# Parse color escape sequences into a list of hashes
|
353
|
+
# corresponding to the color attributes being set by these
|
354
|
+
# sequences
|
355
|
+
#
|
356
|
+
# @api public
|
357
|
+
# @example
|
358
|
+
# parse("\e[32mfoo\e[0m")
|
359
|
+
# # => [{foreground: :green, text: "foo"}
|
360
|
+
# @param text [String] the text to parse for presence of color ansi codes
|
361
|
+
# @return [Array[Hash[Symbol,String]]]
|
362
|
+
#
|
363
|
+
# source://pastel//lib/pastel/color_parser.rb#33
|
364
|
+
def parse(text); end
|
365
|
+
|
366
|
+
# Remove from current stack all ansi codes
|
367
|
+
#
|
368
|
+
# @api private
|
369
|
+
# @param ansi_stack [Array[Integer]] the stack with all the ansi codes
|
370
|
+
# @yield [Symbol, Symbol] attr, name
|
371
|
+
#
|
372
|
+
# source://pastel//lib/pastel/color_parser.rb#90
|
373
|
+
def unpack_ansi(ansi_stack); end
|
374
|
+
end
|
375
|
+
end
|
376
|
+
|
377
|
+
# @api private
|
378
|
+
#
|
379
|
+
# source://pastel//lib/pastel/color_parser.rb#17
|
380
|
+
Pastel::ColorParser::CSI = T.let(T.unsafe(nil), String)
|
381
|
+
|
382
|
+
# @api private
|
383
|
+
#
|
384
|
+
# source://pastel//lib/pastel/color_parser.rb#16
|
385
|
+
Pastel::ColorParser::ESC = T.let(T.unsafe(nil), String)
|
386
|
+
|
387
|
+
# Contains logic for resolving styles applied to component
|
388
|
+
#
|
389
|
+
# Used internally by {Delegator}.
|
390
|
+
#
|
391
|
+
# @api private
|
392
|
+
#
|
393
|
+
# source://pastel//lib/pastel/color_resolver.rb#11
|
394
|
+
class Pastel::ColorResolver
|
395
|
+
# Initialize ColorResolver
|
396
|
+
#
|
397
|
+
# @api private
|
398
|
+
# @param color [Color]
|
399
|
+
# @return [ColorResolver] a new instance of ColorResolver
|
400
|
+
#
|
401
|
+
# source://pastel//lib/pastel/color_resolver.rb#21
|
402
|
+
def initialize(color); end
|
403
|
+
|
404
|
+
# The color instance
|
405
|
+
#
|
406
|
+
# @api public
|
407
|
+
#
|
408
|
+
# source://pastel//lib/pastel/color_resolver.rb#14
|
409
|
+
def color; end
|
410
|
+
|
411
|
+
# Resolve uncolored string
|
412
|
+
#
|
413
|
+
# @api private
|
414
|
+
#
|
415
|
+
# source://pastel//lib/pastel/color_resolver.rb#28
|
416
|
+
def resolve(base, unprocessed_string); end
|
417
|
+
end
|
418
|
+
|
419
|
+
# Collects a list of decorators for styling a string
|
420
|
+
#
|
421
|
+
# @api private
|
422
|
+
#
|
423
|
+
# source://pastel//lib/pastel/decorator_chain.rb#7
|
424
|
+
class Pastel::DecoratorChain
|
425
|
+
include ::Enumerable
|
426
|
+
|
427
|
+
# Create a decorator chain
|
428
|
+
#
|
429
|
+
# @api public
|
430
|
+
# @return [DecoratorChain] a new instance of DecoratorChain
|
431
|
+
#
|
432
|
+
# source://pastel//lib/pastel/decorator_chain.rb#22
|
433
|
+
def initialize(decorators = T.unsafe(nil)); end
|
434
|
+
|
435
|
+
# Compare colors for equivalence of attributes
|
436
|
+
#
|
437
|
+
# @api public
|
438
|
+
# @return [Boolean]
|
439
|
+
#
|
440
|
+
# source://pastel//lib/pastel/decorator_chain.rb#60
|
441
|
+
def ==(other); end
|
442
|
+
|
443
|
+
# Add decorator
|
444
|
+
#
|
445
|
+
# @api public
|
446
|
+
# @param decorator [String]
|
447
|
+
#
|
448
|
+
# source://pastel//lib/pastel/decorator_chain.rb#31
|
449
|
+
def add(decorator); end
|
450
|
+
|
451
|
+
# Iterate over list of decorators
|
452
|
+
#
|
453
|
+
# @api public
|
454
|
+
#
|
455
|
+
# source://pastel//lib/pastel/decorator_chain.rb#42
|
456
|
+
def each(&block); end
|
457
|
+
|
458
|
+
# Compare colors for equality of attributes
|
459
|
+
#
|
460
|
+
# @api public
|
461
|
+
# @return [Boolean]
|
462
|
+
#
|
463
|
+
# source://pastel//lib/pastel/decorator_chain.rb#51
|
464
|
+
def eql?(other); end
|
465
|
+
|
466
|
+
# Hash for this instance and its attributes
|
467
|
+
#
|
468
|
+
# @api public
|
469
|
+
# @return [Numeric]
|
470
|
+
#
|
471
|
+
# source://pastel//lib/pastel/decorator_chain.rb#78
|
472
|
+
def hash; end
|
473
|
+
|
474
|
+
# Inspect this instance attributes
|
475
|
+
#
|
476
|
+
# @api public
|
477
|
+
# @return [String]
|
478
|
+
#
|
479
|
+
# source://pastel//lib/pastel/decorator_chain.rb#69
|
480
|
+
def inspect; end
|
481
|
+
|
482
|
+
protected
|
483
|
+
|
484
|
+
# @api private
|
485
|
+
#
|
486
|
+
# source://pastel//lib/pastel/decorator_chain.rb#84
|
487
|
+
def decorators; end
|
488
|
+
|
489
|
+
class << self
|
490
|
+
# Create an empty decorator chain
|
491
|
+
#
|
492
|
+
# @api public
|
493
|
+
# @return [DecoratorChain]
|
494
|
+
#
|
495
|
+
# source://pastel//lib/pastel/decorator_chain.rb#15
|
496
|
+
def empty; end
|
497
|
+
end
|
498
|
+
end
|
499
|
+
|
500
|
+
# Wrapes the {DecoratorChain} to allow for easy resolution
|
501
|
+
# of string coloring.
|
502
|
+
#
|
503
|
+
# @api private
|
504
|
+
#
|
505
|
+
# source://pastel//lib/pastel/delegator.rb#13
|
506
|
+
class Pastel::Delegator
|
507
|
+
extend ::Forwardable
|
508
|
+
|
509
|
+
# Create Delegator
|
510
|
+
#
|
511
|
+
# Used internally by {Pastel}
|
512
|
+
#
|
513
|
+
# @api private
|
514
|
+
# @param resolver [ColorResolver]
|
515
|
+
# @param chain [DecoratorChain]
|
516
|
+
# @return [Delegator] a new instance of Delegator
|
517
|
+
#
|
518
|
+
# source://pastel//lib/pastel/delegator.rb#38
|
519
|
+
def initialize(resolver, chain); end
|
520
|
+
|
521
|
+
# Compare delegated objects for equivalence of attributes
|
522
|
+
#
|
523
|
+
# @api public
|
524
|
+
# @return [Boolean]
|
525
|
+
#
|
526
|
+
# source://pastel//lib/pastel/delegator.rb#57
|
527
|
+
def ==(other); end
|
528
|
+
|
529
|
+
# source://forwardable/1.3.3/forwardable.rb#231
|
530
|
+
def alias_color(*args, **_arg1, &block); end
|
531
|
+
|
532
|
+
# source://forwardable/1.3.3/forwardable.rb#231
|
533
|
+
def colored?(*args, **_arg1, &block); end
|
534
|
+
|
535
|
+
# source://forwardable/1.3.3/forwardable.rb#231
|
536
|
+
def decorate(*args, **_arg1, &block); end
|
537
|
+
|
538
|
+
# source://forwardable/1.3.3/forwardable.rb#231
|
539
|
+
def enabled?(*args, **_arg1, &block); end
|
540
|
+
|
541
|
+
# Compare delegated objects for equality of attributes
|
542
|
+
#
|
543
|
+
# @api public
|
544
|
+
# @return [Boolean]
|
545
|
+
#
|
546
|
+
# source://pastel//lib/pastel/delegator.rb#48
|
547
|
+
def eql?(other); end
|
548
|
+
|
549
|
+
# Hash for this instance and its attributes
|
550
|
+
#
|
551
|
+
# @api public
|
552
|
+
# @return [Numeric]
|
553
|
+
#
|
554
|
+
# source://pastel//lib/pastel/delegator.rb#76
|
555
|
+
def hash; end
|
556
|
+
|
557
|
+
# Object string representation
|
558
|
+
#
|
559
|
+
# @api
|
560
|
+
# @return [String]
|
561
|
+
#
|
562
|
+
# source://pastel//lib/pastel/delegator.rb#66
|
563
|
+
def inspect; end
|
564
|
+
|
565
|
+
# source://forwardable/1.3.3/forwardable.rb#231
|
566
|
+
def lookup(*args, **_arg1, &block); end
|
567
|
+
|
568
|
+
# source://forwardable/1.3.3/forwardable.rb#231
|
569
|
+
def parse(*args, **_arg1, &block); end
|
570
|
+
|
571
|
+
# source://forwardable/1.3.3/forwardable.rb#231
|
572
|
+
def strip(*args, **_arg1, &block); end
|
573
|
+
|
574
|
+
# source://forwardable/1.3.3/forwardable.rb#231
|
575
|
+
def styles(*args, **_arg1, &block); end
|
576
|
+
|
577
|
+
# Object string representation
|
578
|
+
#
|
579
|
+
# @api
|
580
|
+
# @return [String]
|
581
|
+
#
|
582
|
+
# source://pastel//lib/pastel/delegator.rb#66
|
583
|
+
def to_s; end
|
584
|
+
|
585
|
+
# @api private
|
586
|
+
#
|
587
|
+
# source://forwardable/1.3.3/forwardable.rb#231
|
588
|
+
def undecorate(*args, **_arg1, &block); end
|
589
|
+
|
590
|
+
# source://forwardable/1.3.3/forwardable.rb#231
|
591
|
+
def valid?(*args, **_arg1, &block); end
|
592
|
+
|
593
|
+
protected
|
594
|
+
|
595
|
+
# @api private
|
596
|
+
#
|
597
|
+
# source://pastel//lib/pastel/delegator.rb#82
|
598
|
+
def chain; end
|
599
|
+
|
600
|
+
# Evaluate color block
|
601
|
+
#
|
602
|
+
# @api private
|
603
|
+
#
|
604
|
+
# source://pastel//lib/pastel/delegator.rb#112
|
605
|
+
def evaluate_block(&block); end
|
606
|
+
|
607
|
+
# Handles color method calls
|
608
|
+
#
|
609
|
+
# @api private
|
610
|
+
#
|
611
|
+
# source://pastel//lib/pastel/delegator.rb#89
|
612
|
+
def method_missing(method_name, *args, &block); end
|
613
|
+
|
614
|
+
# @api private
|
615
|
+
#
|
616
|
+
# source://pastel//lib/pastel/delegator.rb#84
|
617
|
+
def resolver; end
|
618
|
+
|
619
|
+
private
|
620
|
+
|
621
|
+
# Check if color is valid
|
622
|
+
#
|
623
|
+
# @api private
|
624
|
+
# @return [Boolean]
|
625
|
+
#
|
626
|
+
# source://pastel//lib/pastel/delegator.rb#104
|
627
|
+
def respond_to_missing?(name, include_all = T.unsafe(nil)); end
|
628
|
+
|
629
|
+
class << self
|
630
|
+
# Wrap resolver and chain
|
631
|
+
#
|
632
|
+
# @api public
|
633
|
+
#
|
634
|
+
# source://pastel//lib/pastel/delegator.rb#25
|
635
|
+
def wrap(resolver, chain = T.unsafe(nil)); end
|
636
|
+
end
|
637
|
+
end
|
638
|
+
|
639
|
+
# A class representing detached color
|
640
|
+
#
|
641
|
+
# source://pastel//lib/pastel/detached.rb#5
|
642
|
+
class Pastel::Detached
|
643
|
+
# Initialize a detached object
|
644
|
+
#
|
645
|
+
# @api private
|
646
|
+
# @param color [Pastel::Color] the color instance
|
647
|
+
# @param styles [Array[Symbol]] the styles to be applied
|
648
|
+
# @return [Detached] a new instance of Detached
|
649
|
+
#
|
650
|
+
# source://pastel//lib/pastel/detached.rb#14
|
651
|
+
def initialize(color, *styles); end
|
652
|
+
|
653
|
+
# Compare detached objects for equivalence of attributes
|
654
|
+
#
|
655
|
+
# @api public
|
656
|
+
# @return [Boolean]
|
657
|
+
#
|
658
|
+
# source://pastel//lib/pastel/detached.rb#57
|
659
|
+
def ==(other); end
|
660
|
+
|
661
|
+
# Decorate the values corresponding to styles
|
662
|
+
#
|
663
|
+
# @api public
|
664
|
+
# @example
|
665
|
+
# Detached(Color.new, :red, :bold).call("hello")
|
666
|
+
# # => "\e[31mhello\e[0m"
|
667
|
+
# @param value [String] the stirng to decorate with styles
|
668
|
+
# @return [String]
|
669
|
+
#
|
670
|
+
# source://pastel//lib/pastel/detached.rb#32
|
671
|
+
def [](*args); end
|
672
|
+
|
673
|
+
# Decorate the values corresponding to styles
|
674
|
+
#
|
675
|
+
# @api public
|
676
|
+
# @example
|
677
|
+
# Detached(Color.new, :red, :bold).call("hello")
|
678
|
+
# # => "\e[31mhello\e[0m"
|
679
|
+
# @param value [String] the stirng to decorate with styles
|
680
|
+
# @return [String]
|
681
|
+
#
|
682
|
+
# source://pastel//lib/pastel/detached.rb#32
|
683
|
+
def call(*args); end
|
684
|
+
|
685
|
+
# Compare detached objects for equality of attributes
|
686
|
+
#
|
687
|
+
# @api public
|
688
|
+
# @return [Boolean]
|
689
|
+
#
|
690
|
+
# source://pastel//lib/pastel/detached.rb#48
|
691
|
+
def eql?(other); end
|
692
|
+
|
693
|
+
# Hash for this instance and its attributes
|
694
|
+
#
|
695
|
+
# @api public
|
696
|
+
# @return [Numeric]
|
697
|
+
#
|
698
|
+
# source://pastel//lib/pastel/detached.rb#75
|
699
|
+
def hash; end
|
700
|
+
|
701
|
+
# Inspect this instance attributes
|
702
|
+
#
|
703
|
+
# @api public
|
704
|
+
# @return [String]
|
705
|
+
#
|
706
|
+
# source://pastel//lib/pastel/detached.rb#66
|
707
|
+
def inspect; end
|
708
|
+
|
709
|
+
# @api public
|
710
|
+
#
|
711
|
+
# source://pastel//lib/pastel/detached.rb#39
|
712
|
+
def to_proc; end
|
713
|
+
|
714
|
+
protected
|
715
|
+
|
716
|
+
# @api private
|
717
|
+
#
|
718
|
+
# source://pastel//lib/pastel/detached.rb#82
|
719
|
+
def styles; end
|
720
|
+
end
|
721
|
+
|
722
|
+
# Raised when the color alias is not supported
|
723
|
+
#
|
724
|
+
# source://pastel//lib/pastel.rb#16
|
725
|
+
class Pastel::InvalidAliasNameError < ::ArgumentError; end
|
726
|
+
|
727
|
+
# Raised when the style attribute is not supported
|
728
|
+
#
|
729
|
+
# source://pastel//lib/pastel.rb#13
|
730
|
+
class Pastel::InvalidAttributeNameError < ::ArgumentError; end
|
731
|
+
|
732
|
+
# source://pastel//lib/pastel/version.rb#4
|
733
|
+
Pastel::VERSION = T.let(T.unsafe(nil), String)
|