rbs 3.0.3 → 3.0.4

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: 7a5d2a9cd76c2802e303f61813f418c15a2fc131b23f1eb8e90a92f409efcf37
4
- data.tar.gz: d008724c5628a0c21b153a6ae99dadf7604ee90ad4caa210e07bbad974f91894
3
+ metadata.gz: be4870f9cbfced10b6cbfe578fc38429fa9c4232fe687a4a4e075a3970db2a0c
4
+ data.tar.gz: 837608d29d1541864457f307dbb52c9809bdc92325d8c255414c6034ba6f3b77
5
5
  SHA512:
6
- metadata.gz: 4c903cc9f9b536281e0632aff0cae6d520856152bdf33b1d8fc34b2dd8e5caab93af6aaa1387eb7433b430d2d90dafcd5557c7aeba0b043d6ab340bc22d36dcb
7
- data.tar.gz: 1913b79a1bb5b6510734aaca4aee8fa1759dae851486662ee5055040b8d70554b9466d061cc53c971ade8d76d75312486fe39cea5b1f4c7d3bfa333501fb56da
6
+ metadata.gz: c3cb35ee898cfe7da1dedac7ff448a201391da32fab7aef37ef0547fb0bdfbf887b8c72fdb2351357501811bfbe6c14f018de92f4ccb81d21833be03b243bcf4
7
+ data.tar.gz: 838ef9460abf1ba9e59ae8b5a70a704b1a3b931f83ef86f111f6729434e28680e26df3f2dc5ee367a9b28019fdd542272873eac44a200bf7f70438371582494b
data/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  ## master
4
4
 
5
+ ## 3.0.4 (2023-03-13)
6
+
7
+ ### Library changes
8
+
9
+ * Add missing implementation to support class/module alias ([#1271](https://github.com/ruby/rbs/pull/1271))
10
+
5
11
  ## 3.0.3 (2023-03-07)
6
12
 
7
13
  ### Library changes
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rbs (3.0.3)
4
+ rbs (3.0.4)
5
5
 
6
6
  PATH
7
7
  remote: test/assets/test-gem
data/lib/rbs/cli.rb CHANGED
@@ -230,6 +230,19 @@ EOB
230
230
  end
231
231
  end
232
232
  end
233
+
234
+ env.class_alias_decls.each do |name, entry|
235
+ case entry
236
+ when Environment::ModuleAliasEntry
237
+ if list.include?(:module)
238
+ stdout.puts "#{name} (module alias)"
239
+ end
240
+ when Environment::ClassAliasEntry
241
+ if list.include?(:class)
242
+ stdout.puts "#{name} (class alias)"
243
+ end
244
+ end
245
+ end
233
246
  end
234
247
 
235
248
  if list.include?(:interface)
@@ -272,7 +285,10 @@ EOU
272
285
  builder = DefinitionBuilder::AncestorBuilder.new(env: env)
273
286
  type_name = TypeName(args[0]).absolute!
274
287
 
275
- if env.class_decls.key?(type_name)
288
+ case env.constant_entry(type_name)
289
+ when Environment::ClassEntry, Environment::ModuleEntry, Environment::ClassAliasEntry, Environment::ModuleAliasEntry
290
+ type_name = env.normalize_module_name(type_name)
291
+
276
292
  ancestors = case kind
277
293
  when :instance
278
294
  builder.instance_ancestors(type_name)
@@ -334,7 +350,7 @@ EOU
334
350
  builder = DefinitionBuilder.new(env: env)
335
351
  type_name = TypeName(args[0]).absolute!
336
352
 
337
- if env.class_decls.key?(type_name)
353
+ if env.module_name?(type_name)
338
354
  definition = case kind
339
355
  when :instance
340
356
  builder.build_instance(type_name)
@@ -388,7 +404,7 @@ EOU
388
404
  type_name = TypeName(args[0]).absolute!
389
405
  method_name = args[1].to_sym
390
406
 
391
- unless env.class_decls.key?(type_name)
407
+ unless env.module_name?(type_name)
392
408
  stdout.puts "Cannot find class: #{type_name}"
393
409
  return
394
410
  end
@@ -135,7 +135,7 @@ module RBS
135
135
 
136
136
  type_params = case type
137
137
  when Types::ClassInstance
138
- env.class_decls[type.name].type_params
138
+ env.class_decls[env.normalize_module_name(type.name)].type_params
139
139
  when Types::Interface
140
140
  env.interface_decls[type.name].decl.type_params
141
141
  when Types::Alias
data/lib/rbs/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RBS
4
- VERSION = "3.0.3"
4
+ VERSION = "3.0.4"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbs
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.3
4
+ version: 3.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Soutaro Matsumoto
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-03-07 00:00:00.000000000 Z
11
+ date: 2023-03-13 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: RBS is the language for type signatures for Ruby and standard library
14
14
  definitions.