rbs-inline 0.6.0 → 0.7.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: 330c5c083c1dda38f3f0263729aea1d39c16484e67deee0717b28881ec22da8a
4
- data.tar.gz: 2f1e8f2910669d33f6ed64897b0e5db00285b42626d846402a85c5c294c23155
3
+ metadata.gz: ae1ebe5ac15f3f5c12c3b162fbcdc754de5544867fbc2d455af7a2028bfc12c7
4
+ data.tar.gz: aecd4c155a61ff168e9dea24d22cd9772566b26d973ffe9857e85f369e716a32
5
5
  SHA512:
6
- metadata.gz: ad396cb989f857ada7203ca6ab2129dae79f471520d816e791c8be80b9d3d4b3d5301f8360dfe8ccba5fe30d99f92dd56eea81c32b092a946d91aab431f57e26
7
- data.tar.gz: 4487616c28a042e68f167ea191b7ab4265704228b6a104e0bf52a15d909b096bb8a8798d273de97cebba72f2a8bf0b2635168cee5e7961a7c37ec0a9f3364c25
6
+ metadata.gz: ffb76bf31d5c65a4e50edc61bd5538214d15fca1c4bcf0be83a86c32fbb22f27f5947279bec2919aee94928c236605f3998395a9c4b8f2329f0fe933bdff4e87
7
+ data.tar.gz: 7dd187fd1519420e823133a84abb6fc858ac6e8024b899b96a0e6cd6c581b42c332e161e9af67067224d9b95d939e32900eeeb5e61b3c5d405b94433e0c19d17
@@ -241,6 +241,21 @@ module RBS
241
241
  end
242
242
 
243
243
  class SingletonClassDecl < ModuleOrClass #[Prism::SingletonClassNode]
244
+ # @rbs (AST::Members::RubyDef) -> (:private | nil)
245
+ def visibility(def_member)
246
+ current_visibility = nil
247
+ members.each do |member|
248
+ case member
249
+ when AST::Members::RubyPublic
250
+ current_visibility = nil
251
+ when AST::Members::RubyPrivate
252
+ current_visibility = :private
253
+ end
254
+
255
+ break if member == def_member
256
+ end
257
+ current_visibility
258
+ end
244
259
  end
245
260
 
246
261
  class BlockDecl < Base
@@ -2,6 +2,6 @@
2
2
 
3
3
  module RBS
4
4
  module Inline
5
- VERSION = "0.6.0"
5
+ VERSION = "0.7.0"
6
6
  end
7
7
  end
@@ -421,6 +421,7 @@ module RBS
421
421
  return
422
422
  end
423
423
 
424
+ visibility = member.visibility || decl&.visibility(member)
424
425
  rbs << RBS::AST::Members::MethodDefinition.new(
425
426
  name: member.method_name,
426
427
  kind: kind,
@@ -429,7 +430,7 @@ module RBS
429
430
  location: nil,
430
431
  comment: comment,
431
432
  overloading: member.overloading?,
432
- visibility: member.visibility
433
+ visibility: visibility
433
434
  )
434
435
  when AST::Members::RubyAlias
435
436
  if member.comments
@@ -453,9 +454,9 @@ module RBS
453
454
  rbs.concat m
454
455
  end
455
456
  when AST::Members::RubyPrivate
456
- rbs << RBS::AST::Members::Private.new(location: nil)
457
+ rbs << RBS::AST::Members::Private.new(location: nil) unless decl
457
458
  when AST::Members::RubyPublic
458
- rbs << RBS::AST::Members::Public.new(location: nil)
459
+ rbs << RBS::AST::Members::Public.new(location: nil) unless decl
459
460
  when AST::Members::RBSIvar
460
461
  if m = member.rbs
461
462
  rbs << m
@@ -42,11 +42,11 @@ gems:
42
42
  source:
43
43
  type: git
44
44
  name: ruby/gem_rbs_collection
45
- revision: 3670834268f4ea9c10aefeffae7e072b51256375
45
+ revision: 03121e6bbf2340e3b179edcc351deac45476f4d0
46
46
  remote: https://github.com/ruby/gem_rbs_collection.git
47
47
  repo_dir: gems
48
48
  - name: rbs
49
- version: 3.5.2
49
+ version: 3.5.3
50
50
  source:
51
51
  type: rubygems
52
52
  - name: rdoc
@@ -115,6 +115,8 @@ module RBS
115
115
  end
116
116
 
117
117
  class SingletonClassDecl < ModuleOrClass[Prism::SingletonClassNode]
118
+ # @rbs (AST::Members::RubyDef) -> (:private | nil)
119
+ def visibility: (AST::Members::RubyDef) -> (:private | nil)
118
120
  end
119
121
 
120
122
  class BlockDecl < Base
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbs-inline
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Soutaro Matsumoto
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-08-01 00:00:00.000000000 Z
11
+ date: 2024-08-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: prism
@@ -110,7 +110,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
110
110
  - !ruby/object:Gem::Version
111
111
  version: '0'
112
112
  requirements: []
113
- rubygems_version: 3.5.11
113
+ rubygems_version: 3.5.17
114
114
  signing_key:
115
115
  specification_version: 4
116
116
  summary: Inline RBS type declaration.