rbs 3.0.4 → 3.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/sig/repository.rbs CHANGED
@@ -3,12 +3,14 @@ module RBS
3
3
  #
4
4
  # A repository object can handle multiple repository roots.
5
5
  #
6
- # repo = RBS::Repository.new()
7
- # repo.add(Pathname("vendor/rbs/gem-rbs"))
8
- # repo.add(Pathname("vendor/rbs/internal-rbs"))
9
- # repo.add(Pathname("vendor/rbs/definitely-rbs"))
6
+ # ```ruby
7
+ # repo = RBS::Repository.new()
8
+ # repo.add(Pathname("vendor/rbs/gem-rbs"))
9
+ # repo.add(Pathname("vendor/rbs/internal-rbs"))
10
+ # repo.add(Pathname("vendor/rbs/definitely-rbs"))
10
11
  #
11
- # repo.lookup("minitest", "2.1.3") => Pathname or nil
12
+ # repo.lookup("minitest", "2.1.3") # => Pathname or nil
13
+ # ```
12
14
  #
13
15
  # If one gem version can resolve to several directories, the last added dir wins.
14
16
  #
@@ -15,6 +15,8 @@ module Bundler
15
15
 
16
16
  class Dependency < Gem::Dependency
17
17
  attr_reader autorequire: Array[String]?
18
+
19
+ attr_reader source: untyped
18
20
  end
19
21
 
20
22
  class Definition
@@ -0,0 +1,33 @@
1
+ module RBS
2
+ class Subtractor
3
+ type decl_with_members = AST::Declarations::Class | AST::Declarations::Module
4
+
5
+ @minuend: Array[AST::Declarations::t]
6
+ @subtrahend: Environment
7
+
8
+ def initialize: (Array[AST::Declarations::t] minuend, Environment subtrahend) -> void
9
+
10
+ def call: (?Array[AST::Declarations::t], ?context: Resolver::context) -> Array[AST::Declarations::t]
11
+
12
+ private def filter_members: (decl_with_members, context: Resolver::context) -> decl_with_members?
13
+
14
+ private def member_exist?: (TypeName owner, AST::Members::t, context: Resolver::context) -> boolish
15
+
16
+ private def method_exist?: (TypeName owner, Symbol method_name, AST::Members::MethodDefinition::kind) -> boolish
17
+
18
+ private def ivar_exist?: (TypeName owner, Symbol ivar_name, AST::Members::Attribute::kind) -> boolish
19
+
20
+ private def cvar_exist?: (TypeName owner, Symbol cvar_name) -> boolish
21
+
22
+ private def each_member: (TypeName owner) { (AST::Members::t | AST::Declarations::t) -> void } -> void
23
+ | (TypeName owner) -> Enumerator[(AST::Members::t | AST::Declarations::t), void]
24
+
25
+ private def mixin_exist?: (TypeName owner, AST::Members::Include | AST::Members::Extend | AST::Members::Prepend, context: Resolver::context) -> boolish
26
+
27
+ private def update_decl: (decl_with_members, members: Array[AST::Declarations::t | AST::Members::t]) -> decl_with_members
28
+
29
+ private def absolute_typename: (TypeName, context: Resolver::context) -> TypeName
30
+
31
+ private def typename_candidates: (TypeName, context: Resolver::context) -> Array[TypeName]
32
+ end
33
+ end
data/sig/types.rbs CHANGED
@@ -18,9 +18,11 @@ module RBS
18
18
  # Yields all direct sub types included in the type.
19
19
  # It doesn't yield the type itself.
20
20
  #
21
- # parse("Hash[String, Array[Symbol]]").each_type do |ty|
22
- # ... # Yields String and Array[Symbol]
23
- # end
21
+ # ```ruby
22
+ # parse("Hash[String, Array[Symbol]]").each_type do |ty|
23
+ # ... # Yields String and Array[Symbol]
24
+ # end
25
+ # ```
24
26
  #
25
27
  def each_type: () { (t) -> void } -> void
26
28
  | () -> Enumerator[t, void]
@@ -32,9 +34,11 @@ module RBS
32
34
  # Returns a String representation.
33
35
  # `level` is used internally.
34
36
  #
35
- # parse("String").to_s # => "String"
36
- # parse("String | Integer").to_s() # => "String | Integer"
37
- # parse("String | Integer").to_s(1) # => "(String | Integer)"
37
+ # ```ruby
38
+ # parse("String").to_s # => "String"
39
+ # parse("String | Integer").to_s() # => "String | Integer"
40
+ # parse("String | Integer").to_s(1) # => "(String | Integer)"
41
+ # ```
38
42
  #
39
43
  def to_s: (?Integer level) -> String
40
44
  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.4
4
+ version: 3.1.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: 2023-03-13 00:00:00.000000000 Z
11
+ date: 2023-04-26 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.
@@ -182,6 +182,7 @@ files:
182
182
  - lib/rbs/environment_walker.rb
183
183
  - lib/rbs/errors.rb
184
184
  - lib/rbs/factory.rb
185
+ - lib/rbs/file_finder.rb
185
186
  - lib/rbs/location_aux.rb
186
187
  - lib/rbs/locator.rb
187
188
  - lib/rbs/method_type.rb
@@ -201,6 +202,7 @@ files:
201
202
  - lib/rbs/resolver/type_name_resolver.rb
202
203
  - lib/rbs/sorter.rb
203
204
  - lib/rbs/substitution.rb
205
+ - lib/rbs/subtractor.rb
204
206
  - lib/rbs/test.rb
205
207
  - lib/rbs/test/errors.rb
206
208
  - lib/rbs/test/hook.rb
@@ -259,6 +261,7 @@ files:
259
261
  - sig/environment_walker.rbs
260
262
  - sig/errors.rbs
261
263
  - sig/factory.rbs
264
+ - sig/file_finder.rbs
262
265
  - sig/location.rbs
263
266
  - sig/locator.rbs
264
267
  - sig/manifest.yaml
@@ -284,6 +287,7 @@ files:
284
287
  - sig/shims/rubygems.rbs
285
288
  - sig/sorter.rbs
286
289
  - sig/substitution.rbs
290
+ - sig/subtractor.rbs
287
291
  - sig/type_alias_dependency.rbs
288
292
  - sig/type_alias_regularity.rbs
289
293
  - sig/type_param.rbs