rbs_rails 0.9.0 → 0.10.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: ccb7076ac91a406f491cf3e6c4d8499525f860660061ff23809635d000d1aba3
4
- data.tar.gz: a863d9e16999e7491cef930b8fb79515c538ad7d83b919abad762a5c1290e370
3
+ metadata.gz: 4daa0714f5e127bc21e33e9737983999459a2dbb690202c6dc86408a68ef82b0
4
+ data.tar.gz: 54f9a8c04ca0f22c1a391a4d5a47c0294c54f50741843226655ae9e8175b0a51
5
5
  SHA512:
6
- metadata.gz: 10dccf3356c898258d6c13aaed04d61a5f137787f9ea696fe0d7005e2063c2fd130d9fdda59c4c7b4fa58d1cde84a3ca0cf750dac28f1ac9ffbfe94ead90da57
7
- data.tar.gz: b8f5c227bf58bdb16044867cd4abd883f21782817eda8fa6d85d1956418c763829748d5d0ee0e81e1005ffd18e022d6da6e83b64aa97cf4f77fe6942bacec48b
6
+ metadata.gz: f85bdbf2f59f5accdd54a062f5d5412f432b9d91b62b6f4ced371fbcc0d565ad661a1015d9193e4ee9add64ef69cf7243dd5603dc22b05182b59f3a122ecad2e
7
+ data.tar.gz: f75cc735df8961b0714af8bf4f38771f01542ed4162e69fb8adc677dcbfec0885fe15296bc84006b955d9370004dfcd6070fbd761c0b220f02d16f062fadcbba
@@ -15,7 +15,7 @@ jobs:
15
15
  strategy:
16
16
  fail-fast: false
17
17
  matrix:
18
- ruby: [2.6, 2.7, '3.0', head]
18
+ ruby: [2.6, 2.7, '3.0', 3.1, head]
19
19
  runs-on: ubuntu-latest
20
20
  steps:
21
21
  - uses: actions/checkout@v2
data/Gemfile CHANGED
@@ -7,6 +7,6 @@ gemspec
7
7
 
8
8
  gem "rake", "~> 13.0"
9
9
  gem 'rails', '< 6.1', '>= 6.0'
10
- gem 'rbs', '>= 1.6'
11
- gem 'steep', github: 'soutaro/steep'
10
+ gem 'rbs', '>= 2'
11
+ gem 'steep'
12
12
  gem 'minitest'
data/Gemfile.lock CHANGED
@@ -1,77 +1,63 @@
1
- GIT
2
- remote: https://github.com/soutaro/steep
3
- revision: 0673d88395fb0ea380463fef1aed568dfb077a60
4
- specs:
5
- steep (0.46.0)
6
- activesupport (>= 5.1)
7
- language_server-protocol (>= 3.15, < 4.0)
8
- listen (~> 3.0)
9
- parallel (>= 1.0.0)
10
- parser (>= 3.0)
11
- rainbow (>= 2.2.2, < 4.0)
12
- rbs (>= 1.6.0)
13
- terminal-table (>= 2, < 4)
14
-
15
1
  PATH
16
2
  remote: .
17
3
  specs:
18
- rbs_rails (0.9.0)
4
+ rbs_rails (0.10.0)
19
5
  parser
20
6
  rbs (>= 1)
21
7
 
22
8
  GEM
23
9
  remote: https://rubygems.org/
24
10
  specs:
25
- actioncable (6.0.4.1)
26
- actionpack (= 6.0.4.1)
11
+ actioncable (6.0.4.7)
12
+ actionpack (= 6.0.4.7)
27
13
  nio4r (~> 2.0)
28
14
  websocket-driver (>= 0.6.1)
29
- actionmailbox (6.0.4.1)
30
- actionpack (= 6.0.4.1)
31
- activejob (= 6.0.4.1)
32
- activerecord (= 6.0.4.1)
33
- activestorage (= 6.0.4.1)
34
- activesupport (= 6.0.4.1)
15
+ actionmailbox (6.0.4.7)
16
+ actionpack (= 6.0.4.7)
17
+ activejob (= 6.0.4.7)
18
+ activerecord (= 6.0.4.7)
19
+ activestorage (= 6.0.4.7)
20
+ activesupport (= 6.0.4.7)
35
21
  mail (>= 2.7.1)
36
- actionmailer (6.0.4.1)
37
- actionpack (= 6.0.4.1)
38
- actionview (= 6.0.4.1)
39
- activejob (= 6.0.4.1)
22
+ actionmailer (6.0.4.7)
23
+ actionpack (= 6.0.4.7)
24
+ actionview (= 6.0.4.7)
25
+ activejob (= 6.0.4.7)
40
26
  mail (~> 2.5, >= 2.5.4)
41
27
  rails-dom-testing (~> 2.0)
42
- actionpack (6.0.4.1)
43
- actionview (= 6.0.4.1)
44
- activesupport (= 6.0.4.1)
28
+ actionpack (6.0.4.7)
29
+ actionview (= 6.0.4.7)
30
+ activesupport (= 6.0.4.7)
45
31
  rack (~> 2.0, >= 2.0.8)
46
32
  rack-test (>= 0.6.3)
47
33
  rails-dom-testing (~> 2.0)
48
34
  rails-html-sanitizer (~> 1.0, >= 1.2.0)
49
- actiontext (6.0.4.1)
50
- actionpack (= 6.0.4.1)
51
- activerecord (= 6.0.4.1)
52
- activestorage (= 6.0.4.1)
53
- activesupport (= 6.0.4.1)
35
+ actiontext (6.0.4.7)
36
+ actionpack (= 6.0.4.7)
37
+ activerecord (= 6.0.4.7)
38
+ activestorage (= 6.0.4.7)
39
+ activesupport (= 6.0.4.7)
54
40
  nokogiri (>= 1.8.5)
55
- actionview (6.0.4.1)
56
- activesupport (= 6.0.4.1)
41
+ actionview (6.0.4.7)
42
+ activesupport (= 6.0.4.7)
57
43
  builder (~> 3.1)
58
44
  erubi (~> 1.4)
59
45
  rails-dom-testing (~> 2.0)
60
46
  rails-html-sanitizer (~> 1.1, >= 1.2.0)
61
- activejob (6.0.4.1)
62
- activesupport (= 6.0.4.1)
47
+ activejob (6.0.4.7)
48
+ activesupport (= 6.0.4.7)
63
49
  globalid (>= 0.3.6)
64
- activemodel (6.0.4.1)
65
- activesupport (= 6.0.4.1)
66
- activerecord (6.0.4.1)
67
- activemodel (= 6.0.4.1)
68
- activesupport (= 6.0.4.1)
69
- activestorage (6.0.4.1)
70
- actionpack (= 6.0.4.1)
71
- activejob (= 6.0.4.1)
72
- activerecord (= 6.0.4.1)
50
+ activemodel (6.0.4.7)
51
+ activesupport (= 6.0.4.7)
52
+ activerecord (6.0.4.7)
53
+ activemodel (= 6.0.4.7)
54
+ activesupport (= 6.0.4.7)
55
+ activestorage (6.0.4.7)
56
+ actionpack (= 6.0.4.7)
57
+ activejob (= 6.0.4.7)
58
+ activerecord (= 6.0.4.7)
73
59
  marcel (~> 1.0.0)
74
- activesupport (6.0.4.1)
60
+ activesupport (6.0.4.7)
75
61
  concurrent-ruby (~> 1.0, >= 1.0.2)
76
62
  i18n (>= 0.7, < 2)
77
63
  minitest (~> 5.1)
@@ -82,86 +68,95 @@ GEM
82
68
  concurrent-ruby (1.1.9)
83
69
  crass (1.0.6)
84
70
  erubi (1.10.0)
85
- ffi (1.15.4)
86
- globalid (0.5.2)
71
+ ffi (1.15.5)
72
+ globalid (1.0.0)
87
73
  activesupport (>= 5.0)
88
- i18n (1.8.10)
74
+ i18n (1.10.0)
89
75
  concurrent-ruby (~> 1.0)
90
76
  language_server-protocol (3.16.0.3)
91
- listen (3.7.0)
77
+ listen (3.7.1)
92
78
  rb-fsevent (~> 0.10, >= 0.10.3)
93
79
  rb-inotify (~> 0.9, >= 0.9.10)
94
- loofah (2.12.0)
80
+ loofah (2.15.0)
95
81
  crass (~> 1.0.2)
96
82
  nokogiri (>= 1.5.9)
97
83
  mail (2.7.1)
98
84
  mini_mime (>= 0.1.1)
99
- marcel (1.0.1)
85
+ marcel (1.0.2)
100
86
  method_source (1.0.0)
101
- mini_mime (1.1.1)
102
- mini_portile2 (2.6.1)
103
- minitest (5.14.4)
87
+ mini_mime (1.1.2)
88
+ mini_portile2 (2.8.0)
89
+ minitest (5.15.0)
104
90
  nio4r (2.5.8)
105
- nokogiri (1.12.4)
106
- mini_portile2 (~> 2.6.1)
91
+ nokogiri (1.13.3)
92
+ mini_portile2 (~> 2.8.0)
107
93
  racc (~> 1.4)
108
- parallel (1.20.1)
109
- parser (3.0.2.0)
94
+ parallel (1.21.0)
95
+ parser (3.1.1.0)
110
96
  ast (~> 2.4.1)
111
- racc (1.5.2)
97
+ racc (1.6.0)
112
98
  rack (2.2.3)
113
99
  rack-test (1.1.0)
114
100
  rack (>= 1.0, < 3)
115
- rails (6.0.4.1)
116
- actioncable (= 6.0.4.1)
117
- actionmailbox (= 6.0.4.1)
118
- actionmailer (= 6.0.4.1)
119
- actionpack (= 6.0.4.1)
120
- actiontext (= 6.0.4.1)
121
- actionview (= 6.0.4.1)
122
- activejob (= 6.0.4.1)
123
- activemodel (= 6.0.4.1)
124
- activerecord (= 6.0.4.1)
125
- activestorage (= 6.0.4.1)
126
- activesupport (= 6.0.4.1)
101
+ rails (6.0.4.7)
102
+ actioncable (= 6.0.4.7)
103
+ actionmailbox (= 6.0.4.7)
104
+ actionmailer (= 6.0.4.7)
105
+ actionpack (= 6.0.4.7)
106
+ actiontext (= 6.0.4.7)
107
+ actionview (= 6.0.4.7)
108
+ activejob (= 6.0.4.7)
109
+ activemodel (= 6.0.4.7)
110
+ activerecord (= 6.0.4.7)
111
+ activestorage (= 6.0.4.7)
112
+ activesupport (= 6.0.4.7)
127
113
  bundler (>= 1.3.0)
128
- railties (= 6.0.4.1)
114
+ railties (= 6.0.4.7)
129
115
  sprockets-rails (>= 2.0.0)
130
116
  rails-dom-testing (2.0.3)
131
117
  activesupport (>= 4.2.0)
132
118
  nokogiri (>= 1.6)
133
119
  rails-html-sanitizer (1.4.2)
134
120
  loofah (~> 2.3)
135
- railties (6.0.4.1)
136
- actionpack (= 6.0.4.1)
137
- activesupport (= 6.0.4.1)
121
+ railties (6.0.4.7)
122
+ actionpack (= 6.0.4.7)
123
+ activesupport (= 6.0.4.7)
138
124
  method_source
139
125
  rake (>= 0.8.7)
140
126
  thor (>= 0.20.3, < 2.0)
141
- rainbow (3.0.0)
127
+ rainbow (3.1.1)
142
128
  rake (13.0.6)
143
- rb-fsevent (0.11.0)
129
+ rb-fsevent (0.11.1)
144
130
  rb-inotify (0.10.1)
145
131
  ffi (~> 1.0)
146
- rbs (1.6.2)
147
- sprockets (4.0.2)
132
+ rbs (2.2.2)
133
+ sprockets (4.0.3)
148
134
  concurrent-ruby (~> 1.0)
149
135
  rack (> 1, < 3)
150
- sprockets-rails (3.2.2)
151
- actionpack (>= 4.0)
152
- activesupport (>= 4.0)
136
+ sprockets-rails (3.4.2)
137
+ actionpack (>= 5.2)
138
+ activesupport (>= 5.2)
153
139
  sprockets (>= 3.0.0)
154
- terminal-table (3.0.1)
140
+ steep (0.49.1)
141
+ activesupport (>= 5.1)
142
+ language_server-protocol (>= 3.15, < 4.0)
143
+ listen (~> 3.0)
144
+ parallel (>= 1.0.0)
145
+ parser (>= 3.0)
146
+ rainbow (>= 2.2.2, < 4.0)
147
+ rbs (>= 2.2.0)
148
+ terminal-table (>= 2, < 4)
149
+ terminal-table (3.0.2)
155
150
  unicode-display_width (>= 1.1.1, < 3)
156
- thor (1.1.0)
151
+ thor (1.2.1)
157
152
  thread_safe (0.3.6)
158
153
  tzinfo (1.2.9)
159
154
  thread_safe (~> 0.1)
160
- unicode-display_width (2.0.0)
155
+ unicode-display_width (2.1.0)
161
156
  websocket-driver (0.7.5)
162
157
  websocket-extensions (>= 0.1.0)
163
158
  websocket-extensions (0.1.5)
164
- zeitwerk (2.4.2)
159
+ zeitwerk (2.5.4)
165
160
 
166
161
  PLATFORMS
167
162
  ruby
@@ -171,9 +166,9 @@ DEPENDENCIES
171
166
  minitest
172
167
  rails (>= 6.0, < 6.1)
173
168
  rake (~> 13.0)
174
- rbs (>= 1.6)
169
+ rbs (>= 2)
175
170
  rbs_rails!
176
- steep!
171
+ steep
177
172
 
178
173
  BUNDLED WITH
179
174
  2.2.27
@@ -32,6 +32,8 @@ module RbsRails
32
32
 
33
33
  #{columns}
34
34
  #{associations}
35
+ #{generated_association_methods}
36
+ #{has_secure_password}
35
37
  #{delegated_type_instance}
36
38
  #{delegated_type_scope(singleton: true)}
37
39
  #{enum_instance_methods}
@@ -68,7 +70,7 @@ module RbsRails
68
70
 
69
71
  private def relation_decl
70
72
  <<~RBS
71
- class #{relation_class_name} < ActiveRecord::Relation
73
+ class #{relation_class_name} < ::ActiveRecord::Relation
72
74
  include GeneratedRelationMethods
73
75
  include _ActiveRecord_Relation[#{klass_name}, #{pk_type}]
74
76
  include Enumerable[#{klass_name}]
@@ -78,7 +80,7 @@ module RbsRails
78
80
 
79
81
  private def collection_proxy_decl
80
82
  <<~RBS
81
- class ActiveRecord_Associations_CollectionProxy < ActiveRecord::Associations::CollectionProxy
83
+ class ActiveRecord_Associations_CollectionProxy < ::ActiveRecord::Associations::CollectionProxy
82
84
  include GeneratedRelationMethods
83
85
  include _ActiveRecord_Relation[#{klass_name}, #{pk_type}]
84
86
  end
@@ -97,7 +99,7 @@ module RbsRails
97
99
  superclass_name = Util.module_name(superclass)
98
100
  @dependencies << superclass_name
99
101
 
100
- "class #{mod_name} < #{superclass_name}"
102
+ "class #{mod_name} < ::#{superclass_name}"
101
103
  when Module
102
104
  "module #{mod_name}"
103
105
  else
@@ -165,6 +167,41 @@ module RbsRails
165
167
  end.join("\n")
166
168
  end
167
169
 
170
+ private def generated_association_methods
171
+ # @type var sigs: Array[String]
172
+ sigs = []
173
+
174
+ # Needs to require "active_storage/engine"
175
+ if klass.respond_to?(:attachment_reflections)
176
+ sigs << "module GeneratedAssociationMethods"
177
+ sigs << klass.attachment_reflections.map do |name, reflection|
178
+ case reflection.macro
179
+ when :has_one_attached
180
+ <<~EOS
181
+ def #{name}: () -> ActiveStorage::Attached::One
182
+ def #{name}=: (ActionDispatch::Http::UploadedFile) -> ActionDispatch::Http::UploadedFile
183
+ | (Rack::Test::UploadedFile) -> Rack::Test::UploadedFile
184
+ | (ActiveStorage::Blob) -> ActiveStorage::Blob
185
+ | (String) -> String
186
+ | ({ io: IO, filename: String, content_type: String? }) -> { io: IO, filename: String, content_type: String? }
187
+ | (nil) -> nil
188
+ EOS
189
+ when :has_many_attached
190
+ <<~EOS
191
+ def #{name}: () -> ActiveStorage::Attached::Many
192
+ def #{name}=: (untyped) -> untyped
193
+ EOS
194
+ else
195
+ raise
196
+ end
197
+ end.join("\n")
198
+ sigs << "end"
199
+ sigs << "include GeneratedAssociationMethods"
200
+ end
201
+
202
+ sigs.join("\n")
203
+ end
204
+
168
205
  private def delegated_type_scope(singleton:)
169
206
  definitions = delegated_type_definitions
170
207
  return "" unless definitions
@@ -236,12 +273,42 @@ module RbsRails
236
273
  end.compact
237
274
  end
238
275
 
276
+ private def has_secure_password
277
+ ast = parse_model_file
278
+ return unless ast
279
+
280
+ traverse(ast).map do |node|
281
+ # @type block: String?
282
+ next unless node.type == :send
283
+ next unless node.children[0].nil?
284
+ next unless node.children[1] == :has_secure_password
285
+
286
+ attribute_node = node.children[2]
287
+ attribute = if attribute_node && attribute_node.type == :sym
288
+ attribute_node.children[0]
289
+ else
290
+ :password
291
+ end
292
+
293
+ <<~EOS
294
+ module ActiveModel_SecurePassword_InstanceMethodsOnActivation_#{attribute}
295
+ attr_reader #{attribute}: String?
296
+ def #{attribute}=: (String) -> String
297
+ def #{attribute}_confirmation=: (String) -> String
298
+ def authenticate_#{attribute}: (String) -> (#{klass_name} | false)
299
+ #{attribute == :password ? "alias authenticate authenticate_password" : ""}
300
+ end
301
+ include ActiveModel_SecurePassword_InstanceMethodsOnActivation_#{attribute}
302
+ EOS
303
+ end.compact.join("\n")
304
+ end
305
+
239
306
  private def enum_instance_methods
240
307
  # @type var methods: Array[String]
241
308
  methods = []
242
309
  enum_definitions.each do |hash|
243
310
  hash.each do |name, values|
244
- next if name == :_prefix || name == :_suffix
311
+ next if name == :_prefix || name == :_suffix || name == :_default
245
312
 
246
313
  values.each do |label, value|
247
314
  value_method_name = enum_method_name(hash, name, label)
@@ -259,7 +326,7 @@ module RbsRails
259
326
  methods = []
260
327
  enum_definitions.each do |hash|
261
328
  hash.each do |name, values|
262
- next if name == :_prefix || name == :_suffix
329
+ next if name == :_prefix || name == :_suffix || name == :_default
263
330
 
264
331
  values.each do |label, value|
265
332
  value_method_name = enum_method_name(hash, name, label)
@@ -320,7 +387,9 @@ module RbsRails
320
387
  ast = parse_model_file
321
388
  return '' unless ast
322
389
 
323
- traverse(ast).map do |node|
390
+ prefix = singleton ? 'self.' : ''
391
+
392
+ sigs = traverse(ast).map do |node|
324
393
  # @type block: nil | String
325
394
  next unless node.type == :send
326
395
  next unless node.children[0].nil?
@@ -336,8 +405,16 @@ module RbsRails
336
405
  next unless body_node.type == :block
337
406
 
338
407
  args = args_to_type(body_node.children[1])
339
- "def #{singleton ? 'self.' : ''}#{name}: #{args} -> #{relation_class_name}"
340
- end.compact.join("\n")
408
+ "def #{prefix}#{name}: #{args} -> #{relation_class_name}"
409
+ end.compact
410
+
411
+ if klass.respond_to?(:attachment_reflections)
412
+ klass.attachment_reflections.each do |name, _reflection|
413
+ sigs << "def #{prefix}with_attached_#{name}: () -> #{relation_class_name}"
414
+ end
415
+ end
416
+
417
+ sigs.join("\n")
341
418
  end
342
419
 
343
420
  private def args_to_type(args_node)
@@ -396,7 +473,8 @@ module RbsRails
396
473
  end
397
474
 
398
475
  private def columns
399
- klass.columns.map do |col|
476
+ mod_sig = +"module GeneratedAttributeMethods\n"
477
+ mod_sig << klass.columns.map do |col|
400
478
  class_name = if enum_definitions.any? { |hash| hash.key?(col.name) || hash.key?(col.name.to_sym) }
401
479
  'String'
402
480
  else
@@ -405,7 +483,9 @@ module RbsRails
405
483
  class_name_opt = optional(class_name)
406
484
  column_type = col.null ? class_name_opt : class_name
407
485
  sig = <<~EOS
408
- attr_accessor #{col.name} (): #{column_type}
486
+ def #{col.name}: () -> #{column_type}
487
+ def #{col.name}=: (#{column_type}) -> #{column_type}
488
+ def #{col.name}?: () -> bool
409
489
  def #{col.name}_changed?: () -> bool
410
490
  def #{col.name}_change: () -> [#{class_name_opt}, #{class_name_opt}]
411
491
  def #{col.name}_will_change!: () -> void
@@ -422,9 +502,12 @@ module RbsRails
422
502
  def restore_#{col.name}!: () -> void
423
503
  def clear_#{col.name}_change: () -> void
424
504
  EOS
425
- sig << "attr_accessor #{col.name}? (): #{class_name}\n" if col.type == :boolean
505
+ sig << "\n"
426
506
  sig
427
507
  end.join("\n")
508
+ mod_sig << "\nend\n"
509
+ mod_sig << "include GeneratedAttributeMethods"
510
+ mod_sig
428
511
  end
429
512
 
430
513
  private def optional(class_name)
@@ -2,5 +2,5 @@ module RbsRails
2
2
  # Because of copy_signatures is defined by lib/rbs_rails.rb
3
3
  # @dynamic self.copy_signatures
4
4
 
5
- VERSION = "0.9.0"
5
+ VERSION = "0.10.0"
6
6
  end
@@ -6,59 +6,31 @@ sources:
6
6
  repo_dir: gems
7
7
  path: ".gem_rbs_collection"
8
8
  gems:
9
- - name: pathname
10
- version: '0'
11
- source:
12
- type: stdlib
13
9
  - name: logger
14
10
  version: '0'
15
11
  source:
16
12
  type: stdlib
17
- - name: mutex_m
18
- version: '0'
19
- source:
20
- type: stdlib
21
- - name: date
22
- version: '0'
23
- source:
24
- type: stdlib
25
- - name: monitor
26
- version: '0'
27
- source:
28
- type: stdlib
29
- - name: singleton
30
- version: '0'
31
- source:
32
- type: stdlib
33
- - name: tsort
13
+ - name: set
34
14
  version: '0'
35
15
  source:
36
16
  type: stdlib
37
- - name: time
17
+ - name: pathname
38
18
  version: '0'
39
19
  source:
40
20
  type: stdlib
41
- - name: set
21
+ - name: json
42
22
  version: '0'
43
23
  source:
44
24
  type: stdlib
45
- - name: rack
46
- version: 2.2.2
47
- source:
48
- type: git
49
- name: ruby/gem_rbs_collection
50
- revision: 51880bed87fbc3dc8076fedb5cf798be05148220
51
- remote: https://github.com/ruby/gem_rbs_collection.git
52
- repo_dir: gems
53
- - name: json
25
+ - name: optparse
54
26
  version: '0'
55
27
  source:
56
28
  type: stdlib
57
- - name: strscan
29
+ - name: rubygems
58
30
  version: '0'
59
31
  source:
60
32
  type: stdlib
61
- - name: optparse
33
+ - name: tsort
62
34
  version: '0'
63
35
  source:
64
36
  type: stdlib
@@ -67,7 +39,7 @@ gems:
67
39
  source:
68
40
  type: git
69
41
  name: ruby/gem_rbs_collection
70
- revision: 51880bed87fbc3dc8076fedb5cf798be05148220
42
+ revision: 6320a194c85afbf4ff332c3eb75fcae2a6518c92
71
43
  remote: https://github.com/ruby/gem_rbs_collection.git
72
44
  repo_dir: gems
73
45
  - name: actionview
@@ -75,7 +47,7 @@ gems:
75
47
  source:
76
48
  type: git
77
49
  name: ruby/gem_rbs_collection
78
- revision: 51880bed87fbc3dc8076fedb5cf798be05148220
50
+ revision: 6320a194c85afbf4ff332c3eb75fcae2a6518c92
79
51
  remote: https://github.com/ruby/gem_rbs_collection.git
80
52
  repo_dir: gems
81
53
  - name: activejob
@@ -83,7 +55,7 @@ gems:
83
55
  source:
84
56
  type: git
85
57
  name: ruby/gem_rbs_collection
86
- revision: 51880bed87fbc3dc8076fedb5cf798be05148220
58
+ revision: 6320a194c85afbf4ff332c3eb75fcae2a6518c92
87
59
  remote: https://github.com/ruby/gem_rbs_collection.git
88
60
  repo_dir: gems
89
61
  - name: activemodel
@@ -91,7 +63,7 @@ gems:
91
63
  source:
92
64
  type: git
93
65
  name: ruby/gem_rbs_collection
94
- revision: 51880bed87fbc3dc8076fedb5cf798be05148220
66
+ revision: 6320a194c85afbf4ff332c3eb75fcae2a6518c92
95
67
  remote: https://github.com/ruby/gem_rbs_collection.git
96
68
  repo_dir: gems
97
69
  - name: activerecord
@@ -99,7 +71,15 @@ gems:
99
71
  source:
100
72
  type: git
101
73
  name: ruby/gem_rbs_collection
102
- revision: 51880bed87fbc3dc8076fedb5cf798be05148220
74
+ revision: 6320a194c85afbf4ff332c3eb75fcae2a6518c92
75
+ remote: https://github.com/ruby/gem_rbs_collection.git
76
+ repo_dir: gems
77
+ - name: activestorage
78
+ version: '6.0'
79
+ source:
80
+ type: git
81
+ name: ruby/gem_rbs_collection
82
+ revision: 6320a194c85afbf4ff332c3eb75fcae2a6518c92
103
83
  remote: https://github.com/ruby/gem_rbs_collection.git
104
84
  repo_dir: gems
105
85
  - name: activesupport
@@ -107,7 +87,7 @@ gems:
107
87
  source:
108
88
  type: git
109
89
  name: ruby/gem_rbs_collection
110
- revision: 51880bed87fbc3dc8076fedb5cf798be05148220
90
+ revision: 6320a194c85afbf4ff332c3eb75fcae2a6518c92
111
91
  remote: https://github.com/ruby/gem_rbs_collection.git
112
92
  repo_dir: gems
113
93
  - name: parallel
@@ -115,7 +95,15 @@ gems:
115
95
  source:
116
96
  type: git
117
97
  name: ruby/gem_rbs_collection
118
- revision: 51880bed87fbc3dc8076fedb5cf798be05148220
98
+ revision: 6320a194c85afbf4ff332c3eb75fcae2a6518c92
99
+ remote: https://github.com/ruby/gem_rbs_collection.git
100
+ repo_dir: gems
101
+ - name: rack
102
+ version: 2.2.2
103
+ source:
104
+ type: git
105
+ name: ruby/gem_rbs_collection
106
+ revision: 6320a194c85afbf4ff332c3eb75fcae2a6518c92
119
107
  remote: https://github.com/ruby/gem_rbs_collection.git
120
108
  repo_dir: gems
121
109
  - name: railties
@@ -123,10 +111,34 @@ gems:
123
111
  source:
124
112
  type: git
125
113
  name: ruby/gem_rbs_collection
126
- revision: 51880bed87fbc3dc8076fedb5cf798be05148220
114
+ revision: 6320a194c85afbf4ff332c3eb75fcae2a6518c92
127
115
  remote: https://github.com/ruby/gem_rbs_collection.git
128
116
  repo_dir: gems
129
117
  - name: rbs
130
- version: 1.6.2
118
+ version: 2.2.2
131
119
  source:
132
120
  type: rubygems
121
+ - name: monitor
122
+ version: '0'
123
+ source:
124
+ type: stdlib
125
+ - name: tempfile
126
+ version: '0'
127
+ source:
128
+ type: stdlib
129
+ - name: date
130
+ version: '0'
131
+ source:
132
+ type: stdlib
133
+ - name: singleton
134
+ version: '0'
135
+ source:
136
+ type: stdlib
137
+ - name: mutex_m
138
+ version: '0'
139
+ source:
140
+ type: stdlib
141
+ - name: time
142
+ version: '0'
143
+ source:
144
+ type: stdlib
data/rbs_collection.yaml CHANGED
@@ -9,25 +9,6 @@ sources:
9
9
  path: .gem_rbs_collection
10
10
 
11
11
  gems:
12
- # stdlibs
13
- - name: 'pathname'
14
- - name: 'logger'
15
- - name: 'mutex_m'
16
- - name: 'date'
17
- - name: 'monitor'
18
- - name: 'singleton'
19
- - name: 'tsort'
20
- - name: 'time'
21
- - name: 'set'
22
-
23
- # gems
24
- - name: 'rack'
25
-
26
- # RBS gem dependencies
27
- - name: 'json'
28
- - name: 'strscan'
29
- - name: 'optparse'
30
-
31
12
  # Ignores - Gemfile.lock contains them but their RBSs are unnecessary
32
13
  - name: steep
33
14
  ignore: true
@@ -43,3 +24,13 @@ gems:
43
24
  # ignore RBS Rails itself
44
25
  - name: rbs_rails
45
26
  ignore: true
27
+
28
+ # They'are necessary to load RBS gem.
29
+ # See https://github.com/ruby/rbs/pull/921
30
+ - name: logger
31
+ - name: set
32
+ - name: pathname
33
+ - name: json
34
+ - name: optparse
35
+ - name: rubygems
36
+ - name: tsort
@@ -32,12 +32,16 @@ class RbsRails::ActiveRecord::Generator
32
32
 
33
33
  def belongs_to: () -> String
34
34
 
35
+ def generated_association_methods: () -> String
36
+
35
37
  def delegated_type_scope: (singleton: bool) -> String
36
38
 
37
39
  def delegated_type_instance: () -> String
38
40
 
39
41
  def delegated_type_definitions: () -> Array[{ role: Symbol, types: Array[String] }]?
40
42
 
43
+ def has_secure_password: () -> String?
44
+
41
45
  def enum_instance_methods: () -> String
42
46
 
43
47
  def enum_scope_methods: (singleton: untyped `singleton`) -> String
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbs_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Masataka Pocke Kuwabara
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-09-18 00:00:00.000000000 Z
11
+ date: 2022-03-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: parser
@@ -105,7 +105,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
105
105
  - !ruby/object:Gem::Version
106
106
  version: '0'
107
107
  requirements: []
108
- rubygems_version: 3.3.0.dev
108
+ rubygems_version: 3.4.0.dev
109
109
  signing_key:
110
110
  specification_version: 4
111
111
  summary: A RBS files generator for Rails application