rails-on-sorbet 0.2.6 → 0.2.7

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b59ecfab32ed0297bd509f5ccde22108d38c998ae9864652c830a63e99f49747
4
- data.tar.gz: 3b4e4253ae42d94ee37f1750c96ae7ab00172caec8e0c8e53caa03009992fb79
3
+ metadata.gz: 9c4cb80ad204ac1ff75b170054b6c3722eaab381d2c707eaa04e9ae937bc7e39
4
+ data.tar.gz: 2796d4d8a2ac13e1d30618aa60016208201349df01f4ebcdf8d4af3fd84fe020
5
5
  SHA512:
6
- metadata.gz: aa4523da0af9c8f35ec1322893ff8df85d8b6255074e879628207b6d0f72366115b9828075b239f4e07106dfd6cc875057a98dda3e97cbbdf71b6192afbe3247
7
- data.tar.gz: 4e1dbc444d00b06631ba4e1bd731126348bd2286855569915fbc203943c224ea7bbd529024489a62057f615290de50905aa20935ee707015474a7cf3d5c55e89
6
+ metadata.gz: c30c27cc7e051c159e5f8af119cc48862410974a4808af8dac082d3a9be5aa56802bf5aa9c12d13ba43d274a554f33dd88fc65c60a181ab46089a95d07206d59
7
+ data.tar.gz: fd0d8cdd737a867e9fe269a76823626b1040f643710e7aa56090b39411eaed24310d9d11bcc7593de9c8c03d4c5ca3aa5d430302c5fea0cea3f6ce505449f515
data/CHANGELOG.md CHANGED
@@ -12,6 +12,13 @@ Add changes in new features here. Do not change the gem's version in pull/merge
12
12
  ### Changes
13
13
  -
14
14
 
15
+ ## [0.2.7] - 08.10.2025
16
+
17
+ [Diff](https://github.com/espago/rails-on-sorbet/compare/v0.2.6...v0.2.7)
18
+
19
+ ### Changes
20
+ - Improve signatures of `Map#include?`, `Map#key?`, `Map#[]`, `Map#value?`,`Hash#include?`, `Hash#key?`, `Hash#[]`, `Hash#value?`, `Set#include?`
21
+
15
22
  ## [0.2.6] - 02.10.2025
16
23
 
17
24
  [Diff](https://github.com/espago/rails-on-sorbet/compare/v0.2.5...v0.2.6)
@@ -3,7 +3,7 @@
3
3
  module Rails
4
4
  module On
5
5
  module Sorbet
6
- VERSION = '0.2.6'
6
+ VERSION = '0.2.7'
7
7
  end
8
8
  end
9
9
  end
data/rbi/hash.rbi ADDED
@@ -0,0 +1,71 @@
1
+ # typed: false
2
+
3
+ class Hash
4
+ sig { params(object: T.anything).returns(T::Boolean) }
5
+ def exclude?(object); end
6
+
7
+ # Returns `true` if the given key is present in *hsh*.
8
+ #
9
+ # ```ruby
10
+ # h = { "a" => 100, "b" => 200 }
11
+ # h.has_key?("a") #=> true
12
+ # h.has_key?("z") #=> false
13
+ # ```
14
+ #
15
+ # Note that
16
+ # [`include?`](https://docs.ruby-lang.org/en/2.7.0/Hash.html#method-i-include-3F)
17
+ # and
18
+ # [`member?`](https://docs.ruby-lang.org/en/2.7.0/Hash.html#method-i-member-3F)
19
+ # do not test member equality using `==` as do other Enumerables.
20
+ #
21
+ # See also
22
+ # [`Enumerable#include?`](https://docs.ruby-lang.org/en/2.7.0/Enumerable.html#method-i-include-3F)
23
+ sig do
24
+ params(
25
+ arg0: T.anything,
26
+ )
27
+ .returns(T::Boolean)
28
+ end
29
+ def include?(arg0); end
30
+
31
+ sig do
32
+ params(
33
+ arg0: T.anything,
34
+ )
35
+ .returns(T::Boolean)
36
+ end
37
+ def key?(arg0); end
38
+
39
+ # Element Reference---Retrieves the *value* object corresponding to the *key*
40
+ # object. If not found, returns the default value (see
41
+ # [`Hash::new`](https://docs.ruby-lang.org/en/2.7.0/Hash.html#method-c-new)
42
+ # for details).
43
+ #
44
+ # ```ruby
45
+ # h = { "a" => 100, "b" => 200 }
46
+ # h["a"] #=> 100
47
+ # h["c"] #=> nil
48
+ # ```
49
+ sig do
50
+ params(
51
+ arg0: T.anything,
52
+ )
53
+ .returns(T.nilable(V))
54
+ end
55
+ def [](arg0); end
56
+
57
+ # Returns `true` if the given value is present for some key in *hsh*.
58
+ #
59
+ # ```ruby
60
+ # h = { "a" => 100, "b" => 200 }
61
+ # h.value?(100) #=> true
62
+ # h.value?(999) #=> false
63
+ # ```
64
+ sig do
65
+ params(
66
+ arg0: T.anything,
67
+ )
68
+ .returns(T::Boolean)
69
+ end
70
+ def value?(arg0); end
71
+ end
data/rbi/map.rbi CHANGED
@@ -28,7 +28,7 @@ module Map
28
28
  sig {abstract.returns(T::Boolean)}
29
29
  def empty?(); end
30
30
 
31
- sig { abstract.params(object: BasicObject).returns(T::Boolean) }
31
+ sig { abstract.params(object: T.anything).returns(T::Boolean) }
32
32
  def exclude?(object); end
33
33
 
34
34
  # Returns `true` if the given key is present in *hsh*.
@@ -49,7 +49,7 @@ module Map
49
49
  # [`Enumerable#include?`](https://docs.ruby-lang.org/en/2.7.0/Enumerable.html#method-i-include-3F)
50
50
  sig do
51
51
  abstract.params(
52
- arg0: K,
52
+ arg0: T.anything,
53
53
  )
54
54
  .returns(T::Boolean)
55
55
  end
@@ -113,7 +113,7 @@ module Map
113
113
 
114
114
  sig do
115
115
  abstract.params(
116
- arg0: K,
116
+ arg0: T.anything,
117
117
  )
118
118
  .returns(T::Boolean)
119
119
  end
@@ -290,7 +290,7 @@ module Map
290
290
  # ```
291
291
  sig do
292
292
  abstract.params(
293
- arg0: K,
293
+ arg0: T.anything,
294
294
  )
295
295
  .returns(T.nilable(V))
296
296
  end
@@ -753,7 +753,7 @@ module Map
753
753
  # ```
754
754
  sig do
755
755
  abstract.params(
756
- arg0: V,
756
+ arg0: T.anything,
757
757
  )
758
758
  .returns(T::Boolean)
759
759
  end
data/rbi/set.rbi ADDED
@@ -0,0 +1,25 @@
1
+ # typed: true
2
+
3
+ class Set
4
+ # sig { params(object: T.anything).returns(T::Boolean) }
5
+ # def exclude?(object); end
6
+
7
+ # Returns true if the set contains the given object.
8
+ # Note that `include?` and `member?` do not test
9
+ # member
10
+ # equality
11
+ # using `==` as do other Enumerables.
12
+ # See also
13
+ # [`Enumerable#include?`](https://docs.ruby-lang.org/en/2.7.0/Enumerable.html#method-i-include-3F)
14
+ #
15
+ # Also aliased as:
16
+ # [`member?`](https://docs.ruby-lang.org/en/2.7.0/Set.html#method-i-member-3F),
17
+ # [`===`](https://docs.ruby-lang.org/en/2.7.0/Set.html#method-i-3D-3D-3D)
18
+ sig do
19
+ params(
20
+ o: T.anything,
21
+ )
22
+ .returns(T::Boolean)
23
+ end
24
+ def include?(o); end
25
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-on-sorbet
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
4
+ version: 0.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mateusz Drewniak
@@ -77,8 +77,10 @@ files:
77
77
  - rbi/current_attributes.rbi
78
78
  - rbi/datetime.rbi
79
79
  - rbi/duration.rbi
80
+ - rbi/hash.rbi
80
81
  - rbi/map.rbi
81
82
  - rbi/numeric.rbi
83
+ - rbi/set.rbi
82
84
  homepage: https://github.com/espago/rails-on_sorbet
83
85
  licenses: []
84
86
  metadata: