tapioca 0.14.0 → 0.14.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 469c53709eb6cb5de25abc9526d40c8dff3b852bf218bcbbc966078271754bfd
4
- data.tar.gz: fbc47526d02ef8fea90ad262007865ee56ab56a72dc5832c375540f42a3d9e11
3
+ metadata.gz: a9b033940feb12f528b3995f645ed709aa18a3e5397ec188f795df4cdbfb4c57
4
+ data.tar.gz: 0f38fe25358b09d6ebeb40c582014948bbf06787c947bd17f2bdb7cc0ed9dfd8
5
5
  SHA512:
6
- metadata.gz: f64c8009bf0e0d5a4b11595cc0bf9c72c5aca3fee4bcae7da5b036009dc0e27c9c5fc2d921564f9664aef0f2b1a648000e3228902d3d2a8b13338af85773d48e
7
- data.tar.gz: b751f2a0618927d616edebad5841333af85cb5c7d773bd8904c119d521ab871a65b3405c72efe56426faccdada8b32204f2e5a56cde3ddc4f067884270f106b4
6
+ metadata.gz: 8feb5a4f612517906add3ef224f13ac73296955c097352349d4bcf52f19951a1b97bc79ecdc184355123c22285eaffb98f8037bcf58be1bb56f60e1607b332b5
7
+ data.tar.gz: 41caacbc97da0c7dc1c0ee8260ac8d860908138fb709cc7bbe1a0bd8170953daeb6d88a82cad9f8979c28471d5a4d1b84b87c39ff6c7756ef6f152e703c26dc4
@@ -26,10 +26,11 @@ module Tapioca
26
26
  # # test_case.rbi
27
27
  # # typed: true
28
28
  # class ActiveSupport::TestCase
29
+ # sig { params(fixture_name: NilClass, other_fixtures: NilClass).returns(T::Array[Post]) }
29
30
  # sig { params(fixture_name: T.any(String, Symbol), other_fixtures: NilClass).returns(Post) }
30
31
  # sig { params(fixture_name: T.any(String, Symbol), other_fixtures: T.any(String, Symbol))
31
32
  # .returns(T::Array[Post]) }
32
- # def posts(fixture_name, *other_fixtures); end
33
+ # def posts(fixture_name = nil, *other_fixtures); end
33
34
  # end
34
35
  # ~~~
35
36
  class ActiveRecordFixtures < Compiler
@@ -110,9 +111,15 @@ module Tapioca
110
111
  def create_fixture_method(mod, name)
111
112
  return_type = return_type_for_fixture(name)
112
113
  mod << RBI::Method.new(name) do |node|
113
- node.add_param("fixture_name")
114
+ node.add_opt_param("fixture_name", "nil")
114
115
  node.add_rest_param("other_fixtures")
115
116
 
117
+ node.add_sig do |sig|
118
+ sig.add_param("fixture_name", "NilClass")
119
+ sig.add_param("other_fixtures", "NilClass")
120
+ sig.return_type = "T::Array[#{return_type}]"
121
+ end
122
+
116
123
  node.add_sig do |sig|
117
124
  sig.add_param("fixture_name", "T.any(String, Symbol)")
118
125
  sig.add_param("other_fixtures", "NilClass")
@@ -2,5 +2,5 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module Tapioca
5
- VERSION = "0.14.0"
5
+ VERSION = "0.14.1"
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tapioca
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.0
4
+ version: 0.14.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ufuk Kayserilioglu
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: exe
13
13
  cert_chain: []
14
- date: 2024-05-07 00:00:00.000000000 Z
14
+ date: 2024-05-08 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: bundler