rails-on-sorbet 0.2.6 → 0.2.8

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: 8ed0619a2df969a26e1a4c8a393f0c939d6f5810754404bc7d65dae595f86b56
4
+ data.tar.gz: 682c7f75757f90a583dac625a9b7a745f666d4893629b5ff78e1fbb3564d93f8
5
5
  SHA512:
6
- metadata.gz: aa4523da0af9c8f35ec1322893ff8df85d8b6255074e879628207b6d0f72366115b9828075b239f4e07106dfd6cc875057a98dda3e97cbbdf71b6192afbe3247
7
- data.tar.gz: 4e1dbc444d00b06631ba4e1bd731126348bd2286855569915fbc203943c224ea7bbd529024489a62057f615290de50905aa20935ee707015474a7cf3d5c55e89
6
+ metadata.gz: fa387b998f9c63a795ed3f1849f83bf4909343c6c87ae865b16d747e7cc9dfa46ecab8e7e7d918213f2367c4c754f8759beca26f5a40594bcfe4972e5418925c
7
+ data.tar.gz: 76311248119ffa6f7b17c3ae9a8219cfee17957f25d2fbc21864ebda0134c66eee9fda3d9d962aaf3f38a169e5a9348b0f66f2d91310be503491c594b49a4ba1
data/CHANGELOG.md CHANGED
@@ -12,6 +12,20 @@ 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.8] - 16.10.2025
16
+
17
+ [Diff](https://github.com/espago/rails-on-sorbet/compare/v0.2.7...v0.2.8)
18
+
19
+ ### Changes
20
+ - Add missing `Map#each` method
21
+
22
+ ## [0.2.7] - 08.10.2025
23
+
24
+ [Diff](https://github.com/espago/rails-on-sorbet/compare/v0.2.6...v0.2.7)
25
+
26
+ ### Changes
27
+ - Improve signatures of `Map#include?`, `Map#key?`, `Map#[]`, `Map#value?`,`Hash#include?`, `Hash#key?`, `Hash#[]`, `Hash#value?`, `Set#include?`
28
+
15
29
  ## [0.2.6] - 02.10.2025
16
30
 
17
31
  [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.8'
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
@@ -87,6 +87,31 @@ module Map
87
87
  sig {abstract.returns(T::Enumerator[K])}
88
88
  def each_key(&blk); end
89
89
 
90
+ # Calls *block* once for each key in *hsh*, passing the key-value pair as
91
+ # parameters.
92
+ #
93
+ # If no block is given, an enumerator is returned instead.
94
+ #
95
+ # ```ruby
96
+ # h = { "a" => 100, "b" => 200 }
97
+ # h.each {|key, value| puts "#{key} is #{value}" }
98
+ # ```
99
+ #
100
+ # *produces:*
101
+ #
102
+ # ```ruby
103
+ # a is 100
104
+ # b is 200
105
+ # ```
106
+ sig do
107
+ abstract.params(
108
+ blk: T.proc.params(arg0: [K, V]).returns(BasicObject),
109
+ )
110
+ .returns(T::Hash[K, V])
111
+ end
112
+ sig {returns(T::Enumerator[[K, V]])}
113
+ def each(&blk); end
114
+
90
115
  # Returns `true` if the given key is present in *hsh*.
91
116
  #
92
117
  # ```ruby
@@ -113,7 +138,7 @@ module Map
113
138
 
114
139
  sig do
115
140
  abstract.params(
116
- arg0: K,
141
+ arg0: T.anything,
117
142
  )
118
143
  .returns(T::Boolean)
119
144
  end
@@ -290,7 +315,7 @@ module Map
290
315
  # ```
291
316
  sig do
292
317
  abstract.params(
293
- arg0: K,
318
+ arg0: T.anything,
294
319
  )
295
320
  .returns(T.nilable(V))
296
321
  end
@@ -753,7 +778,7 @@ module Map
753
778
  # ```
754
779
  sig do
755
780
  abstract.params(
756
- arg0: V,
781
+ arg0: T.anything,
757
782
  )
758
783
  .returns(T::Boolean)
759
784
  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.8
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: