rails_type_id 0.1.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.
Files changed (124) hide show
  1. checksums.yaml +7 -0
  2. data/.rubocop.yml +25 -0
  3. data/.ruby-version +1 -0
  4. data/README.md +46 -0
  5. data/Rakefile +16 -0
  6. data/lib/rails_type_id/concern.rb +129 -0
  7. data/lib/rails_type_id/require.rb +6 -0
  8. data/lib/rails_type_id/test_helper.rb +16 -0
  9. data/lib/rails_type_id/version.rb +6 -0
  10. data/lib/rails_type_id.rb +9 -0
  11. data/lib/tapioca/dsl/compilers/rails_type_id_compiler.rb +49 -0
  12. data/sig/rails_type_id.rbs +4 -0
  13. data/sorbet/config +4 -0
  14. data/sorbet/rbi/annotations/.gitattributes +1 -0
  15. data/sorbet/rbi/annotations/actionmailer.rbi +10 -0
  16. data/sorbet/rbi/annotations/actionpack.rbi +430 -0
  17. data/sorbet/rbi/annotations/actionview.rbi +75 -0
  18. data/sorbet/rbi/annotations/activejob.rbi +44 -0
  19. data/sorbet/rbi/annotations/activemodel.rbi +89 -0
  20. data/sorbet/rbi/annotations/activerecord.rbi +98 -0
  21. data/sorbet/rbi/annotations/activesupport.rbi +468 -0
  22. data/sorbet/rbi/annotations/globalid.rbi +30 -0
  23. data/sorbet/rbi/annotations/minitest.rbi +119 -0
  24. data/sorbet/rbi/annotations/railties.rbi +61 -0
  25. data/sorbet/rbi/annotations/rainbow.rbi +269 -0
  26. data/sorbet/rbi/dsl/.gitattributes +1 -0
  27. data/sorbet/rbi/dsl/active_model/validations/callbacks.rbi +21 -0
  28. data/sorbet/rbi/dsl/active_model/validations.rbi +26 -0
  29. data/sorbet/rbi/dsl/active_support/callbacks.rbi +21 -0
  30. data/sorbet/rbi/dsl/rails_type_id/concern.rbi +22 -0
  31. data/sorbet/rbi/gems/.gitattributes +1 -0
  32. data/sorbet/rbi/gems/actioncable@8.0.2.rbi +3133 -0
  33. data/sorbet/rbi/gems/actionmailbox@8.0.2.rbi +991 -0
  34. data/sorbet/rbi/gems/actionmailer@8.0.2.rbi +2775 -0
  35. data/sorbet/rbi/gems/actionpack@8.0.2.rbi +21167 -0
  36. data/sorbet/rbi/gems/actiontext@8.0.2.rbi +1449 -0
  37. data/sorbet/rbi/gems/actionview@8.0.2.rbi +15789 -0
  38. data/sorbet/rbi/gems/activejob@8.0.2.rbi +2864 -0
  39. data/sorbet/rbi/gems/activemodel@8.0.2.rbi +6946 -0
  40. data/sorbet/rbi/gems/activerecord@8.0.2.rbi +42458 -0
  41. data/sorbet/rbi/gems/activestorage@8.0.2.rbi +2156 -0
  42. data/sorbet/rbi/gems/activesupport@8.0.2.rbi +21274 -0
  43. data/sorbet/rbi/gems/ast@2.4.3.rbi +586 -0
  44. data/sorbet/rbi/gems/base64@0.3.0.rbi +545 -0
  45. data/sorbet/rbi/gems/benchmark@0.4.1.rbi +619 -0
  46. data/sorbet/rbi/gems/bigdecimal@3.2.2.rbi +275 -0
  47. data/sorbet/rbi/gems/builder@3.3.0.rbi +9 -0
  48. data/sorbet/rbi/gems/concurrent-ruby@1.3.5.rbi +11734 -0
  49. data/sorbet/rbi/gems/connection_pool@2.5.3.rbi +9 -0
  50. data/sorbet/rbi/gems/crass@1.0.6.rbi +623 -0
  51. data/sorbet/rbi/gems/date@3.4.1.rbi +403 -0
  52. data/sorbet/rbi/gems/drb@2.2.3.rbi +1661 -0
  53. data/sorbet/rbi/gems/erb@5.0.2.rbi +878 -0
  54. data/sorbet/rbi/gems/erubi@1.13.1.rbi +157 -0
  55. data/sorbet/rbi/gems/globalid@1.2.1.rbi +742 -0
  56. data/sorbet/rbi/gems/i18n@1.14.7.rbi +2383 -0
  57. data/sorbet/rbi/gems/io-console@0.8.1.rbi +9 -0
  58. data/sorbet/rbi/gems/json@2.12.2.rbi +2287 -0
  59. data/sorbet/rbi/gems/language_server-protocol@3.17.0.5.rbi +9 -0
  60. data/sorbet/rbi/gems/lint_roller@1.1.0.rbi +323 -0
  61. data/sorbet/rbi/gems/logger@1.7.0.rbi +963 -0
  62. data/sorbet/rbi/gems/loofah@2.24.1.rbi +1105 -0
  63. data/sorbet/rbi/gems/mail@2.8.1.rbi +8890 -0
  64. data/sorbet/rbi/gems/marcel@1.0.4.rbi +239 -0
  65. data/sorbet/rbi/gems/mini_mime@1.1.5.rbi +173 -0
  66. data/sorbet/rbi/gems/minitest@5.25.5.rbi +2231 -0
  67. data/sorbet/rbi/gems/net-imap@0.5.9.rbi +10285 -0
  68. data/sorbet/rbi/gems/net-pop@0.1.2.rbi +927 -0
  69. data/sorbet/rbi/gems/net-protocol@0.2.2.rbi +292 -0
  70. data/sorbet/rbi/gems/net-smtp@0.5.1.rbi +1240 -0
  71. data/sorbet/rbi/gems/netrc@0.11.0.rbi +177 -0
  72. data/sorbet/rbi/gems/nio4r@2.7.4.rbi +388 -0
  73. data/sorbet/rbi/gems/nokogiri@1.18.9.rbi +8548 -0
  74. data/sorbet/rbi/gems/parallel@1.27.0.rbi +291 -0
  75. data/sorbet/rbi/gems/parser@3.3.9.0.rbi +5537 -0
  76. data/sorbet/rbi/gems/pp@0.6.2.rbi +368 -0
  77. data/sorbet/rbi/gems/prettyprint@0.2.0.rbi +477 -0
  78. data/sorbet/rbi/gems/prism@1.4.0.rbi +41790 -0
  79. data/sorbet/rbi/gems/psych@5.2.6.rbi +2542 -0
  80. data/sorbet/rbi/gems/racc@1.8.1.rbi +168 -0
  81. data/sorbet/rbi/gems/rack-session@2.1.1.rbi +722 -0
  82. data/sorbet/rbi/gems/rack-test@2.2.0.rbi +729 -0
  83. data/sorbet/rbi/gems/rack@3.2.0.rbi +5054 -0
  84. data/sorbet/rbi/gems/rackup@2.2.1.rbi +230 -0
  85. data/sorbet/rbi/gems/rails-dom-testing@2.3.0.rbi +790 -0
  86. data/sorbet/rbi/gems/rails-html-sanitizer@1.6.2.rbi +645 -0
  87. data/sorbet/rbi/gems/rails@8.0.2.rbi +9 -0
  88. data/sorbet/rbi/gems/railties@8.0.2.rbi +4014 -0
  89. data/sorbet/rbi/gems/rainbow@3.1.1.rbi +403 -0
  90. data/sorbet/rbi/gems/rake@13.3.0.rbi +3039 -0
  91. data/sorbet/rbi/gems/rbi@0.3.6.rbi +5162 -0
  92. data/sorbet/rbi/gems/rbs@4.0.0.dev.4.rbi +7895 -0
  93. data/sorbet/rbi/gems/rdoc@6.14.2.rbi +12944 -0
  94. data/sorbet/rbi/gems/regexp_parser@2.10.0.rbi +3833 -0
  95. data/sorbet/rbi/gems/reline@0.6.2.rbi +9 -0
  96. data/sorbet/rbi/gems/require-hooks@0.2.2.rbi +110 -0
  97. data/sorbet/rbi/gems/rexml@3.4.1.rbi +5205 -0
  98. data/sorbet/rbi/gems/rubocop-ast@1.46.0.rbi +7473 -0
  99. data/sorbet/rbi/gems/rubocop-sorbet@0.10.5.rbi +2386 -0
  100. data/sorbet/rbi/gems/rubocop@1.79.1.rbi +63674 -0
  101. data/sorbet/rbi/gems/ruby-progressbar@1.13.0.rbi +1318 -0
  102. data/sorbet/rbi/gems/securerandom@0.4.1.rbi +75 -0
  103. data/sorbet/rbi/gems/spoom@1.7.5.rbi +5832 -0
  104. data/sorbet/rbi/gems/sqlite3@2.7.3.rbi +1989 -0
  105. data/sorbet/rbi/gems/stringio@3.1.7.rbi +9 -0
  106. data/sorbet/rbi/gems/tapioca@0.17.7.rbi +3692 -0
  107. data/sorbet/rbi/gems/thor@1.4.0.rbi +4399 -0
  108. data/sorbet/rbi/gems/timeout@0.4.3.rbi +157 -0
  109. data/sorbet/rbi/gems/typeid@0.2.2.rbi +239 -0
  110. data/sorbet/rbi/gems/tzinfo@2.0.6.rbi +5919 -0
  111. data/sorbet/rbi/gems/unicode-display_width@3.1.4.rbi +132 -0
  112. data/sorbet/rbi/gems/unicode-emoji@4.0.4.rbi +251 -0
  113. data/sorbet/rbi/gems/uri@1.0.3.rbi +2354 -0
  114. data/sorbet/rbi/gems/useragent@0.16.11.rbi +9 -0
  115. data/sorbet/rbi/gems/uuid7@0.2.0.rbi +60 -0
  116. data/sorbet/rbi/gems/websocket-driver@0.8.0.rbi +1065 -0
  117. data/sorbet/rbi/gems/websocket-extensions@0.1.5.rbi +117 -0
  118. data/sorbet/rbi/gems/with_model@2.2.0.rbi +282 -0
  119. data/sorbet/rbi/gems/yard-sorbet@0.9.0.rbi +430 -0
  120. data/sorbet/rbi/gems/yard@0.9.37.rbi +18512 -0
  121. data/sorbet/rbi/gems/zeitwerk@2.7.3.rbi +1196 -0
  122. data/sorbet/tapioca/config.yml +13 -0
  123. data/sorbet/tapioca/require.rb +13 -0
  124. metadata +208 -0
@@ -0,0 +1,98 @@
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
+ class ActiveRecord::Schema
8
+ sig { params(info: T::Hash[T.untyped, T.untyped], blk: T.proc.bind(ActiveRecord::Schema).void).void }
9
+ def self.define(info = nil, &blk); end
10
+ end
11
+
12
+ class ActiveRecord::Migration
13
+ # @shim: Methods on migration are delegated to `SchemaStatements` using `method_missing`
14
+ include ActiveRecord::ConnectionAdapters::SchemaStatements
15
+
16
+ # @shim: Methods on migration are delegated to `DatabaseStatements` using `method_missing`
17
+ include ActiveRecord::ConnectionAdapters::DatabaseStatements
18
+ end
19
+
20
+ class ActiveRecord::Base
21
+ sig { returns(FalseClass) }
22
+ def blank?; end
23
+
24
+ # @shim: since `present?` is always true, `presence` always returns `self`
25
+ sig { returns(T.self_type) }
26
+ def presence; end
27
+
28
+ sig { returns(TrueClass) }
29
+ def present?; end
30
+
31
+ sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void }
32
+ def self.after_initialize(*args, **options, &block); end
33
+
34
+ sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void }
35
+ def self.after_find(*args, **options, &block); end
36
+
37
+ sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void }
38
+ def self.after_touch(*args, **options, &block); end
39
+
40
+ sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void }
41
+ def self.before_validation(*args, **options, &block); end
42
+
43
+ sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void }
44
+ def self.after_validation(*args, **options, &block); end
45
+
46
+ sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void }
47
+ def self.before_save(*args, **options, &block); end
48
+
49
+ sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void }
50
+ def self.around_save(*args, **options, &block); end
51
+
52
+ sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void }
53
+ def self.after_save(*args, **options, &block); end
54
+
55
+ sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void }
56
+ def self.before_create(*args, **options, &block); end
57
+
58
+ sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void }
59
+ def self.around_create(*args, **options, &block); end
60
+
61
+ sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void }
62
+ def self.after_create(*args, **options, &block); end
63
+
64
+ sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void }
65
+ def self.before_update(*args, **options, &block); end
66
+
67
+ sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void }
68
+ def self.around_update(*args, **options, &block); end
69
+
70
+ sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void }
71
+ def self.after_update(*args, **options, &block); end
72
+
73
+ sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void }
74
+ def self.before_destroy(*args, **options, &block); end
75
+
76
+ sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void }
77
+ def self.around_destroy(*args, **options, &block); end
78
+
79
+ sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void }
80
+ def self.after_destroy(*args, **options, &block); end
81
+
82
+ sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void }
83
+ def self.after_commit(*args, **options, &block); end
84
+
85
+ sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void }
86
+ def self.after_rollback(*args, **options, &block); end
87
+ end
88
+
89
+ class ActiveRecord::Relation
90
+ Elem = type_member(:out) { { fixed: T.untyped } }
91
+
92
+ sig { returns(T::Boolean) }
93
+ def blank?; end
94
+
95
+ sig { abstract.params(blk: T.proc.params(arg0: Elem).returns(BasicObject)).returns(T.untyped) }
96
+ sig { abstract.returns(T::Enumerator[Elem]) }
97
+ def each(&blk); end
98
+ end
@@ -0,0 +1,468 @@
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 blank?; end
85
+
86
+ sig { returns(T::Boolean) }
87
+ def present?; end
88
+
89
+ sig { returns(T::Boolean) }
90
+ def extractable_options?; end
91
+ end
92
+
93
+ class Array
94
+ sig { returns(T::Boolean) }
95
+ def blank?; end
96
+
97
+ sig { returns(T::Boolean) }
98
+ def present?; end
99
+
100
+ sig { params(position: Integer).returns(T.self_type) }
101
+ def from(position); end
102
+
103
+ sig { params(position: Integer).returns(T.self_type) }
104
+ def to(position); end
105
+
106
+ sig { params(elements: T.untyped).returns(T::Array[T.untyped]) }
107
+ def including(*elements); end
108
+
109
+ sig { params(elements: T.untyped).returns(T.self_type) }
110
+ def excluding(*elements); end
111
+
112
+ sig { params(elements: T.untyped).returns(T.self_type) }
113
+ def without(*elements); end
114
+
115
+ sig { returns(T.nilable(Elem)) }
116
+ def second; end
117
+
118
+ sig { returns(T.nilable(Elem)) }
119
+ def third; end
120
+
121
+ sig { returns(T.nilable(Elem)) }
122
+ def fourth; end
123
+
124
+ sig { returns(T.nilable(Elem)) }
125
+ def fifth; end
126
+
127
+ sig { returns(T.nilable(Elem)) }
128
+ def forty_two; end
129
+
130
+ sig { returns(T.nilable(Elem)) }
131
+ def third_to_last; end
132
+
133
+ sig { returns(T.nilable(Elem)) }
134
+ def second_to_last; end
135
+
136
+ sig { params(options: T::Hash[T.untyped, T.untyped]).returns(String) }
137
+ def to_sentence(options = {}); end
138
+
139
+ sig { params(format: Symbol).returns(String) }
140
+ def to_fs(format = :default); end
141
+
142
+ sig { params(format: Symbol).returns(String) }
143
+ def to_formatted_s(format = :default); end
144
+
145
+ sig { returns(String) }
146
+ def to_xml; end
147
+
148
+ sig { returns(T::Hash[T.untyped, T.untyped]) }
149
+ def extract_options!; end
150
+
151
+ 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))]]) }
152
+ def in_groups(number, fill_with = T.unsafe(nil), &block); end
153
+
154
+ 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))]]) }
155
+ def in_groups_of(number, fill_with = T.unsafe(nil), &block); end
156
+
157
+ sig { params(value: T.untyped, block: T.nilable(T.proc.params(element: Elem).returns(T.untyped))).returns(T::Array[T::Array[Elem]]) }
158
+ def split(value = nil, &block); end
159
+
160
+ sig { params(block: T.nilable(T.proc.params(element: Elem).returns(T.untyped))).returns(T.any(T::Array[Elem], T::Enumerator[Elem])) }
161
+ def extract!(&block); end
162
+
163
+ sig { returns(ActiveSupport::ArrayInquirer) }
164
+ def inquiry; end
165
+
166
+ sig { params(object: T.untyped).returns(T::Array[T.untyped]) }
167
+ def self.wrap(object); end
168
+ end
169
+
170
+ class Date
171
+ sig { returns(FalseClass) }
172
+ def blank?; end
173
+
174
+ # @shim: since `present?` is always true, `presence` always returns `self`
175
+ sig { returns(T.self_type) }
176
+ def presence; end
177
+
178
+ # @shim: since `blank?` is always false, `present?` always returns `true`
179
+ sig { returns(TrueClass) }
180
+ def present?; end
181
+ end
182
+
183
+ class DateTime
184
+ sig { returns(FalseClass) }
185
+ def blank?; end
186
+
187
+ # @shim: since `present?` is always true, `presence` always returns `self`
188
+ sig { returns(T.self_type) }
189
+ def presence; end
190
+
191
+ # @shim: since `blank?` is always false, `present?` always returns `true`
192
+ sig { returns(TrueClass) }
193
+ def present?; end
194
+ end
195
+
196
+ module Enumerable
197
+ # @version >= 7.0.0
198
+ sig { returns(Elem) }
199
+ def sole; end
200
+ end
201
+
202
+ class NilClass
203
+ sig { returns(TrueClass) }
204
+ def blank?; end
205
+
206
+ # @shim: since `present?` is always false, `presence` always returns `nil`
207
+ sig { returns(NilClass) }
208
+ def presence; end
209
+
210
+ # @shim: since `blank?` is always true, `present?` always returns `false`
211
+ sig { returns(FalseClass) }
212
+ def present?; end
213
+ end
214
+
215
+ class FalseClass
216
+ sig { returns(TrueClass) }
217
+ def blank?; end
218
+
219
+ # @shim: since `present?` is always false, `presence` always returns `nil`
220
+ sig { returns(NilClass) }
221
+ def presence; end
222
+
223
+ # @shim: since `blank?` is always true, `present?` always returns `false`
224
+ sig { returns(FalseClass) }
225
+ def present?; end
226
+ end
227
+
228
+ class TrueClass
229
+ sig { returns(FalseClass) }
230
+ def blank?; end
231
+
232
+ # @shim: since `present?` is always true, `presence` always returns `self`
233
+ sig { returns(T.self_type) }
234
+ def presence; end
235
+
236
+ # @shim: since `blank?` is always false, `present?` always returns `true`
237
+ sig { returns(TrueClass) }
238
+ def present?; end
239
+ end
240
+
241
+ class Numeric
242
+ sig { returns(FalseClass) }
243
+ def blank?; end
244
+
245
+ sig { returns(TrueClass) }
246
+ def html_safe?; end
247
+
248
+ # @shim: since `present?` is always true, `presence` always returns `self`
249
+ sig { returns(T.self_type) }
250
+ def presence; end
251
+
252
+ # @shim: since `blank?` is always false, `present?` always returns `true`
253
+ sig { returns(TrueClass) }
254
+ def present?; end
255
+ end
256
+
257
+ class Time
258
+ sig { returns(FalseClass) }
259
+ def blank?; end
260
+
261
+ # @shim: since `present?` is always true, `presence` always returns `self`
262
+ sig { returns(T.self_type) }
263
+ def presence; end
264
+
265
+ # @shim: since `blank?` is always false, `present?` always returns `true`
266
+ sig { returns(TrueClass) }
267
+ def present?; end
268
+
269
+ sig { returns(ActiveSupport::TimeZone) }
270
+ def self.zone; end
271
+
272
+ sig { returns(T.any(ActiveSupport::TimeWithZone, ::Time)) }
273
+ def self.current; end
274
+ end
275
+
276
+ class Symbol
277
+ sig { returns(T::Boolean) }
278
+ def blank?; end
279
+
280
+ sig { returns(T::Boolean) }
281
+ def present?; end
282
+
283
+ # alias for `#start_with?`
284
+ sig { params(string_or_regexp: T.any(String, Regexp)).returns(T::Boolean) }
285
+ def starts_with?(*string_or_regexp); end
286
+
287
+ # alias for `#end_with?`
288
+ sig { params(string_or_regexp: T.any(String, Regexp)).returns(T::Boolean) }
289
+ def ends_with?(*string_or_regexp); end
290
+ end
291
+
292
+ class String
293
+ sig { returns(TrueClass) }
294
+ def acts_like_string?; end
295
+
296
+ # This is the subset of `#[]` sigs that have just 1 parameter.
297
+ # https://github.com/sorbet/sorbet/blob/40ad87b4dc7be23fa00c1369ac9f927053c68907/rbi/core/string.rbi#L270-L303
298
+ sig { params(position: Integer).returns(T.nilable(String)) }
299
+ sig { params(position: T.any(T::Range[Integer], Regexp)).returns(T.nilable(String)) }
300
+ sig { params(position: String).returns(T.nilable(String)) }
301
+ def at(position); end
302
+
303
+ sig { returns(String) }
304
+ def as_json; end
305
+
306
+ sig { returns(T::Boolean) }
307
+ def blank?; end
308
+
309
+ sig { params(first_letter: Symbol).returns(String) }
310
+ def camelcase(first_letter = :upper); end
311
+
312
+ sig { params(first_letter: Symbol).returns(String) }
313
+ def camelize(first_letter = :upper); end
314
+
315
+ sig { returns(String) }
316
+ def classify; end
317
+
318
+ sig { returns(T.untyped) }
319
+ def constantize; end
320
+
321
+ sig { returns(String) }
322
+ def dasherize; end
323
+
324
+ sig { returns(String) }
325
+ def deconstantize; end
326
+
327
+ sig { returns(String) }
328
+ def demodulize; end
329
+
330
+ # alias for `#end_with?`
331
+ sig { params(string_or_regexp: T.any(String, Regexp)).returns(T::Boolean) }
332
+ def ends_with?(*string_or_regexp); end
333
+
334
+ sig { returns(String) }
335
+ def downcase_first; end
336
+
337
+ sig { params(string: String).returns(T::Boolean) }
338
+ def exclude?(string); end
339
+
340
+ sig { params(limit: Integer).returns(String) }
341
+ def first(limit = 1); end
342
+
343
+ sig { params(separate_class_name_and_id_with_underscore: T::Boolean).returns(String) }
344
+ def foreign_key(separate_class_name_and_id_with_underscore = true); end
345
+
346
+ sig { params(position: Integer).returns(String) }
347
+ def from(position); end
348
+
349
+ sig { returns(ActiveSupport::SafeBuffer) }
350
+ def html_safe; end
351
+
352
+ sig { params(capitalize: T::Boolean, keep_id_suffix: T::Boolean).returns(String) }
353
+ def humanize(capitalize: true, keep_id_suffix: false); end
354
+
355
+ sig { params(zone: T.nilable(T.any(ActiveSupport::TimeZone, String))).returns(T.any(ActiveSupport::TimeWithZone, Time)) }
356
+ def in_time_zone(zone = ::Time.zone); end
357
+
358
+ sig { params(amount: Integer, indent_string: T.nilable(String), indent_empty_lines: T::Boolean).returns(String) }
359
+ def indent(amount, indent_string = nil, indent_empty_lines = false); end
360
+
361
+ sig { params(amount: Integer, indent_string: T.nilable(String), indent_empty_lines: T::Boolean).returns(T.nilable(String)) }
362
+ def indent!(amount, indent_string = nil, indent_empty_lines = false); end
363
+
364
+ sig { returns(ActiveSupport::StringInquirer) }
365
+ def inquiry; end
366
+
367
+ sig { returns(T::Boolean) }
368
+ def is_utf8?; end
369
+
370
+ sig { params(limit: Integer).returns(String) }
371
+ def last(limit = 1); end
372
+
373
+ sig { returns(ActiveSupport::Multibyte::Chars) }
374
+ def mb_chars; end
375
+
376
+ sig { params(separator: String, preserve_case: T::Boolean, locale: T.nilable(Symbol)).returns(String) }
377
+ def parameterize(separator: "-", preserve_case: false, locale: nil); end
378
+
379
+ sig { params(count: T.nilable(T.any(Integer, Symbol)), locale: T.nilable(Symbol)).returns(String) }
380
+ def pluralize(count = nil, locale = :en); end
381
+
382
+ sig { returns(T::Boolean) }
383
+ def present?; end
384
+
385
+ sig { params(patterns: T.any(String, Regexp)).returns(String) }
386
+ def remove(*patterns); end
387
+
388
+ sig { params(patterns: T.any(String, Regexp)).returns(String) }
389
+ def remove!(*patterns); end
390
+
391
+ sig { returns(T.untyped) }
392
+ def safe_constantize; end
393
+
394
+ sig { params(locale: Symbol).returns(String) }
395
+ def singularize(locale = :en); end
396
+
397
+ sig { returns(String) }
398
+ def squish; end
399
+
400
+ sig { returns(String) }
401
+ def squish!; end
402
+
403
+ # alias for `#start_with?`
404
+ sig { params(string_or_regexp: T.any(String, Regexp)).returns(T::Boolean) }
405
+ def starts_with?(*string_or_regexp); end
406
+
407
+ sig { returns(String) }
408
+ def strip_heredoc; end
409
+
410
+ sig { returns(String) }
411
+ def tableize; end
412
+
413
+ sig { params(keep_id_suffix: T::Boolean).returns(String) }
414
+ def titlecase(keep_id_suffix: false); end
415
+
416
+ sig { params(keep_id_suffix: T::Boolean).returns(String) }
417
+ def titleize(keep_id_suffix: false); end
418
+
419
+ sig { params(position: Integer).returns(String) }
420
+ def to(position); end
421
+
422
+ sig { returns(::Date) }
423
+ def to_date; end
424
+
425
+ sig { returns(::DateTime) }
426
+ def to_datetime; end
427
+
428
+ sig { params(form: T.nilable(Symbol)).returns(T.nilable(Time)) }
429
+ def to_time(form = :local); end
430
+
431
+ sig { params(truncate_to: Integer, options: T::Hash[Symbol, T.anything]).returns(String) }
432
+ def truncate(truncate_to, options = {}); end
433
+
434
+ sig { params(truncate_to: Integer, omission: T.nilable(String)).returns(String) }
435
+ def truncate_bytes(truncate_to, omission: "…"); end
436
+
437
+ sig { params(words_count: Integer, options: T::Hash[Symbol, T.anything]).returns(String) }
438
+ def truncate_words(words_count, options = {}); end
439
+
440
+ sig { returns(String) }
441
+ def underscore; end
442
+
443
+ sig { returns(String) }
444
+ def upcase_first; end
445
+ end
446
+
447
+ class ActiveSupport::ErrorReporter
448
+ # @version >= 7.1.0.beta1
449
+ 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))) }
450
+ def handle(*error_classes, severity: T.unsafe(nil), context: T.unsafe(nil), fallback: T.unsafe(nil), source: T.unsafe(nil), &blk); end
451
+
452
+ # @version >= 7.1.0.beta1
453
+ 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)) }
454
+ def record(*error_classes, severity: T.unsafe(nil), context: T.unsafe(nil), source: T.unsafe(nil), &blk); end
455
+
456
+ # @version >= 7.1.0.beta1
457
+ sig { params(error: Exception, handled: T::Boolean, severity: T.nilable(Symbol), context: T::Hash[Symbol, T.untyped], source: T.nilable(String)).void }
458
+ def report(error, handled: true, severity: T.unsafe(nil), context: T.unsafe(nil), source: T.unsafe(nil)); end
459
+
460
+ # @version >= 7.2.0.beta1
461
+ sig { params(error: T.any(Exception, String), severity: T.nilable(Symbol), context: T::Hash[Symbol, T.untyped], source: T.nilable(String)).void }
462
+ def unexpected(error, severity: T.unsafe(nil), context: T.unsafe(nil), source: T.unsafe(nil)); end
463
+ end
464
+
465
+ module ActiveSupport::Testing::Assertions
466
+ sig { type_parameters(:Block).params(block: T.proc.returns(T.type_parameter(:Block))).returns(T.type_parameter(:Block)) }
467
+ def assert_nothing_raised(&block); end
468
+ end
@@ -0,0 +1,30 @@
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
+ class ActiveRecord::Base
8
+ # @shim: this is included at runtime https://github.com/rails/globalid/blob/v1.0.0/lib/global_id/railtie.rb#L38
9
+ include GlobalID::Identification
10
+ end
11
+
12
+ module GlobalID::Identification
13
+ sig { params(options: T::Hash[T.untyped, T.untyped]).returns(GlobalID) }
14
+ def to_gid(options = {}); end
15
+
16
+ sig { params(options: T::Hash[T.untyped, T.untyped]).returns(String) }
17
+ def to_gid_param(options = {}); end
18
+
19
+ sig { params(options: T::Hash[T.untyped, T.untyped]).returns(GlobalID) }
20
+ def to_global_id(options = {}); end
21
+
22
+ sig { params(options: T::Hash[T.untyped, T.untyped]).returns(SignedGlobalID) }
23
+ def to_sgid(options = {}); end
24
+
25
+ sig { params(options: T::Hash[T.untyped, T.untyped]).returns(String) }
26
+ def to_sgid_param(options = {}); end
27
+
28
+ sig { params(options: T::Hash[T.untyped, T.untyped]).returns(SignedGlobalID) }
29
+ def to_signed_global_id(options = {}); end
30
+ end