esquema 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (78) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +4 -1
  3. data/CHANGELOG.md +9 -1
  4. data/README.md +8 -2
  5. data/lib/esquema/builder.rb +73 -28
  6. data/lib/esquema/configuration.rb +2 -1
  7. data/lib/esquema/keyword_validator.rb +98 -0
  8. data/lib/esquema/model.rb +4 -0
  9. data/lib/esquema/property.rb +185 -26
  10. data/lib/esquema/schema_enhancer.rb +55 -30
  11. data/lib/esquema/type_caster.rb +16 -4
  12. data/lib/esquema/version.rb +1 -1
  13. data/lib/esquema/virtual_column.rb +46 -0
  14. data/lib/esquema.rb +7 -1
  15. data/lib/generators/esquema/install/install_generator.rb +1 -0
  16. data/sorbet/config +4 -0
  17. data/sorbet/rbi/annotations/.gitattributes +1 -0
  18. data/sorbet/rbi/annotations/activemodel.rbi +89 -0
  19. data/sorbet/rbi/annotations/activerecord.rbi +92 -0
  20. data/sorbet/rbi/annotations/activesupport.rbi +421 -0
  21. data/sorbet/rbi/annotations/rainbow.rbi +269 -0
  22. data/sorbet/rbi/gems/.gitattributes +1 -0
  23. data/sorbet/rbi/gems/activemodel@7.1.3.rbi +8 -0
  24. data/sorbet/rbi/gems/activerecord@7.1.3.rbi +8 -0
  25. data/sorbet/rbi/gems/activesupport@7.1.3.rbi +192 -0
  26. data/sorbet/rbi/gems/ast@2.4.2.rbi +584 -0
  27. data/sorbet/rbi/gems/base64@0.2.0.rbi +8 -0
  28. data/sorbet/rbi/gems/bigdecimal@3.1.6.rbi +8 -0
  29. data/sorbet/rbi/gems/byebug@11.1.3.rbi +3606 -0
  30. data/sorbet/rbi/gems/coderay@1.1.3.rbi +3426 -0
  31. data/sorbet/rbi/gems/concurrent-ruby@1.2.3.rbi +8 -0
  32. data/sorbet/rbi/gems/connection_pool@2.4.1.rbi +8 -0
  33. data/sorbet/rbi/gems/diff-lcs@1.5.1.rbi +1130 -0
  34. data/sorbet/rbi/gems/drb@2.2.0.rbi +1272 -0
  35. data/sorbet/rbi/gems/erubi@1.12.0.rbi +145 -0
  36. data/sorbet/rbi/gems/i18n@1.14.1.rbi +8 -0
  37. data/sorbet/rbi/gems/json@2.7.1.rbi +1553 -0
  38. data/sorbet/rbi/gems/language_server-protocol@3.17.0.3.rbi +14237 -0
  39. data/sorbet/rbi/gems/method_source@1.0.0.rbi +272 -0
  40. data/sorbet/rbi/gems/minitest@5.22.2.rbi +8 -0
  41. data/sorbet/rbi/gems/mutex_m@0.2.0.rbi +8 -0
  42. data/sorbet/rbi/gems/netrc@0.11.0.rbi +158 -0
  43. data/sorbet/rbi/gems/parallel@1.24.0.rbi +280 -0
  44. data/sorbet/rbi/gems/parser@3.3.0.5.rbi +5472 -0
  45. data/sorbet/rbi/gems/prettier_print@1.2.1.rbi +951 -0
  46. data/sorbet/rbi/gems/prism@0.24.0.rbi +31040 -0
  47. data/sorbet/rbi/gems/pry-byebug@3.10.1.rbi +1150 -0
  48. data/sorbet/rbi/gems/pry@0.14.2.rbi +10075 -0
  49. data/sorbet/rbi/gems/racc@1.7.3.rbi +157 -0
  50. data/sorbet/rbi/gems/rainbow@3.1.1.rbi +402 -0
  51. data/sorbet/rbi/gems/rake@13.1.0.rbi +3027 -0
  52. data/sorbet/rbi/gems/rbi@0.1.9.rbi +3006 -0
  53. data/sorbet/rbi/gems/regexp_parser@2.9.0.rbi +3771 -0
  54. data/sorbet/rbi/gems/rexml@3.2.6.rbi +4781 -0
  55. data/sorbet/rbi/gems/rspec-core@3.13.0.rbi +10978 -0
  56. data/sorbet/rbi/gems/rspec-expectations@3.13.0.rbi +8153 -0
  57. data/sorbet/rbi/gems/rspec-mocks@3.13.0.rbi +5340 -0
  58. data/sorbet/rbi/gems/rspec-support@3.13.0.rbi +1629 -0
  59. data/sorbet/rbi/gems/rspec@3.13.0.rbi +82 -0
  60. data/sorbet/rbi/gems/rubocop-ast@1.30.0.rbi +7006 -0
  61. data/sorbet/rbi/gems/rubocop@1.60.2.rbi +57383 -0
  62. data/sorbet/rbi/gems/ruby-progressbar@1.13.0.rbi +1317 -0
  63. data/sorbet/rbi/gems/ruby2_keywords@0.0.5.rbi +8 -0
  64. data/sorbet/rbi/gems/spoom@1.2.4.rbi +3777 -0
  65. data/sorbet/rbi/gems/sqlite3@1.7.2.rbi +1691 -0
  66. data/sorbet/rbi/gems/syntax_tree@6.2.0.rbi +23133 -0
  67. data/sorbet/rbi/gems/tapioca@0.12.0.rbi +3510 -0
  68. data/sorbet/rbi/gems/thor@1.3.0.rbi +4345 -0
  69. data/sorbet/rbi/gems/timeout@0.4.1.rbi +142 -0
  70. data/sorbet/rbi/gems/tzinfo@2.0.6.rbi +8 -0
  71. data/sorbet/rbi/gems/unicode-display_width@2.5.0.rbi +65 -0
  72. data/sorbet/rbi/gems/yard-sorbet@0.8.1.rbi +428 -0
  73. data/sorbet/rbi/gems/yard@0.9.34.rbi +18219 -0
  74. data/sorbet/rbi/todo.rbi +20 -0
  75. data/sorbet/tapioca/config.yml +13 -0
  76. data/sorbet/tapioca/require.rb +4 -0
  77. metadata +72 -10
  78. data/esquema.gemspec +0 -38
@@ -0,0 +1,421 @@
1
+ # typed: true
2
+
3
+ # DO NOT EDIT MANUALLY
4
+ # This file was pulled from a central RBI files repository.
5
+ # Please run `bin/tapioca annotations` to update it.
6
+
7
+ module ActiveSupport::Testing::Declarative
8
+ sig { params(name: String, block: T.proc.bind(T.untyped).void).void }
9
+ def test(name, &block); end
10
+ end
11
+
12
+ class ActiveSupport::EnvironmentInquirer
13
+ sig { returns(T::Boolean) }
14
+ def development?; end
15
+
16
+ sig { returns(T::Boolean) }
17
+ def production?; end
18
+
19
+ sig { returns(T::Boolean) }
20
+ def test?; end
21
+
22
+ # @method_missing: delegated to String through ActiveSupport::StringInquirer
23
+ sig { returns(T::Boolean) }
24
+ def staging?; end
25
+ end
26
+
27
+ module ActiveSupport::Testing::SetupAndTeardown::ClassMethods
28
+ sig { params(args: T.untyped, block: T.nilable(T.proc.bind(T.untyped).void)).void }
29
+ def setup(*args, &block); end
30
+
31
+ sig { params(args: T.untyped, block: T.nilable(T.proc.bind(T.untyped).void)).void }
32
+ def teardown(*args, &block); end
33
+ end
34
+
35
+ class ActiveSupport::TestCase
36
+ sig { params(args: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).void)).void }
37
+ def self.setup(*args, &block); end
38
+
39
+ sig { params(args: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).void)).void }
40
+ def self.teardown(*args, &block); end
41
+
42
+ sig { params(name: String, block: T.proc.bind(T.attached_class).void).void }
43
+ def self.test(name, &block); end
44
+ end
45
+
46
+ class ActiveSupport::TimeWithZone
47
+ # @shim: Methods on ActiveSupport::TimeWithZone are delegated to `Time` using `method_missing
48
+ include ::DateAndTime::Zones
49
+
50
+ # @shim: Methods on ActiveSupport::TimeWithZone are delegated to `Time` using `method_missing
51
+ include ::DateAndTime::Calculations
52
+
53
+ sig { returns(FalseClass) }
54
+ def blank?; end
55
+
56
+ # @shim: since `present?` is always true, `presence` always returns `self`
57
+ sig { returns(T.self_type) }
58
+ def presence; end
59
+
60
+ # @shim: since `blank?` is always false, `present?` always returns `true`
61
+ sig { returns(TrueClass) }
62
+ def present?; end
63
+ end
64
+
65
+ class Object
66
+ sig { returns(T::Boolean) }
67
+ def blank?; end
68
+
69
+ sig { returns(FalseClass) }
70
+ def html_safe?; end
71
+
72
+ sig { returns(T.nilable(T.self_type)) }
73
+ def presence; end
74
+
75
+ sig { params(another_object: T.untyped).returns(T.nilable(T.self_type)) }
76
+ def presence_in(another_object); end
77
+
78
+ sig { returns(T::Boolean) }
79
+ def present?; end
80
+ end
81
+
82
+ class Hash
83
+ sig { returns(T::Boolean) }
84
+ def extractable_options?; end
85
+ end
86
+
87
+ class Array
88
+ sig { params(position: Integer).returns(T.self_type) }
89
+ def from(position); end
90
+
91
+ sig { params(position: Integer).returns(T.self_type) }
92
+ def to(position); end
93
+
94
+ sig { params(elements: T.untyped).returns(T::Array[T.untyped]) }
95
+ def including(*elements); end
96
+
97
+ sig { params(elements: T.untyped).returns(T.self_type) }
98
+ def excluding(*elements); end
99
+
100
+ sig { params(elements: T.untyped).returns(T.self_type) }
101
+ def without(*elements); end
102
+
103
+ sig { returns(T.nilable(Elem)) }
104
+ def second; end
105
+
106
+ sig { returns(T.nilable(Elem)) }
107
+ def third; end
108
+
109
+ sig { returns(T.nilable(Elem)) }
110
+ def fourth; end
111
+
112
+ sig { returns(T.nilable(Elem)) }
113
+ def fifth; end
114
+
115
+ sig { returns(T.nilable(Elem)) }
116
+ def forty_two; end
117
+
118
+ sig { returns(T.nilable(Elem)) }
119
+ def third_to_last; end
120
+
121
+ sig { returns(T.nilable(Elem)) }
122
+ def second_to_last; end
123
+
124
+ sig { params(options: T::Hash[T.untyped, T.untyped]).returns(String) }
125
+ def to_sentence(options = {}); end
126
+
127
+ sig { params(format: Symbol).returns(String) }
128
+ def to_fs(format = :default); end
129
+
130
+ sig { params(format: Symbol).returns(String) }
131
+ def to_formatted_s(format = :default); end
132
+
133
+ sig { returns(String) }
134
+ def to_xml; end
135
+
136
+ sig { returns(T::Hash[T.untyped, T.untyped]) }
137
+ def extract_options!; end
138
+
139
+ sig { type_parameters(:FillType).params(number: Integer, fill_with: T.type_parameter(:FillType), block: T.nilable(T.proc.params(group: T::Array[T.any(Elem, T.type_parameter(:FillType))]).void)).returns(T::Array[T::Array[T.any(Elem, T.type_parameter(:FillType))]]) }
140
+ def in_groups(number, fill_with = T.unsafe(nil), &block); end
141
+
142
+ sig { type_parameters(:FillType).params(number: Integer, fill_with: T.type_parameter(:FillType), block: T.nilable(T.proc.params(group: T::Array[T.any(Elem, T.type_parameter(:FillType))]).void)).returns(T::Array[T::Array[T.any(Elem, T.type_parameter(:FillType))]]) }
143
+ def in_groups_of(number, fill_with = T.unsafe(nil), &block); end
144
+
145
+ sig { params(value: T.untyped, block: T.nilable(T.proc.params(element: Elem).returns(T.untyped))).returns(T::Array[T::Array[Elem]]) }
146
+ def split(value = nil, &block); end
147
+
148
+ sig { params(block: T.nilable(T.proc.params(element: Elem).returns(T.untyped))).returns(T.any(T::Array[Elem], T::Enumerator[Elem])) }
149
+ def extract!(&block); end
150
+
151
+ sig { returns(ActiveSupport::ArrayInquirer) }
152
+ def inquiry; end
153
+
154
+ sig { params(object: T.untyped).returns(T::Array[T.untyped]) }
155
+ def self.wrap(object); end
156
+ end
157
+
158
+ class Date
159
+ sig { returns(FalseClass) }
160
+ def blank?; end
161
+
162
+ # @shim: since `present?` is always true, `presence` always returns `self`
163
+ sig { returns(T.self_type) }
164
+ def presence; end
165
+
166
+ # @shim: since `blank?` is always false, `present?` always returns `true`
167
+ sig { returns(TrueClass) }
168
+ def present?; end
169
+ end
170
+
171
+ class DateTime
172
+ sig { returns(FalseClass) }
173
+ def blank?; end
174
+
175
+ # @shim: since `present?` is always true, `presence` always returns `self`
176
+ sig { returns(T.self_type) }
177
+ def presence; end
178
+
179
+ # @shim: since `blank?` is always false, `present?` always returns `true`
180
+ sig { returns(TrueClass) }
181
+ def present?; end
182
+ end
183
+
184
+ class NilClass
185
+ sig { returns(TrueClass) }
186
+ def blank?; end
187
+
188
+ # @shim: since `present?` is always false, `presence` always returns `nil`
189
+ sig { returns(NilClass) }
190
+ def presence; end
191
+
192
+ # @shim: since `blank?` is always true, `present?` always returns `false`
193
+ sig { returns(FalseClass) }
194
+ def present?; end
195
+ end
196
+
197
+ class FalseClass
198
+ sig { returns(TrueClass) }
199
+ def blank?; end
200
+
201
+ # @shim: since `present?` is always false, `presence` always returns `nil`
202
+ sig { returns(NilClass) }
203
+ def presence; end
204
+
205
+ # @shim: since `blank?` is always true, `present?` always returns `false`
206
+ sig { returns(FalseClass) }
207
+ def present?; end
208
+ end
209
+
210
+ class TrueClass
211
+ sig { returns(FalseClass) }
212
+ def blank?; end
213
+
214
+ # @shim: since `present?` is always true, `presence` always returns `self`
215
+ sig { returns(T.self_type) }
216
+ def presence; end
217
+
218
+ # @shim: since `blank?` is always false, `present?` always returns `true`
219
+ sig { returns(TrueClass) }
220
+ def present?; end
221
+ end
222
+
223
+ class Numeric
224
+ sig { returns(FalseClass) }
225
+ def blank?; end
226
+
227
+ sig { returns(TrueClass) }
228
+ def html_safe?; end
229
+
230
+ # @shim: since `present?` is always true, `presence` always returns `self`
231
+ sig { returns(T.self_type) }
232
+ def presence; end
233
+
234
+ # @shim: since `blank?` is always false, `present?` always returns `true`
235
+ sig { returns(TrueClass) }
236
+ def present?; end
237
+ end
238
+
239
+ class Time
240
+ sig { returns(FalseClass) }
241
+ def blank?; end
242
+
243
+ # @shim: since `present?` is always true, `presence` always returns `self`
244
+ sig { returns(T.self_type) }
245
+ def presence; end
246
+
247
+ # @shim: since `blank?` is always false, `present?` always returns `true`
248
+ sig { returns(TrueClass) }
249
+ def present?; end
250
+ end
251
+
252
+ class Symbol
253
+ # alias for `#start_with?`
254
+ sig { params(string_or_regexp: T.any(String, Regexp)).returns(T::Boolean) }
255
+ def starts_with?(*string_or_regexp); end
256
+
257
+ # alias for `#end_with?`
258
+ sig { params(string_or_regexp: T.any(String, Regexp)).returns(T::Boolean) }
259
+ def ends_with?(*string_or_regexp); end
260
+ end
261
+
262
+ class String
263
+ sig { returns(TrueClass) }
264
+ def acts_like_string?; end
265
+
266
+ sig { params(position: Integer).returns(T.nilable(String)) }
267
+ sig { params(position: T.any(T::Range[Integer], Regexp)).returns(T.nilable(String)) }
268
+ sig { params(position: String).returns(T.nilable(String)) }
269
+ def at(position); end
270
+
271
+ sig { returns(String) }
272
+ def as_json; end
273
+
274
+ sig { returns(T::Boolean) }
275
+ def blank?; end
276
+
277
+ sig { params(first_letter: Symbol).returns(String) }
278
+ def camelcase(first_letter = :upper); end
279
+
280
+ sig { params(first_letter: Symbol).returns(String) }
281
+ def camelize(first_letter = :upper); end
282
+
283
+ sig { returns(String) }
284
+ def classify; end
285
+
286
+ sig { returns(T.untyped) }
287
+ def constantize; end
288
+
289
+ sig { returns(String) }
290
+ def dasherize; end
291
+
292
+ sig { returns(String) }
293
+ def deconstantize; end
294
+
295
+ sig { returns(String) }
296
+ def demodulize; end
297
+
298
+ # alias for `#end_with?`
299
+ sig { params(string_or_regexp: T.any(String, Regexp)).returns(T::Boolean) }
300
+ def ends_with?(*string_or_regexp); end
301
+
302
+ sig { returns(String) }
303
+ def downcase_first; end
304
+
305
+ sig { params(string: String).returns(T::Boolean) }
306
+ def exclude?(string); end
307
+
308
+ sig { params(limit: Integer).returns(String) }
309
+ def first(limit = 1); end
310
+
311
+ sig { params(separate_class_name_and_id_with_underscore: T::Boolean).returns(String) }
312
+ def foreign_key(separate_class_name_and_id_with_underscore = true); end
313
+
314
+ sig { params(position: Integer).returns(String) }
315
+ def from(position); end
316
+
317
+ sig { returns(ActiveSupport::SafeBuffer) }
318
+ def html_safe; end
319
+
320
+ sig { params(capitalize: T::Boolean, keep_id_suffix: T::Boolean).returns(String) }
321
+ def humanize(capitalize: true, keep_id_suffix: false); end
322
+
323
+ sig { params(zone: T.nilable(T.any(ActiveSupport::TimeZone, String))).returns(T.any(ActiveSupport::TimeWithZone, Time)) }
324
+ def in_time_zone(zone = ::Time.zone); end
325
+
326
+ sig { params(amount: Integer, indent_string: T.nilable(String), indent_empty_lines: T::Boolean).returns(String) }
327
+ def indent(amount, indent_string = nil, indent_empty_lines = false); end
328
+
329
+ sig { params(amount: Integer, indent_string: T.nilable(String), indent_empty_lines: T::Boolean).returns(T.nilable(String)) }
330
+ def indent!(amount, indent_string = nil, indent_empty_lines = false); end
331
+
332
+ sig { returns(ActiveSupport::StringInquirer) }
333
+ def inquiry; end
334
+
335
+ sig { returns(T::Boolean) }
336
+ def is_utf8?; end
337
+
338
+ sig { params(limit: Integer).returns(String) }
339
+ def last(limit = 1); end
340
+
341
+ sig { returns(ActiveSupport::Multibyte::Chars) }
342
+ def mb_chars; end
343
+
344
+ sig { params(separator: String, preserve_case: T::Boolean, locale: T.nilable(Symbol)).returns(String) }
345
+ def parameterize(separator: "-", preserve_case: false, locale: nil); end
346
+
347
+ sig { params(count: T.nilable(T.any(Integer, Symbol)), locale: T.nilable(Symbol)).returns(String) }
348
+ def pluralize(count = nil, locale = :en); end
349
+
350
+ sig { params(patterns: T.any(String, Regexp)).returns(String) }
351
+ def remove(*patterns); end
352
+
353
+ sig { params(patterns: T.any(String, Regexp)).returns(String) }
354
+ def remove!(*patterns); end
355
+
356
+ sig { returns(T.untyped) }
357
+ def safe_constantize; end
358
+
359
+ sig { params(locale: Symbol).returns(String) }
360
+ def singularize(locale = :en); end
361
+
362
+ sig { returns(String) }
363
+ def squish; end
364
+
365
+ sig { returns(String) }
366
+ def squish!; end
367
+
368
+ # alias for `#start_with?`
369
+ sig { params(string_or_regexp: T.any(String, Regexp)).returns(T::Boolean) }
370
+ def starts_with?(*string_or_regexp); end
371
+
372
+ sig { returns(String) }
373
+ def strip_heredoc; end
374
+
375
+ sig { returns(String) }
376
+ def tableize; end
377
+
378
+ sig { params(keep_id_suffix: T::Boolean).returns(String) }
379
+ def titlecase(keep_id_suffix: false); end
380
+
381
+ sig { params(keep_id_suffix: T::Boolean).returns(String) }
382
+ def titleize(keep_id_suffix: false); end
383
+
384
+ sig { params(position: Integer).returns(String) }
385
+ def to(position); end
386
+
387
+ sig { returns(::Date) }
388
+ def to_date; end
389
+
390
+ sig { returns(::DateTime) }
391
+ def to_datetime; end
392
+
393
+ sig { params(form: T.nilable(Symbol)).returns(T.nilable(Time)) }
394
+ def to_time(form = :local); end
395
+
396
+ sig { params(truncate_to: Integer, options: T::Hash[Symbol, T.anything]).returns(String) }
397
+ def truncate(truncate_to, options = {}); end
398
+
399
+ sig { params(truncate_to: Integer, omission: T.nilable(String)).returns(String) }
400
+ def truncate_bytes(truncate_to, omission: "…"); end
401
+
402
+ sig { params(words_count: Integer, options: T::Hash[Symbol, T.anything]).returns(String) }
403
+ def truncate_words(words_count, options = {}); end
404
+
405
+ sig { returns(String) }
406
+ def underscore; end
407
+
408
+ sig { returns(String) }
409
+ def upcase_first; end
410
+ end
411
+
412
+ class ActiveSupport::ErrorReporter
413
+ sig { type_parameters(:Block, :Fallback).params(error_classes: T.class_of(Exception), severity: T.nilable(Symbol), context: T.nilable(T::Hash[Symbol, T.untyped]), fallback: T.nilable(T.proc.returns(T.type_parameter(:Fallback))), source: T.nilable(String), blk: T.proc.returns(T.type_parameter(:Block))).returns(T.any(T.type_parameter(:Block), T.type_parameter(:Fallback))) }
414
+ def handle(*error_classes, severity: T.unsafe(nil), context: T.unsafe(nil), fallback: T.unsafe(nil), source: T.unsafe(nil), &blk); end
415
+
416
+ sig { type_parameters(:Block).params(error_classes: T.class_of(Exception), severity: T.nilable(Symbol), context: T.nilable(T::Hash[Symbol, T.untyped]), source: T.nilable(String), blk: T.proc.returns(T.type_parameter(:Block))).returns(T.type_parameter(:Block)) }
417
+ def record(*error_classes, severity: T.unsafe(nil), context: T.unsafe(nil), source: T.unsafe(nil), &blk); end
418
+
419
+ sig { params(error: Exception, handled: T::Boolean, severity: T.nilable(Symbol), context: T::Hash[Symbol, T.untyped], source: T.nilable(String)).void }
420
+ def report(error, handled: true, severity: T.unsafe(nil), context: T.unsafe(nil), source: T.unsafe(nil)); end
421
+ end
@@ -0,0 +1,269 @@
1
+ # typed: true
2
+
3
+ # DO NOT EDIT MANUALLY
4
+ # This file was pulled from a central RBI files repository.
5
+ # Please run `bin/tapioca annotations` to update it.
6
+
7
+ module Rainbow
8
+ # @shim: https://github.com/sickill/rainbow/blob/master/lib/rainbow.rb#L10-L12
9
+ sig { returns(T::Boolean) }
10
+ attr_accessor :enabled
11
+
12
+ class Color
13
+ sig { returns(Symbol) }
14
+ attr_reader :ground
15
+
16
+ sig { params(ground: Symbol, values: T.any([Integer], [Integer, Integer, Integer])).returns(Color) }
17
+ def self.build(ground, values); end
18
+
19
+ sig { params(hex: String).returns([Integer, Integer, Integer]) }
20
+ def self.parse_hex_color(hex); end
21
+
22
+ class Indexed < Rainbow::Color
23
+ sig { returns(Integer) }
24
+ attr_reader :num
25
+
26
+ sig { params(ground: Symbol, num: Integer).void }
27
+ def initialize(ground, num); end
28
+
29
+ sig { returns(T::Array[Integer]) }
30
+ def codes; end
31
+ end
32
+
33
+ class Named < Rainbow::Color::Indexed
34
+ NAMES = T.let(nil, T::Hash[Symbol, Integer])
35
+
36
+ sig { params(ground: Symbol, name: Symbol).void }
37
+ def initialize(ground, name); end
38
+
39
+ sig { returns(T::Array[Symbol]) }
40
+ def self.color_names; end
41
+
42
+ sig { returns(String) }
43
+ def self.valid_names; end
44
+ end
45
+
46
+ class RGB < Rainbow::Color::Indexed
47
+ sig { returns(Integer) }
48
+ attr_reader :r, :g, :b
49
+
50
+ sig { params(ground: Symbol, values: Integer).void }
51
+ def initialize(ground, *values); end
52
+
53
+ sig { returns(T::Array[Integer]) }
54
+ def codes; end
55
+
56
+ sig { params(value: Numeric).returns(Integer) }
57
+ def self.to_ansi_domain(value); end
58
+ end
59
+
60
+ class X11Named < Rainbow::Color::RGB
61
+ include Rainbow::X11ColorNames
62
+
63
+ sig { params(ground: Symbol, name: Symbol).void }
64
+ def initialize(ground, name); end
65
+
66
+ sig { returns(T::Array[Symbol]) }
67
+ def self.color_names; end
68
+
69
+ sig { returns(String) }
70
+ def self.valid_names; end
71
+ end
72
+ end
73
+
74
+ sig { returns(Wrapper) }
75
+ def self.global; end
76
+
77
+ sig { returns(T::Boolean) }
78
+ def self.enabled; end
79
+
80
+ sig { params(value: T::Boolean).returns(T::Boolean) }
81
+ def self.enabled=(value); end
82
+
83
+ sig { params(string: String).returns(String) }
84
+ def self.uncolor(string); end
85
+
86
+ class NullPresenter < String
87
+ sig { params(values: T.any([Integer], [Integer, Integer, Integer])).returns(NullPresenter) }
88
+ def color(*values); end
89
+
90
+ sig { params(values: T.any([Integer], [Integer, Integer, Integer])).returns(NullPresenter) }
91
+ def foreground(*values); end
92
+
93
+ sig { params(values: T.any([Integer], [Integer, Integer, Integer])).returns(NullPresenter) }
94
+ def fg(*values); end
95
+
96
+ sig { params(values: T.any([Integer], [Integer, Integer, Integer])).returns(NullPresenter) }
97
+ def background(*values); end
98
+
99
+ sig { params(values: T.any([Integer], [Integer, Integer, Integer])).returns(NullPresenter) }
100
+ def bg(*values); end
101
+
102
+ sig { returns(NullPresenter) }
103
+ def reset; end
104
+
105
+ sig { returns(NullPresenter) }
106
+ def bright; end
107
+
108
+ sig { returns(NullPresenter) }
109
+ def faint; end
110
+
111
+ sig { returns(NullPresenter) }
112
+ def italic; end
113
+
114
+ sig { returns(NullPresenter) }
115
+ def underline; end
116
+
117
+ sig { returns(NullPresenter) }
118
+ def blink; end
119
+
120
+ sig { returns(NullPresenter) }
121
+ def inverse; end
122
+
123
+ sig { returns(NullPresenter) }
124
+ def hide; end
125
+
126
+ sig { returns(NullPresenter) }
127
+ def cross_out; end
128
+
129
+ sig { returns(NullPresenter) }
130
+ def black; end
131
+
132
+ sig { returns(NullPresenter) }
133
+ def red; end
134
+
135
+ sig { returns(NullPresenter) }
136
+ def green; end
137
+
138
+ sig { returns(NullPresenter) }
139
+ def yellow; end
140
+
141
+ sig { returns(NullPresenter) }
142
+ def blue; end
143
+
144
+ sig { returns(NullPresenter) }
145
+ def magenta; end
146
+
147
+ sig { returns(NullPresenter) }
148
+ def cyan; end
149
+
150
+ sig { returns(NullPresenter) }
151
+ def white; end
152
+
153
+ sig { returns(NullPresenter) }
154
+ def bold; end
155
+
156
+ sig { returns(NullPresenter) }
157
+ def dark; end
158
+
159
+ sig { returns(NullPresenter) }
160
+ def strike; end
161
+ end
162
+
163
+ class Presenter < String
164
+ TERM_EFFECTS = T.let(nil, T::Hash[Symbol, Integer])
165
+
166
+ sig { params(values: T.any([Integer], [Integer, Integer, Integer])).returns(Presenter) }
167
+ def color(*values); end
168
+
169
+ sig { params(values: T.any([Integer], [Integer, Integer, Integer])).returns(Presenter) }
170
+ def foreground(*values); end
171
+
172
+ sig { params(values: T.any([Integer], [Integer, Integer, Integer])).returns(Presenter) }
173
+ def fg(*values); end
174
+
175
+ sig { params(values: T.any([Integer], [Integer, Integer, Integer])).returns(Presenter) }
176
+ def background(*values); end
177
+
178
+ sig { params(values: T.any([Integer], [Integer, Integer, Integer])).returns(Presenter) }
179
+ def bg(*values); end
180
+
181
+ sig { returns(Presenter) }
182
+ def reset; end
183
+
184
+ sig { returns(Presenter) }
185
+ def bright; end
186
+
187
+ sig { returns(Presenter) }
188
+ def faint; end
189
+
190
+ sig { returns(Presenter) }
191
+ def italic; end
192
+
193
+ sig { returns(Presenter) }
194
+ def underline; end
195
+
196
+ sig { returns(Presenter) }
197
+ def blink; end
198
+
199
+ sig { returns(Presenter) }
200
+ def inverse; end
201
+
202
+ sig { returns(Presenter) }
203
+ def hide; end
204
+
205
+ sig { returns(Presenter) }
206
+ def cross_out; end
207
+
208
+ sig { returns(Presenter) }
209
+ def black; end
210
+
211
+ sig { returns(Presenter) }
212
+ def red; end
213
+
214
+ sig { returns(Presenter) }
215
+ def green; end
216
+
217
+ sig { returns(Presenter) }
218
+ def yellow; end
219
+
220
+ sig { returns(Presenter) }
221
+ def blue; end
222
+
223
+ sig { returns(Presenter) }
224
+ def magenta; end
225
+
226
+ sig { returns(Presenter) }
227
+ def cyan; end
228
+
229
+ sig { returns(Presenter) }
230
+ def white; end
231
+
232
+ sig { returns(Presenter) }
233
+ def bold; end
234
+
235
+ sig { returns(Presenter) }
236
+ def dark; end
237
+
238
+ sig { returns(Presenter) }
239
+ def strike; end
240
+ end
241
+
242
+ class StringUtils
243
+ sig { params(string: String, codes: T::Array[Integer]).returns(String) }
244
+ def self.wrap_with_sgr(string, codes); end
245
+
246
+ sig { params(string: String).returns(String) }
247
+ def self.uncolor(string); end
248
+ end
249
+
250
+ VERSION = T.let(nil, String)
251
+
252
+ class Wrapper
253
+ sig { returns(T::Boolean) }
254
+ attr_accessor :enabled
255
+
256
+ sig { params(enabled: T::Boolean).void }
257
+ def initialize(enabled = true); end
258
+
259
+ sig { params(string: String).returns(T.any(Rainbow::Presenter, Rainbow::NullPresenter)) }
260
+ def wrap(string); end
261
+ end
262
+
263
+ module X11ColorNames
264
+ NAMES = T.let(nil, T::Hash[Symbol, [Integer, Integer, Integer]])
265
+ end
266
+ end
267
+
268
+ sig { params(string: String).returns(Rainbow::Presenter) }
269
+ def Rainbow(string); end
@@ -0,0 +1 @@
1
+ **/*.rbi linguist-generated=true
@@ -0,0 +1,8 @@
1
+ # typed: true
2
+
3
+ # DO NOT EDIT MANUALLY
4
+ # This is an autogenerated file for types exported from the `activemodel` gem.
5
+ # Please instead update this file by running `bin/tapioca gem activemodel`.
6
+
7
+ # THIS IS AN EMPTY RBI FILE.
8
+ # see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem
@@ -0,0 +1,8 @@
1
+ # typed: true
2
+
3
+ # DO NOT EDIT MANUALLY
4
+ # This is an autogenerated file for types exported from the `activerecord` gem.
5
+ # Please instead update this file by running `bin/tapioca gem activerecord`.
6
+
7
+ # THIS IS AN EMPTY RBI FILE.
8
+ # see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem