rbs_active_hash 1.3.2 → 1.4.0

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: 69a9fa4f66ca52f64cf235295003834705238e5f9dd1ee5e2697e0b1800087c5
4
- data.tar.gz: f950fd44124f574d4395f02ce89ea63e3197c61f45d09bbb2ae19b7a9d492e32
3
+ metadata.gz: 9866dbab4f6ce4f960f4ab932012ff245d1352709f049ed4d8669286dc636fe0
4
+ data.tar.gz: 33f910940e93be844169ec07536f2ba901f0be79897e187f3c2a3ac9df89ccd4
5
5
  SHA512:
6
- metadata.gz: d4a1e155c10141878daad145dd54e2a202fee7c34d378fa7ed81b2507d0de14665e6708372deb709561b9bddf799d1fecc6a781b33345814ae1cd2689cc890b3
7
- data.tar.gz: 237d4d4c561cefb313abc6e2a8090fe188070f0c30ce05961f70d01cd956654dcd853d1649b529660bc588941155373a1389850fc2f2e149f4287de19ca18404
6
+ metadata.gz: d898c448eefa998dbcba353a8dffc1147a81fef7b04c29a6ff57d956b4080006c7bde1dd99c22f75cb8bb348fb9571c1bd0b190359c83a81c4ea88b330bae8ab
7
+ data.tar.gz: 3400f9a96ea50940ecf59c1dc43a1d7e8c159330c32086b1b92c103ed4a3ce4bf4aa332c733bdac905a1d3c466ccd86c2d1477075d8c67c7340e47b5ea81b333
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rbs_active_hash (1.3.2)
4
+ rbs_active_hash (1.4.0)
5
5
  active_hash
6
6
  rbs
7
7
 
@@ -176,13 +176,17 @@ module RbsActiveHash
176
176
  def method_decls
177
177
  method_names.map do |method|
178
178
  method_type = stringify_type(method_types.fetch(method, "untyped"))
179
- <<~RBS
180
- def #{method}: () -> #{method_type}
181
- def #{method}=: (#{method_type} value) -> #{method_type}
182
- def #{method}?: () -> bool
183
- def self.find_by_#{method}: (#{method_type} value) -> instance?
184
- def self.find_all_by_#{method}: (#{method_type} value) -> Array[instance]
185
- RBS
179
+ if method == :id
180
+ "def self.find: (#{method_type} id) -> instance? | ...\n"
181
+ else
182
+ <<~RBS
183
+ def #{method}: () -> #{method_type}
184
+ def #{method}=: (#{method_type} value) -> #{method_type}
185
+ def #{method}?: () -> bool
186
+ def self.find_by_#{method}: (#{method_type} value) -> instance?
187
+ def self.find_all_by_#{method}: (#{method_type} value) -> Array[instance]
188
+ RBS
189
+ end
186
190
  end.join("\n")
187
191
  end
188
192
 
@@ -190,7 +194,7 @@ module RbsActiveHash
190
194
  method_names = (klass.data || []).flat_map do |record|
191
195
  record.symbolize_keys.keys
192
196
  end
193
- method_names.uniq.select { |k| k != :id && valid_field_name?(k) }
197
+ method_names.uniq.select { |k| valid_field_name?(k) }
194
198
  end
195
199
 
196
200
  def method_types
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RbsActiveHash
4
- VERSION = "1.3.2"
4
+ VERSION = "1.4.0"
5
5
  end
@@ -2,7 +2,7 @@
2
2
  sources:
3
3
  - type: git
4
4
  name: ruby/gem_rbs_collection
5
- revision: c560bb18418e07a709f80954db2e2d975bbd6e14
5
+ revision: 267dd270bb5aabcc1e21c87f44360f0680a8501c
6
6
  remote: https://github.com/ruby/gem_rbs_collection.git
7
7
  repo_dir: gems
8
8
  path: ".gem_rbs_collection"
@@ -16,7 +16,7 @@ gems:
16
16
  source:
17
17
  type: git
18
18
  name: ruby/gem_rbs_collection
19
- revision: c560bb18418e07a709f80954db2e2d975bbd6e14
19
+ revision: 267dd270bb5aabcc1e21c87f44360f0680a8501c
20
20
  remote: https://github.com/ruby/gem_rbs_collection.git
21
21
  repo_dir: gems
22
22
  - name: actionview
@@ -24,7 +24,7 @@ gems:
24
24
  source:
25
25
  type: git
26
26
  name: ruby/gem_rbs_collection
27
- revision: c560bb18418e07a709f80954db2e2d975bbd6e14
27
+ revision: 267dd270bb5aabcc1e21c87f44360f0680a8501c
28
28
  remote: https://github.com/ruby/gem_rbs_collection.git
29
29
  repo_dir: gems
30
30
  - name: active_hash
@@ -32,7 +32,7 @@ gems:
32
32
  source:
33
33
  type: git
34
34
  name: ruby/gem_rbs_collection
35
- revision: c560bb18418e07a709f80954db2e2d975bbd6e14
35
+ revision: 267dd270bb5aabcc1e21c87f44360f0680a8501c
36
36
  remote: https://github.com/ruby/gem_rbs_collection.git
37
37
  repo_dir: gems
38
38
  - name: activemodel
@@ -40,7 +40,7 @@ gems:
40
40
  source:
41
41
  type: git
42
42
  name: ruby/gem_rbs_collection
43
- revision: c560bb18418e07a709f80954db2e2d975bbd6e14
43
+ revision: 267dd270bb5aabcc1e21c87f44360f0680a8501c
44
44
  remote: https://github.com/ruby/gem_rbs_collection.git
45
45
  repo_dir: gems
46
46
  - name: activerecord
@@ -48,7 +48,7 @@ gems:
48
48
  source:
49
49
  type: git
50
50
  name: ruby/gem_rbs_collection
51
- revision: c560bb18418e07a709f80954db2e2d975bbd6e14
51
+ revision: 267dd270bb5aabcc1e21c87f44360f0680a8501c
52
52
  remote: https://github.com/ruby/gem_rbs_collection.git
53
53
  repo_dir: gems
54
54
  - name: activesupport
@@ -56,7 +56,7 @@ gems:
56
56
  source:
57
57
  type: git
58
58
  name: ruby/gem_rbs_collection
59
- revision: c560bb18418e07a709f80954db2e2d975bbd6e14
59
+ revision: 267dd270bb5aabcc1e21c87f44360f0680a8501c
60
60
  remote: https://github.com/ruby/gem_rbs_collection.git
61
61
  repo_dir: gems
62
62
  - name: ast
@@ -64,7 +64,7 @@ gems:
64
64
  source:
65
65
  type: git
66
66
  name: ruby/gem_rbs_collection
67
- revision: c560bb18418e07a709f80954db2e2d975bbd6e14
67
+ revision: 267dd270bb5aabcc1e21c87f44360f0680a8501c
68
68
  remote: https://github.com/ruby/gem_rbs_collection.git
69
69
  repo_dir: gems
70
70
  - name: base64
@@ -80,7 +80,7 @@ gems:
80
80
  source:
81
81
  type: git
82
82
  name: ruby/gem_rbs_collection
83
- revision: c560bb18418e07a709f80954db2e2d975bbd6e14
83
+ revision: 267dd270bb5aabcc1e21c87f44360f0680a8501c
84
84
  remote: https://github.com/ruby/gem_rbs_collection.git
85
85
  repo_dir: gems
86
86
  - name: date
@@ -96,7 +96,7 @@ gems:
96
96
  source:
97
97
  type: git
98
98
  name: ruby/gem_rbs_collection
99
- revision: c560bb18418e07a709f80954db2e2d975bbd6e14
99
+ revision: 267dd270bb5aabcc1e21c87f44360f0680a8501c
100
100
  remote: https://github.com/ruby/gem_rbs_collection.git
101
101
  repo_dir: gems
102
102
  - name: json
@@ -124,7 +124,7 @@ gems:
124
124
  source:
125
125
  type: git
126
126
  name: ruby/gem_rbs_collection
127
- revision: c560bb18418e07a709f80954db2e2d975bbd6e14
127
+ revision: 267dd270bb5aabcc1e21c87f44360f0680a8501c
128
128
  remote: https://github.com/ruby/gem_rbs_collection.git
129
129
  repo_dir: gems
130
130
  - name: optparse
@@ -136,7 +136,7 @@ gems:
136
136
  source:
137
137
  type: git
138
138
  name: ruby/gem_rbs_collection
139
- revision: c560bb18418e07a709f80954db2e2d975bbd6e14
139
+ revision: 267dd270bb5aabcc1e21c87f44360f0680a8501c
140
140
  remote: https://github.com/ruby/gem_rbs_collection.git
141
141
  repo_dir: gems
142
142
  - name: pathname
@@ -148,7 +148,7 @@ gems:
148
148
  source:
149
149
  type: git
150
150
  name: ruby/gem_rbs_collection
151
- revision: c560bb18418e07a709f80954db2e2d975bbd6e14
151
+ revision: 267dd270bb5aabcc1e21c87f44360f0680a8501c
152
152
  remote: https://github.com/ruby/gem_rbs_collection.git
153
153
  repo_dir: gems
154
154
  - name: rails-dom-testing
@@ -156,7 +156,7 @@ gems:
156
156
  source:
157
157
  type: git
158
158
  name: ruby/gem_rbs_collection
159
- revision: c560bb18418e07a709f80954db2e2d975bbd6e14
159
+ revision: 267dd270bb5aabcc1e21c87f44360f0680a8501c
160
160
  remote: https://github.com/ruby/gem_rbs_collection.git
161
161
  repo_dir: gems
162
162
  - name: railties
@@ -164,7 +164,7 @@ gems:
164
164
  source:
165
165
  type: git
166
166
  name: ruby/gem_rbs_collection
167
- revision: c560bb18418e07a709f80954db2e2d975bbd6e14
167
+ revision: 267dd270bb5aabcc1e21c87f44360f0680a8501c
168
168
  remote: https://github.com/ruby/gem_rbs_collection.git
169
169
  repo_dir: gems
170
170
  - name: rainbow
@@ -172,7 +172,7 @@ gems:
172
172
  source:
173
173
  type: git
174
174
  name: ruby/gem_rbs_collection
175
- revision: c560bb18418e07a709f80954db2e2d975bbd6e14
175
+ revision: 267dd270bb5aabcc1e21c87f44360f0680a8501c
176
176
  remote: https://github.com/ruby/gem_rbs_collection.git
177
177
  repo_dir: gems
178
178
  - name: rbs
@@ -200,7 +200,7 @@ gems:
200
200
  source:
201
201
  type: git
202
202
  name: ruby/gem_rbs_collection
203
- revision: c560bb18418e07a709f80954db2e2d975bbd6e14
203
+ revision: 267dd270bb5aabcc1e21c87f44360f0680a8501c
204
204
  remote: https://github.com/ruby/gem_rbs_collection.git
205
205
  repo_dir: gems
206
206
  - name: time
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbs_active_hash
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.2
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Takeshi KOMIYA
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-09-22 00:00:00.000000000 Z
11
+ date: 2023-09-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: active_hash