rbs_active_hash 1.3.1 → 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: 49a4b12af2d15a13a338e2924494f4da8d3167301f3fa9bc66277bdf0185d326
4
- data.tar.gz: 94eef0c6aafc8d0162541e51871ace002bdcd5b6f38f0203ef30eecfb19d666a
3
+ metadata.gz: 9866dbab4f6ce4f960f4ab932012ff245d1352709f049ed4d8669286dc636fe0
4
+ data.tar.gz: 33f910940e93be844169ec07536f2ba901f0be79897e187f3c2a3ac9df89ccd4
5
5
  SHA512:
6
- metadata.gz: 2fc036b3bd3ce01452800e183f683e6dc7a6c720d07484414c5c6cc393f9b7b8d15cef8d3819ef1ef38173b449b9cfdd892db3764e0f5468e76461f35ef557c0
7
- data.tar.gz: 437b7dec163d2a770d2f916727aac06e3b1c6d2d69cae56cc1c63d756fa87b4abb12025f1b9ee9d833ccca00677bca70e062321ce8cd911fbb2f37a5ddfcca67
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.1)
4
+ rbs_active_hash (1.4.0)
5
5
  active_hash
6
6
  rbs
7
7
 
@@ -110,7 +110,7 @@ GEM
110
110
  diff-lcs (>= 1.2.0, < 2.0)
111
111
  rspec-support (~> 3.12.0)
112
112
  rspec-support (3.12.0)
113
- rubocop (1.56.1)
113
+ rubocop (1.56.3)
114
114
  base64 (~> 0.1.1)
115
115
  json (~> 2.3)
116
116
  language_server-protocol (>= 3.17.0)
@@ -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) -> self?
184
- def self.find_all_by_#{method}: (#{method_type} value) -> Array[self]
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.1"
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: 5666e737d2b27a8425b4e3855c1a38cae54989f7
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: 306d1aec19defeb177e217d8aad9812a52bcd5eb
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: 306d1aec19defeb177e217d8aad9812a52bcd5eb
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: 306d1aec19defeb177e217d8aad9812a52bcd5eb
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: 306d1aec19defeb177e217d8aad9812a52bcd5eb
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: 306d1aec19defeb177e217d8aad9812a52bcd5eb
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: 306d1aec19defeb177e217d8aad9812a52bcd5eb
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: 306d1aec19defeb177e217d8aad9812a52bcd5eb
67
+ revision: 267dd270bb5aabcc1e21c87f44360f0680a8501c
68
68
  remote: https://github.com/ruby/gem_rbs_collection.git
69
69
  repo_dir: gems
70
70
  - name: base64
@@ -80,19 +80,23 @@ gems:
80
80
  source:
81
81
  type: git
82
82
  name: ruby/gem_rbs_collection
83
- revision: 306d1aec19defeb177e217d8aad9812a52bcd5eb
83
+ revision: 267dd270bb5aabcc1e21c87f44360f0680a8501c
84
84
  remote: https://github.com/ruby/gem_rbs_collection.git
85
85
  repo_dir: gems
86
86
  - name: date
87
87
  version: '0'
88
88
  source:
89
89
  type: stdlib
90
+ - name: erb
91
+ version: '0'
92
+ source:
93
+ type: stdlib
90
94
  - name: i18n
91
95
  version: '1.10'
92
96
  source:
93
97
  type: git
94
98
  name: ruby/gem_rbs_collection
95
- revision: 306d1aec19defeb177e217d8aad9812a52bcd5eb
99
+ revision: 267dd270bb5aabcc1e21c87f44360f0680a8501c
96
100
  remote: https://github.com/ruby/gem_rbs_collection.git
97
101
  repo_dir: gems
98
102
  - name: json
@@ -120,7 +124,7 @@ gems:
120
124
  source:
121
125
  type: git
122
126
  name: ruby/gem_rbs_collection
123
- revision: 306d1aec19defeb177e217d8aad9812a52bcd5eb
127
+ revision: 267dd270bb5aabcc1e21c87f44360f0680a8501c
124
128
  remote: https://github.com/ruby/gem_rbs_collection.git
125
129
  repo_dir: gems
126
130
  - name: optparse
@@ -132,7 +136,7 @@ gems:
132
136
  source:
133
137
  type: git
134
138
  name: ruby/gem_rbs_collection
135
- revision: 306d1aec19defeb177e217d8aad9812a52bcd5eb
139
+ revision: 267dd270bb5aabcc1e21c87f44360f0680a8501c
136
140
  remote: https://github.com/ruby/gem_rbs_collection.git
137
141
  repo_dir: gems
138
142
  - name: pathname
@@ -144,7 +148,7 @@ gems:
144
148
  source:
145
149
  type: git
146
150
  name: ruby/gem_rbs_collection
147
- revision: 306d1aec19defeb177e217d8aad9812a52bcd5eb
151
+ revision: 267dd270bb5aabcc1e21c87f44360f0680a8501c
148
152
  remote: https://github.com/ruby/gem_rbs_collection.git
149
153
  repo_dir: gems
150
154
  - name: rails-dom-testing
@@ -152,7 +156,7 @@ gems:
152
156
  source:
153
157
  type: git
154
158
  name: ruby/gem_rbs_collection
155
- revision: 306d1aec19defeb177e217d8aad9812a52bcd5eb
159
+ revision: 267dd270bb5aabcc1e21c87f44360f0680a8501c
156
160
  remote: https://github.com/ruby/gem_rbs_collection.git
157
161
  repo_dir: gems
158
162
  - name: railties
@@ -160,7 +164,7 @@ gems:
160
164
  source:
161
165
  type: git
162
166
  name: ruby/gem_rbs_collection
163
- revision: 306d1aec19defeb177e217d8aad9812a52bcd5eb
167
+ revision: 267dd270bb5aabcc1e21c87f44360f0680a8501c
164
168
  remote: https://github.com/ruby/gem_rbs_collection.git
165
169
  repo_dir: gems
166
170
  - name: rainbow
@@ -168,7 +172,7 @@ gems:
168
172
  source:
169
173
  type: git
170
174
  name: ruby/gem_rbs_collection
171
- revision: 306d1aec19defeb177e217d8aad9812a52bcd5eb
175
+ revision: 267dd270bb5aabcc1e21c87f44360f0680a8501c
172
176
  remote: https://github.com/ruby/gem_rbs_collection.git
173
177
  repo_dir: gems
174
178
  - name: rbs
@@ -191,6 +195,14 @@ gems:
191
195
  version: '0'
192
196
  source:
193
197
  type: stdlib
198
+ - name: thor
199
+ version: '1.2'
200
+ source:
201
+ type: git
202
+ name: ruby/gem_rbs_collection
203
+ revision: 267dd270bb5aabcc1e21c87f44360f0680a8501c
204
+ remote: https://github.com/ruby/gem_rbs_collection.git
205
+ repo_dir: gems
194
206
  - name: time
195
207
  version: '0'
196
208
  source:
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.1
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-02 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
@@ -70,7 +70,6 @@ files:
70
70
  - sig/rbs_active_hash/active_hash/parser.rbs
71
71
  - sig/rbs_active_hash/rake_task.rbs
72
72
  - sig/shims/rake.rbs
73
- - sig/shims/thor.rbs
74
73
  homepage: https://github.com/tk0miya/rbs_active_hash
75
74
  licenses:
76
75
  - MIT
data/sig/shims/thor.rbs DELETED
@@ -1,5 +0,0 @@
1
- class Thor
2
- module Actions
3
- def create_file: (String destination, *String? args, ?config: bool) ?{ () -> void } -> untyped
4
- end
5
- end