sorbet-runtime 0.5.10616 → 0.5.10624

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: 81e5abee1c08f93b5b9601d7c67ef60c7eb337ad6a8e7a07b64e4f8b434c0bc4
4
- data.tar.gz: e876af1abe9ff7ff4bd97d5c5f6f1e52c524e9eb0bb2ce270ecbae1e7c4e343e
3
+ metadata.gz: 4082eed81cede498862d3f4921014d54c888e3debc92086e5661bcc8151dd135
4
+ data.tar.gz: 54825f8b737aad3404a2da1ac9c1be07c468a6e9457b1cc700444a9c22b13cf3
5
5
  SHA512:
6
- metadata.gz: 0734f963b40c5c66358e813040a08f64b089a1ebfcf7ed2d0aab58f318a4ea5d011781258f9e38b935c8fc656960f80308cbd50e98abea41270ab7a969880d96
7
- data.tar.gz: 6caccb38f1a5a7dab904f9a1c1529493c0589d0b03e40be047baa358cb74511591f29050f5c670ca65ecb95673f5a05e6c8968c92c544436ecb0af61f94942ce
6
+ metadata.gz: 1a32e163b814ab0b1704f9ec0cef9bcd7a45da1f0d27a0e1c67fafce2b77522cb56272db08e5f4c59c5b55af1f6f2bc1ba200e20e742e276761a297a13ab32ef
7
+ data.tar.gz: 856a4f079e2fc8714876704eca6436ba7fee2de5e5d64775827aca0f839eb4d634f29f55972d9b6efbd197bca090d8a36fc3acb86502da25c03470c4ee69e355
@@ -32,15 +32,29 @@ module T::Private::Methods
32
32
  )
33
33
  end
34
34
 
35
- def params(**params)
35
+ def params(*unused_positional_params, **params)
36
36
  check_live!
37
37
  if !decl.params.equal?(ARG_NOT_PROVIDED)
38
38
  raise BuilderError.new("You can't call .params twice")
39
39
  end
40
40
 
41
+ if unused_positional_params.any?
42
+ some_or_only = params.any? ? "some" : "only"
43
+ raise BuilderError.new(<<~MSG)
44
+ 'params' was called with #{some_or_only} positional arguments, but it needs to be called with keyword arguments.
45
+ The keyword arguments' keys must match the name and order of the method's parameters.
46
+ MSG
47
+ end
48
+
41
49
  if params.empty?
42
- raise BuilderError.new("params expects keyword arguments")
50
+ raise BuilderError.new(<<~MSG)
51
+ 'params' was called without any arguments, but it needs to be called with keyword arguments.
52
+ The keyword arguments' keys must match the name and order of the method's parameters.
53
+
54
+ Omit 'params' entirely for methods with no parameters.
55
+ MSG
43
56
  end
57
+
44
58
  decl.params = params
45
59
 
46
60
  self
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sorbet-runtime
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.10616
4
+ version: 0.5.10624
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stripe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-01-10 00:00:00.000000000 Z
11
+ date: 2023-01-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest