sorbet-rails 0.7.1 → 0.7.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +9 -7
  3. data/lib/sorbet-rails/active_record_rbi_formatter.rb +2 -2
  4. data/lib/sorbet-rails/helper_rbi_formatter.rb +1 -1
  5. data/lib/sorbet-rails/job_rbi_formatter.rb +4 -2
  6. data/lib/sorbet-rails/mailer_rbi_formatter.rb +3 -3
  7. data/lib/sorbet-rails/model_plugins/active_record_assoc.rb +1 -1
  8. data/lib/sorbet-rails/model_plugins/active_record_attribute.rb +10 -10
  9. data/lib/sorbet-rails/routes_rbi_formatter.rb +2 -2
  10. data/sorbet-rails.gemspec +2 -2
  11. data/spec/generators/sorbet_test_cases.rb +4 -2
  12. data/spec/sorbet_spec.rb +6 -6
  13. data/spec/support/v5.0/Gemfile.lock +8 -7
  14. data/spec/support/v5.0/sorbet_test_cases.rb +4 -2
  15. data/spec/support/v5.1/Gemfile.lock +8 -7
  16. data/spec/support/v5.1/sorbet_test_cases.rb +4 -2
  17. data/spec/support/v5.2/Gemfile.lock +8 -7
  18. data/spec/support/v5.2/sorbet_test_cases.rb +4 -2
  19. data/spec/support/v6.0/Gemfile.lock +8 -7
  20. data/spec/support/v6.0/sorbet_test_cases.rb +4 -2
  21. data/spec/test_data/v5.0/expected_application_job.rbi +2 -2
  22. data/spec/test_data/v5.0/expected_award_house_point_hourglasses.rbi +2 -2
  23. data/spec/test_data/v5.0/expected_custom_application_job.rbi +2 -2
  24. data/spec/test_data/v5.0/expected_custom_award_house_point_hourglasses.rbi +2 -2
  25. data/spec/test_data/v5.0/expected_spell_book.rbi +9 -9
  26. data/spec/test_data/v5.0/expected_wand.rbi +10 -10
  27. data/spec/test_data/v5.0/expected_wizard.rbi +58 -58
  28. data/spec/test_data/v5.0/expected_wizard_wo_spellbook.rbi +58 -58
  29. data/spec/test_data/v5.1/expected_application_job.rbi +2 -2
  30. data/spec/test_data/v5.1/expected_award_house_point_hourglasses.rbi +2 -2
  31. data/spec/test_data/v5.1/expected_custom_application_job.rbi +2 -2
  32. data/spec/test_data/v5.1/expected_custom_award_house_point_hourglasses.rbi +2 -2
  33. data/spec/test_data/v5.1/expected_spell_book.rbi +9 -9
  34. data/spec/test_data/v5.1/expected_wand.rbi +10 -10
  35. data/spec/test_data/v5.1/expected_wizard.rbi +58 -58
  36. data/spec/test_data/v5.1/expected_wizard_wo_spellbook.rbi +58 -58
  37. data/spec/test_data/v5.2/expected_application_job.rbi +2 -2
  38. data/spec/test_data/v5.2/expected_award_house_point_hourglasses.rbi +2 -2
  39. data/spec/test_data/v5.2/expected_custom_application_job.rbi +2 -2
  40. data/spec/test_data/v5.2/expected_custom_award_house_point_hourglasses.rbi +2 -2
  41. data/spec/test_data/v5.2/expected_spell_book.rbi +9 -9
  42. data/spec/test_data/v5.2/expected_wand.rbi +10 -10
  43. data/spec/test_data/v5.2/expected_wizard.rbi +58 -58
  44. data/spec/test_data/v5.2/expected_wizard_wo_spellbook.rbi +58 -58
  45. data/spec/test_data/v6.0/expected_application_job.rbi +2 -2
  46. data/spec/test_data/v6.0/expected_award_house_point_hourglasses.rbi +2 -2
  47. data/spec/test_data/v6.0/expected_custom_application_job.rbi +2 -2
  48. data/spec/test_data/v6.0/expected_custom_award_house_point_hourglasses.rbi +2 -2
  49. data/spec/test_data/v6.0/expected_spell_book.rbi +9 -9
  50. data/spec/test_data/v6.0/expected_wand.rbi +10 -10
  51. data/spec/test_data/v6.0/expected_wizard.rbi +58 -58
  52. data/spec/test_data/v6.0/expected_wizard_wo_spellbook.rbi +58 -58
  53. metadata +5 -5
@@ -1,9 +1,9 @@
1
1
  PATH
2
2
  remote: ../../..
3
3
  specs:
4
- sorbet-rails (0.7.1)
4
+ sorbet-rails (0.7.2)
5
5
  method_source (>= 0.9.2)
6
- parlour (~> 2.0)
6
+ parlour (>= 4.0.1)
7
7
  parser (>= 2.7)
8
8
  sorbet-coerce (>= 0.2.6)
9
9
  sorbet-runtime (>= 0.5)
@@ -97,14 +97,14 @@ GEM
97
97
  nio4r (2.5.2)
98
98
  nokogiri (1.10.10)
99
99
  mini_portile2 (~> 2.4.0)
100
- parlour (2.1.0)
100
+ parlour (4.0.1)
101
101
  commander (~> 4.5)
102
102
  parser
103
103
  rainbow (~> 3.0)
104
104
  sorbet-runtime (>= 0.5)
105
- parser (2.7.1.4)
105
+ parser (2.7.2.0)
106
106
  ast (~> 2.4.1)
107
- polyfill (1.8.0)
107
+ polyfill (1.9.0)
108
108
  puma (4.3.5)
109
109
  nio4r (~> 2.0)
110
110
  rack (2.2.3)
@@ -147,7 +147,7 @@ GEM
147
147
  sorbet (>= 0.4.4704)
148
148
  sorbet-runtime (>= 0.4.4704)
149
149
  sorbet-runtime (0.5.5815)
150
- sorbet-static (0.5.5815-universal-darwin-14)
150
+ sorbet-static (0.5.5815-universal-darwin-19)
151
151
  sprockets (4.0.2)
152
152
  concurrent-ruby (~> 1.0)
153
153
  rack (> 1, < 3)
@@ -172,6 +172,7 @@ GEM
172
172
 
173
173
  PLATFORMS
174
174
  ruby
175
+ x86_64-darwin-19
175
176
 
176
177
  DEPENDENCIES
177
178
  byebug
@@ -189,4 +190,4 @@ RUBY VERSION
189
190
  ruby 2.5.5p157
190
191
 
191
192
  BUNDLED WITH
192
- 2.0.2
193
+ 2.2.0
@@ -312,7 +312,10 @@ T.assert_type!(Wand.mythicals, T::Array[Wand])
312
312
  T.assert_type!(HogwartsAcceptanceMailer.notify(wizard), ActionMailer::MessageDelivery)
313
313
 
314
314
  # Jobs
315
- AwardHousePointHourglasses.perform_later(student: wizard, point: 10)
315
+ T.assert_type!(
316
+ AwardHousePointHourglasses.perform_later(student: wizard, point: 10),
317
+ AwardHousePointHourglasses
318
+ )
316
319
  AwardHousePointHourglasses.perform_now(student: wizard, point: 10)
317
320
  AwardHousePointHourglasses.
318
321
  set(queue: :daily, wait: 5.minutes).
@@ -321,7 +324,6 @@ AwardHousePointHourglasses.
321
324
  set(priority: 10, wait_until: Time.now.tomorrow).
322
325
  perform_later(student: wizard, point: 10)
323
326
 
324
-
325
327
  T.assert_type!(wizard.broom_nimbus?, T::Boolean)
326
328
  T.assert_type!(wizard.color_brown_eyes?, T::Boolean)
327
329
  T.assert_type!(wizard.quidditch_keeper?, T::Boolean)
@@ -2,10 +2,10 @@
2
2
  # This is an autogenerated file for Rails' jobs.
3
3
  # Please rerun bundle exec rake rails_rbi:jobs to regenerate.
4
4
  class ApplicationJob
5
- sig { params(_: T.untyped).void }
5
+ sig { params(_: T.untyped).returns(ApplicationJob) }
6
6
  def self.perform_later(*_); end
7
7
 
8
- sig { params(_: T.untyped).void }
8
+ sig { params(_: T.untyped).returns(ApplicationJob) }
9
9
  def self.perform_now(*_); end
10
10
 
11
11
  sig do
@@ -2,10 +2,10 @@
2
2
  # This is an autogenerated file for Rails' jobs.
3
3
  # Please rerun bundle exec rake rails_rbi:jobs to regenerate.
4
4
  class AwardHousePointHourglasses
5
- sig { params(student: Wizard, point: Integer).void }
5
+ sig { params(student: Wizard, point: Integer).returns(AwardHousePointHourglasses) }
6
6
  def self.perform_later(student:, point:); end
7
7
 
8
- sig { params(student: Wizard, point: Integer).void }
8
+ sig { params(student: Wizard, point: Integer).returns(AwardHousePointHourglasses) }
9
9
  def self.perform_now(student:, point:); end
10
10
 
11
11
  sig do
@@ -3,10 +3,10 @@
3
3
  # This is an autogenerated file for Rails' jobs.
4
4
  # Please rerun bundle exec rake rails_rbi:jobs to regenerate.
5
5
  class ApplicationJob
6
- sig { params(_: T.untyped).void }
6
+ sig { params(_: T.untyped).returns(ApplicationJob) }
7
7
  def self.perform_later(*_); end
8
8
 
9
- sig { params(_: T.untyped).void }
9
+ sig { params(_: T.untyped).returns(ApplicationJob) }
10
10
  def self.perform_now(*_); end
11
11
 
12
12
  sig do
@@ -3,10 +3,10 @@
3
3
  # This is an autogenerated file for Rails' jobs.
4
4
  # Please rerun bundle exec rake rails_rbi:jobs to regenerate.
5
5
  class AwardHousePointHourglasses
6
- sig { params(student: Wizard, point: Integer).void }
6
+ sig { params(student: Wizard, point: Integer).returns(AwardHousePointHourglasses) }
7
7
  def self.perform_later(student:, point:); end
8
8
 
9
- sig { params(student: Wizard, point: Integer).void }
9
+ sig { params(student: Wizard, point: Integer).returns(AwardHousePointHourglasses) }
10
10
  def self.perform_now(student:, point:); end
11
11
 
12
12
  sig do
@@ -65,15 +65,6 @@ module SpellBook::GeneratedAttributeMethods
65
65
  def wizard_id?; end
66
66
  end
67
67
 
68
- class SpellBook::BookType < T::Enum
69
- enums do
70
- Unclassified = new(%q{unclassified})
71
- Biology = new(%q{biology})
72
- DarkArt = new(%q{dark_art})
73
- end
74
-
75
- end
76
-
77
68
  module SpellBook::GeneratedAssociationMethods
78
69
  sig { returns(::Spell::ActiveRecord_Associations_CollectionProxy) }
79
70
  def spells; end
@@ -145,6 +136,15 @@ class SpellBook < ApplicationRecord
145
136
 
146
137
  sig { params(value: SpellBook::BookType).void }
147
138
  def typed_book_type=(value); end
139
+
140
+ class BookType < T::Enum
141
+ enums do
142
+ Unclassified = new(%q{unclassified})
143
+ Biology = new(%q{biology})
144
+ DarkArt = new(%q{dark_art})
145
+ end
146
+
147
+ end
148
148
  end
149
149
 
150
150
  class SpellBook::ActiveRecord_Relation < ActiveRecord::Relation
@@ -152,16 +152,6 @@ module Wand::GeneratedAttributeMethods
152
152
  def wood_type?; end
153
153
  end
154
154
 
155
- class Wand::CoreType < T::Enum
156
- enums do
157
- PhoenixFeather = new(%q{phoenix_feather})
158
- DragonHeartstring = new(%q{dragon_heartstring})
159
- UnicornTailHair = new(%q{unicorn_tail_hair})
160
- BasiliskHorn = new(%q{basilisk_horn})
161
- end
162
-
163
- end
164
-
165
155
  module Wand::GeneratedAssociationMethods
166
156
  sig { returns(::Wizard) }
167
157
  def wizard; end
@@ -225,6 +215,16 @@ class Wand < ApplicationRecord
225
215
  sig { params(value: T.nilable(Wand::CoreType)).void }
226
216
  def typed_core_type=(value); end
227
217
 
218
+ class CoreType < T::Enum
219
+ enums do
220
+ PhoenixFeather = new(%q{phoenix_feather})
221
+ DragonHeartstring = new(%q{dragon_heartstring})
222
+ UnicornTailHair = new(%q{unicorn_tail_hair})
223
+ BasiliskHorn = new(%q{basilisk_horn})
224
+ end
225
+
226
+ end
227
+
228
228
  sig { returns(T::Array[Wand]) }
229
229
  def self.mythicals; end
230
230
  end
@@ -230,64 +230,6 @@ module Wizard::GeneratedAttributeMethods
230
230
  def updated_at?; end
231
231
  end
232
232
 
233
- class Wizard::Broom < T::Enum
234
- enums do
235
- Nimbus = new(%q{nimbus})
236
- Firebolt = new(%q{firebolt})
237
- end
238
-
239
- end
240
-
241
- class Wizard::EyeColor < T::Enum
242
- enums do
243
- Brown = new(%q{brown})
244
- Green = new(%q{green})
245
- Blue = new(%q{blue})
246
- end
247
-
248
- end
249
-
250
- class Wizard::HairColor < T::Enum
251
- enums do
252
- Brown = new(%q{brown})
253
- Black = new(%q{black})
254
- Blonde = new(%q{blonde})
255
- end
256
-
257
- end
258
-
259
- class Wizard::House < T::Enum
260
- enums do
261
- Gryffindor = new(%q{Gryffindor})
262
- Hufflepuff = new(%q{Hufflepuff})
263
- Ravenclaw = new(%q{Ravenclaw})
264
- Slytherin = new(%q{Slytherin})
265
- end
266
-
267
- end
268
-
269
- class Wizard::ProfessorEnum < T::Enum
270
- enums do
271
- SeverusSnape = new(%q{Severus Snape})
272
- MinervaMcGonagall = new(%q{Minerva McGonagall})
273
- PomonaSprout = new(%q{Pomona Sprout})
274
- FiliusFlitwick = new(%q{Filius Flitwick})
275
- Hagrid = new(%q{Hagrid})
276
- AlastorMadEyeMoody = new(%q{Alastor 'Mad-Eye' Moody})
277
- end
278
-
279
- end
280
-
281
- class Wizard::QuidditchPosition < T::Enum
282
- enums do
283
- Keeper = new(%q{keeper})
284
- Seeker = new(%q{seeker})
285
- Beater = new(%q{beater})
286
- Chaser = new(%q{chaser})
287
- end
288
-
289
- end
290
-
291
233
  module Wizard::GeneratedAssociationMethods
292
234
  sig { returns(T.nilable(::School)) }
293
235
  def school; end
@@ -470,6 +412,64 @@ class Wizard < ApplicationRecord
470
412
 
471
413
  sig { params(value: T.nilable(Wizard::QuidditchPosition)).void }
472
414
  def typed_quidditch_position=(value); end
415
+
416
+ class Broom < T::Enum
417
+ enums do
418
+ Nimbus = new(%q{nimbus})
419
+ Firebolt = new(%q{firebolt})
420
+ end
421
+
422
+ end
423
+
424
+ class EyeColor < T::Enum
425
+ enums do
426
+ Brown = new(%q{brown})
427
+ Green = new(%q{green})
428
+ Blue = new(%q{blue})
429
+ end
430
+
431
+ end
432
+
433
+ class HairColor < T::Enum
434
+ enums do
435
+ Brown = new(%q{brown})
436
+ Black = new(%q{black})
437
+ Blonde = new(%q{blonde})
438
+ end
439
+
440
+ end
441
+
442
+ class House < T::Enum
443
+ enums do
444
+ Gryffindor = new(%q{Gryffindor})
445
+ Hufflepuff = new(%q{Hufflepuff})
446
+ Ravenclaw = new(%q{Ravenclaw})
447
+ Slytherin = new(%q{Slytherin})
448
+ end
449
+
450
+ end
451
+
452
+ class ProfessorEnum < T::Enum
453
+ enums do
454
+ SeverusSnape = new(%q{Severus Snape})
455
+ MinervaMcGonagall = new(%q{Minerva McGonagall})
456
+ PomonaSprout = new(%q{Pomona Sprout})
457
+ FiliusFlitwick = new(%q{Filius Flitwick})
458
+ Hagrid = new(%q{Hagrid})
459
+ AlastorMadEyeMoody = new(%q{Alastor 'Mad-Eye' Moody})
460
+ end
461
+
462
+ end
463
+
464
+ class QuidditchPosition < T::Enum
465
+ enums do
466
+ Keeper = new(%q{keeper})
467
+ Seeker = new(%q{seeker})
468
+ Beater = new(%q{beater})
469
+ Chaser = new(%q{chaser})
470
+ end
471
+
472
+ end
473
473
  end
474
474
 
475
475
  class Wizard::ActiveRecord_Relation < ActiveRecord::Relation
@@ -230,64 +230,6 @@ module Wizard::GeneratedAttributeMethods
230
230
  def updated_at?; end
231
231
  end
232
232
 
233
- class Wizard::Broom < T::Enum
234
- enums do
235
- Nimbus = new(%q{nimbus})
236
- Firebolt = new(%q{firebolt})
237
- end
238
-
239
- end
240
-
241
- class Wizard::EyeColor < T::Enum
242
- enums do
243
- Brown = new(%q{brown})
244
- Green = new(%q{green})
245
- Blue = new(%q{blue})
246
- end
247
-
248
- end
249
-
250
- class Wizard::HairColor < T::Enum
251
- enums do
252
- Brown = new(%q{brown})
253
- Black = new(%q{black})
254
- Blonde = new(%q{blonde})
255
- end
256
-
257
- end
258
-
259
- class Wizard::House < T::Enum
260
- enums do
261
- Gryffindor = new(%q{Gryffindor})
262
- Hufflepuff = new(%q{Hufflepuff})
263
- Ravenclaw = new(%q{Ravenclaw})
264
- Slytherin = new(%q{Slytherin})
265
- end
266
-
267
- end
268
-
269
- class Wizard::ProfessorEnum < T::Enum
270
- enums do
271
- SeverusSnape = new(%q{Severus Snape})
272
- MinervaMcGonagall = new(%q{Minerva McGonagall})
273
- PomonaSprout = new(%q{Pomona Sprout})
274
- FiliusFlitwick = new(%q{Filius Flitwick})
275
- Hagrid = new(%q{Hagrid})
276
- AlastorMadEyeMoody = new(%q{Alastor 'Mad-Eye' Moody})
277
- end
278
-
279
- end
280
-
281
- class Wizard::QuidditchPosition < T::Enum
282
- enums do
283
- Keeper = new(%q{keeper})
284
- Seeker = new(%q{seeker})
285
- Beater = new(%q{beater})
286
- Chaser = new(%q{chaser})
287
- end
288
-
289
- end
290
-
291
233
  module Wizard::GeneratedAssociationMethods
292
234
  sig { returns(T.nilable(T.untyped)) }
293
235
  def school; end
@@ -464,6 +406,64 @@ class Wizard < ApplicationRecord
464
406
 
465
407
  sig { params(value: T.nilable(Wizard::QuidditchPosition)).void }
466
408
  def typed_quidditch_position=(value); end
409
+
410
+ class Broom < T::Enum
411
+ enums do
412
+ Nimbus = new(%q{nimbus})
413
+ Firebolt = new(%q{firebolt})
414
+ end
415
+
416
+ end
417
+
418
+ class EyeColor < T::Enum
419
+ enums do
420
+ Brown = new(%q{brown})
421
+ Green = new(%q{green})
422
+ Blue = new(%q{blue})
423
+ end
424
+
425
+ end
426
+
427
+ class HairColor < T::Enum
428
+ enums do
429
+ Brown = new(%q{brown})
430
+ Black = new(%q{black})
431
+ Blonde = new(%q{blonde})
432
+ end
433
+
434
+ end
435
+
436
+ class House < T::Enum
437
+ enums do
438
+ Gryffindor = new(%q{Gryffindor})
439
+ Hufflepuff = new(%q{Hufflepuff})
440
+ Ravenclaw = new(%q{Ravenclaw})
441
+ Slytherin = new(%q{Slytherin})
442
+ end
443
+
444
+ end
445
+
446
+ class ProfessorEnum < T::Enum
447
+ enums do
448
+ SeverusSnape = new(%q{Severus Snape})
449
+ MinervaMcGonagall = new(%q{Minerva McGonagall})
450
+ PomonaSprout = new(%q{Pomona Sprout})
451
+ FiliusFlitwick = new(%q{Filius Flitwick})
452
+ Hagrid = new(%q{Hagrid})
453
+ AlastorMadEyeMoody = new(%q{Alastor 'Mad-Eye' Moody})
454
+ end
455
+
456
+ end
457
+
458
+ class QuidditchPosition < T::Enum
459
+ enums do
460
+ Keeper = new(%q{keeper})
461
+ Seeker = new(%q{seeker})
462
+ Beater = new(%q{beater})
463
+ Chaser = new(%q{chaser})
464
+ end
465
+
466
+ end
467
467
  end
468
468
 
469
469
  class Wizard::ActiveRecord_Relation < ActiveRecord::Relation