rbs 0.12.0 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +10 -10
- data/.gitignore +0 -1
- data/CHANGELOG.md +24 -0
- data/Gemfile +3 -0
- data/README.md +8 -2
- data/Rakefile +9 -4
- data/Steepfile +1 -0
- data/bin/annotate-with-rdoc +1 -1
- data/bin/setup +0 -2
- data/bin/test_runner.rb +3 -6
- data/docs/CONTRIBUTING.md +1 -0
- data/goodcheck.yml +22 -5
- data/lib/rbs/ast/comment.rb +1 -1
- data/lib/rbs/cli.rb +12 -4
- data/lib/rbs/constant.rb +1 -1
- data/lib/rbs/constant_table.rb +9 -8
- data/lib/rbs/definition_builder.rb +4 -5
- data/lib/rbs/environment.rb +5 -1
- data/lib/rbs/environment_loader.rb +12 -12
- data/lib/rbs/namespace.rb +1 -1
- data/lib/rbs/parser.rb +3146 -0
- data/lib/rbs/parser.y +7 -2
- data/lib/rbs/test/setup_helper.rb +4 -4
- data/lib/rbs/test/type_check.rb +2 -2
- data/lib/rbs/type_name.rb +1 -1
- data/lib/rbs/variance_calculator.rb +2 -2
- data/lib/rbs/version.rb +1 -1
- data/lib/rbs/writer.rb +25 -15
- data/sig/constant.rbs +21 -0
- data/sig/constant_table.rbs +30 -0
- data/sig/declarations.rbs +1 -1
- data/sig/definition.rbs +1 -1
- data/sig/definition_builder.rbs +4 -5
- data/sig/environment_loader.rbs +54 -0
- data/sig/namespace.rbs +3 -3
- data/sig/parser.rbs +25 -0
- data/sig/substitution.rbs +3 -3
- data/sig/typename.rbs +1 -1
- data/sig/types.rbs +1 -1
- data/sig/version.rbs +3 -0
- data/sig/writer.rbs +40 -0
- data/stdlib/benchmark/benchmark.rbs +2 -2
- data/stdlib/builtin/basic_object.rbs +54 -54
- data/stdlib/builtin/binding.rbs +42 -42
- data/stdlib/builtin/class.rbs +33 -33
- data/stdlib/builtin/complex.rbs +90 -90
- data/stdlib/builtin/encoding.rbs +33 -33
- data/stdlib/builtin/enumerable.rbs +32 -32
- data/stdlib/builtin/enumerator.rbs +35 -35
- data/stdlib/builtin/errors.rbs +1 -1
- data/stdlib/builtin/exception.rbs +50 -50
- data/stdlib/builtin/false_class.rbs +6 -6
- data/stdlib/builtin/fiber.rbs +14 -14
- data/stdlib/builtin/fiber_error.rbs +1 -1
- data/stdlib/builtin/float.rbs +161 -161
- data/stdlib/builtin/gc.rbs +1 -1
- data/stdlib/builtin/io.rbs +83 -83
- data/stdlib/builtin/kernel.rbs +70 -68
- data/stdlib/builtin/match_data.rbs +1 -1
- data/stdlib/builtin/method.rbs +19 -19
- data/stdlib/builtin/nil_class.rbs +20 -20
- data/stdlib/builtin/numeric.rbs +101 -101
- data/stdlib/builtin/object.rbs +172 -172
- data/stdlib/builtin/proc.rbs +91 -91
- data/stdlib/builtin/range.rbs +2 -4
- data/stdlib/builtin/rational.rbs +83 -83
- data/stdlib/builtin/signal.rbs +7 -7
- data/stdlib/builtin/string.rbs +4 -4
- data/stdlib/builtin/string_io.rbs +1 -1
- data/stdlib/builtin/thread.rbs +185 -185
- data/stdlib/builtin/thread_group.rbs +2 -2
- data/stdlib/builtin/true_class.rbs +9 -9
- data/stdlib/builtin/warning.rbs +1 -1
- data/stdlib/date/date.rbs +2 -2
- data/stdlib/find/find.rbs +10 -10
- data/stdlib/pathname/pathname.rbs +2 -0
- data/stdlib/pty/pty.rbs +5 -29
- data/stdlib/tmpdir/tmpdir.rbs +12 -12
- data/stdlib/uri/generic.rbs +1 -1
- data/stdlib/uri/http.rbs +158 -0
- data/stdlib/uri/https.rbs +108 -0
- data/stdlib/uri/ldap.rbs +224 -0
- data/stdlib/uri/ldaps.rbs +108 -0
- data/steep/Gemfile.lock +13 -17
- metadata +12 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 391c185c91da1e233ce83cf4c9cd37f3624bfef9fbb96aa636bf9b42348bd62a
|
4
|
+
data.tar.gz: 21163b54afaf9e6d5a4b7638e29433511bbb3b26c62892ca4a22053d64675baa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 19aa7220827ebae3cbc653622a1041d3a65b463edacd045800d5247e2a3e30cd30cfcd5ce9296abeb03232a0497693803ed84c3e910cd9c62d104a0f59097043
|
7
|
+
data.tar.gz: 8eebfa6339124dc466c23a75fe6b1a90728ce916e8eab4dd8d7442055d2d2bf22fafb696ace169202b6a15888e1a059ac2f6dca25db3953e75b6e88f2b729934
|
data/.github/workflows/ruby.yml
CHANGED
@@ -12,23 +12,23 @@ jobs:
|
|
12
12
|
strategy:
|
13
13
|
matrix:
|
14
14
|
container_tag:
|
15
|
-
- master-nightly-bionic
|
15
|
+
- master-nightly-bionic
|
16
16
|
- 2.6.5-bionic
|
17
17
|
- 2.7.0-bionic
|
18
|
+
job:
|
19
|
+
- test
|
20
|
+
- stdlib_test
|
21
|
+
- rubocop validate test_doc build test_generate_stdlib
|
18
22
|
container:
|
19
23
|
image: rubylang/ruby:${{ matrix.container_tag }}
|
20
24
|
steps:
|
21
25
|
- uses: actions/checkout@v1
|
22
|
-
- name:
|
26
|
+
- name: Install
|
23
27
|
run: |
|
24
28
|
ruby -v
|
25
29
|
gem install bundler
|
26
30
|
bin/setup
|
27
|
-
|
28
|
-
|
29
|
-
bundle exec rake
|
30
|
-
|
31
|
-
bundle exec rake test_doc
|
32
|
-
bundle exec rake build
|
33
|
-
RBS_GENERATE_TEST_PATH=/tmp/Array_test.rb bundle exec rake 'generate:stdlib_test[Array]'
|
34
|
-
ruby -c /tmp/Array_test.rb
|
31
|
+
- name: Run test
|
32
|
+
run: |
|
33
|
+
bundle exec rake ${{ matrix.job }}
|
34
|
+
if: "!(matrix.job == 'stdlib_test' && contains(matrix.container_tag, '2.6.5'))"
|
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,30 @@
|
|
2
2
|
|
3
3
|
## master
|
4
4
|
|
5
|
+
## 0.14.0 (2020-10-17)
|
6
|
+
|
7
|
+
* Allow keyword names ending with `?` and `!` ([#417](https://github.com/ruby/rbs/pull/417))
|
8
|
+
* Make `Range[T]` covariant ([#418](https://github.com/ruby/rbs/pull/418))
|
9
|
+
|
10
|
+
## 0.13.1 (2020-10-09)
|
11
|
+
|
12
|
+
* Fix test for CI of ruby/ruby ([#412](https://github.com/ruby/rbs/pull/412))
|
13
|
+
|
14
|
+
## 0.13.0 (2020-10-09)
|
15
|
+
|
16
|
+
* Signature updates for `URI` classes.
|
17
|
+
* Fix tests ([#410](https://github.com/ruby/rbs/pull/410))
|
18
|
+
* Add `--silent` option for `rbs validate` ([#411](https://github.com/ruby/rbs/pull/411))
|
19
|
+
|
20
|
+
## 0.12.2 (2020-09-17)
|
21
|
+
|
22
|
+
* Minor signature update for `pty`
|
23
|
+
* Fix `PTY` stdlib test
|
24
|
+
|
25
|
+
## 0.12.1 (2020-09-16)
|
26
|
+
|
27
|
+
This version is to improve Ruby 3 testing compatibility. Nothing changed for users.
|
28
|
+
|
5
29
|
## 0.12.0 (2020-09-15)
|
6
30
|
|
7
31
|
* Signature updates for `forwardable`, `struct`, `set`, `URI::Generic`, `URI::File`, and `BigDecimal`.
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -74,7 +74,7 @@ $ rbs method Object then
|
|
74
74
|
|
75
75
|
## Library
|
76
76
|
|
77
|
-
There are two important concepts, _environment_ and _definition_.
|
77
|
+
There are two important concepts, _environment_ and _definition_.
|
78
78
|
|
79
79
|
An _environment_ is a dictionary that keeps track of all declarations. What is the declaration associated with `String` class? An _environment_ will give you the answer.
|
80
80
|
|
@@ -104,8 +104,14 @@ builder = RBS::DefinitionBuilder.new(env: environment)
|
|
104
104
|
|
105
105
|
# Definition of instance of String
|
106
106
|
instance = builder.build_instance(string)
|
107
|
-
|
107
|
+
|
108
|
+
# Print the types of `gsub` method:
|
108
109
|
puts instance.methods[:gsub].method_types.join("\n")
|
110
|
+
# Ouputs =>
|
111
|
+
# (::Regexp | ::string pattern, ::string replacement) -> ::String
|
112
|
+
# (::Regexp | ::string pattern, ::Hash[::String, ::String] hash) -> ::String
|
113
|
+
# (::Regexp | ::string pattern) { (::String match) -> ::_ToS } -> ::String
|
114
|
+
# (::Regexp | ::string pattern) -> ::Enumerator[::String, self]
|
109
115
|
|
110
116
|
# Definition of singleton of String
|
111
117
|
singleton = builder.build_singleton(string)
|
data/Rakefile
CHANGED
@@ -25,19 +25,19 @@ task :test_doc => :parser do
|
|
25
25
|
end
|
26
26
|
|
27
27
|
task :validate => :parser do
|
28
|
-
sh "#{ruby} #{rbs} validate"
|
28
|
+
sh "#{ruby} #{rbs} validate --silent"
|
29
29
|
|
30
30
|
FileList["stdlib/*"].each do |path|
|
31
31
|
next if path =~ %r{stdlib/builtin}
|
32
|
-
sh "#{ruby} #{rbs} -r#{File.basename(path)} validate"
|
32
|
+
sh "#{ruby} #{rbs} -r#{File.basename(path)} validate --silent"
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
36
36
|
FileList["test/stdlib/**/*_test.rb"].each do |test|
|
37
|
-
|
37
|
+
task test => :parser do
|
38
38
|
sh "#{ruby} -Ilib #{bin}/test_runner.rb #{test}"
|
39
39
|
end
|
40
|
-
|
40
|
+
task stdlib_test: test
|
41
41
|
end
|
42
42
|
|
43
43
|
task :rubocop do
|
@@ -176,4 +176,9 @@ namespace :generate do
|
|
176
176
|
end
|
177
177
|
end
|
178
178
|
|
179
|
+
task :test_generate_stdlib do
|
180
|
+
sh "RBS_GENERATE_TEST_PATH=/tmp/Array_test.rb rake 'generate:stdlib_test[Array]'"
|
181
|
+
sh "ruby -c /tmp/Array_test.rb"
|
182
|
+
end
|
183
|
+
|
179
184
|
CLEAN.include("lib/rbs/parser.rb")
|
data/Steepfile
CHANGED
data/bin/annotate-with-rdoc
CHANGED
data/bin/setup
CHANGED
data/bin/test_runner.rb
CHANGED
@@ -2,16 +2,13 @@
|
|
2
2
|
|
3
3
|
$LOAD_PATH << File.join(__dir__, "../lib")
|
4
4
|
|
5
|
-
|
5
|
+
IS_RUBY_27 = Gem::Version.new(RUBY_VERSION).yield_self do |ruby_version|
|
6
6
|
Gem::Version.new('2.7.0') <= ruby_version &&
|
7
7
|
ruby_version <= Gem::Version.new('2.8.0')
|
8
8
|
end
|
9
9
|
|
10
|
-
unless
|
11
|
-
|
12
|
-
STDERR.puts "🚨🚨🚨 stdlib test requires Ruby 2.7 or later but RUBY_VERSION==#{RUBY_VERSION}, exiting... 🚨🚨🚨"
|
13
|
-
exit
|
14
|
-
end
|
10
|
+
unless IS_RUBY_27
|
11
|
+
STDERR.puts "⚠️⚠️⚠️⚠️ stdlib test assumes Ruby 2.7 but RUBY_VERSION==#{RUBY_VERSION} ⚠️⚠️⚠️⚠️"
|
15
12
|
end
|
16
13
|
|
17
14
|
ARGV.each do |arg|
|
data/docs/CONTRIBUTING.md
CHANGED
@@ -17,6 +17,7 @@
|
|
17
17
|
- Use `rbs prototype runtime --merge CLASS_NAME` command to generate the missing method definitions.
|
18
18
|
- Committing the auto generated signatures is recommended.
|
19
19
|
5. Annotate with RDoc.
|
20
|
+
- You'll need RDoc installed. Rvm users should use `rvm docs generate` first.
|
20
21
|
- Use `bin/annotate-with-rdoc stdlib/path/to/signature.rbs` to annotate the RBS files.
|
21
22
|
- Committing the generated annotations is recommended.
|
22
23
|
6. Fix method types and comments.
|
data/goodcheck.yml
CHANGED
@@ -6,12 +6,12 @@ rules:
|
|
6
6
|
- "stdlib/**/*.rbs"
|
7
7
|
fail:
|
8
8
|
- |
|
9
|
-
# arglists 💪👽🚨 << Delete this section
|
10
|
-
# File.absolute_path?(file_name) -> true or false
|
9
|
+
# arglists 💪👽🚨 << Delete this section
|
10
|
+
# File.absolute_path?(file_name) -> true or false
|
11
11
|
#
|
12
12
|
|
13
13
|
- id: rbs.no_arg
|
14
|
-
pattern:
|
14
|
+
pattern:
|
15
15
|
regexp: arg\d+
|
16
16
|
message: |
|
17
17
|
Stop using parameter names like `arg0` or `arg1`
|
@@ -23,7 +23,7 @@ rules:
|
|
23
23
|
- Documents (comments) may contain that pattern.
|
24
24
|
glob:
|
25
25
|
- "stdlib/**/*.rbs"
|
26
|
-
fail:
|
26
|
+
fail:
|
27
27
|
- "def `send`: (String | Symbol arg0, *untyped arg1) -> untyped"
|
28
28
|
pass:
|
29
29
|
- "def `send`: (String | Symbol, *untyped) -> untyped"
|
@@ -62,4 +62,21 @@ rules:
|
|
62
62
|
end
|
63
63
|
end
|
64
64
|
|
65
|
-
|
65
|
+
- id: no_trailing_whitespace
|
66
|
+
pattern:
|
67
|
+
regexp: '[ \t]+$'
|
68
|
+
message: |
|
69
|
+
Trim trailing whitespaces
|
70
|
+
glob:
|
71
|
+
- '**/*.rb'
|
72
|
+
- '**/*.rbs'
|
73
|
+
- '**/*.md'
|
74
|
+
justification:
|
75
|
+
- Let the maintainers know if it is an autogenerated files.
|
76
|
+
pass:
|
77
|
+
- "Hello world"
|
78
|
+
- "Hello\nworld"
|
79
|
+
- "Hello\n\nworld"
|
80
|
+
fail:
|
81
|
+
- "Hello world "
|
82
|
+
- "Hello \nworld"
|
data/lib/rbs/ast/comment.rb
CHANGED
data/lib/rbs/cli.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
require "open3"
|
1
2
|
require "optparse"
|
2
3
|
require "shellwords"
|
3
4
|
|
@@ -383,6 +384,11 @@ Examples:
|
|
383
384
|
|
384
385
|
$ rbs validate
|
385
386
|
EOU
|
387
|
+
|
388
|
+
opts.on("--silent") do
|
389
|
+
require "stringio"
|
390
|
+
@stdout = StringIO.new
|
391
|
+
end
|
386
392
|
end.parse!(args)
|
387
393
|
|
388
394
|
loader = EnvironmentLoader.new()
|
@@ -488,7 +494,7 @@ Show paths to directories where the RBS files are loaded from.
|
|
488
494
|
Examples:
|
489
495
|
|
490
496
|
$ rbs paths
|
491
|
-
$
|
497
|
+
$ rbs -r set paths
|
492
498
|
EOU
|
493
499
|
end.parse!(args)
|
494
500
|
|
@@ -543,7 +549,7 @@ EOU
|
|
543
549
|
Usage: rbs prototype runtime [options...] [pattern...]
|
544
550
|
|
545
551
|
Generate RBS prototype based on runtime introspection.
|
546
|
-
It loads Ruby code specified in [options] and generates RBS prototypes for classes matches to [pattern].
|
552
|
+
It loads Ruby code specified in [options] and generates RBS prototypes for classes matches to [pattern].
|
547
553
|
|
548
554
|
Examples:
|
549
555
|
|
@@ -808,8 +814,10 @@ EOB
|
|
808
814
|
'RBS_TEST_TARGET' => (targets.join(',') unless targets.empty?)
|
809
815
|
}
|
810
816
|
|
811
|
-
|
812
|
-
|
817
|
+
out, err, status = Open3.capture3(env_hash, *args)
|
818
|
+
stdout.print(out)
|
819
|
+
stderr.print(err)
|
820
|
+
status
|
813
821
|
end
|
814
822
|
end
|
815
823
|
end
|
data/lib/rbs/constant.rb
CHANGED
data/lib/rbs/constant_table.rb
CHANGED
@@ -47,6 +47,8 @@ module RBS
|
|
47
47
|
|
48
48
|
head, *tail = split_name(name)
|
49
49
|
|
50
|
+
raise unless head
|
51
|
+
|
50
52
|
head_constant = case
|
51
53
|
when name.absolute?
|
52
54
|
name_to_constant(TypeName.new(name: head, namespace: Namespace.root))
|
@@ -57,11 +59,13 @@ module RBS
|
|
57
59
|
resolve_constant_reference_inherit(head, scopes: constant_scopes(context.first.to_type_name))
|
58
60
|
end
|
59
61
|
|
60
|
-
|
61
|
-
|
62
|
-
resolve_constant_reference_inherit
|
63
|
-
|
64
|
-
|
62
|
+
tail.inject(head_constant) do |constant, name|
|
63
|
+
if constant
|
64
|
+
resolve_constant_reference_inherit(
|
65
|
+
name,
|
66
|
+
scopes: constant_scopes(constant.name),
|
67
|
+
no_object: constant.name != BuiltinNames::Object.name
|
68
|
+
)
|
65
69
|
end
|
66
70
|
end
|
67
71
|
end
|
@@ -150,9 +154,6 @@ module RBS
|
|
150
154
|
when Environment::ModuleEntry
|
151
155
|
constant_scopes0 BuiltinNames::Module.name, scopes: scopes
|
152
156
|
constant_scopes_module name, scopes: scopes
|
153
|
-
|
154
|
-
else
|
155
|
-
raise "Unexpected declaration: #{name} (#{entry.class})"
|
156
157
|
end
|
157
158
|
|
158
159
|
scopes
|
@@ -40,7 +40,7 @@ module RBS
|
|
40
40
|
if s = super_class
|
41
41
|
yield s
|
42
42
|
end
|
43
|
-
|
43
|
+
|
44
44
|
self_types&.each(&block)
|
45
45
|
included_modules&.each(&block)
|
46
46
|
prepended_modules&.each(&block)
|
@@ -303,7 +303,7 @@ module RBS
|
|
303
303
|
mod_ancestors = instance_ancestors(name, building_ancestors: building_ancestors)
|
304
304
|
ancestors.unshift(*mod_ancestors.apply(arg_types, location: entry.primary.decl.location))
|
305
305
|
end
|
306
|
-
end
|
306
|
+
end
|
307
307
|
end
|
308
308
|
|
309
309
|
ancestors.unshift(self_ancestor)
|
@@ -316,7 +316,7 @@ module RBS
|
|
316
316
|
mod_ancestors = instance_ancestors(name, building_ancestors: building_ancestors)
|
317
317
|
ancestors.unshift(*mod_ancestors.apply(arg_types, location: entry.primary.decl.location))
|
318
318
|
end
|
319
|
-
end
|
319
|
+
end
|
320
320
|
end
|
321
321
|
|
322
322
|
building_ancestors.pop
|
@@ -814,8 +814,7 @@ module RBS
|
|
814
814
|
|
815
815
|
methods.each do |name, method|
|
816
816
|
method.method_types.each do |method_type|
|
817
|
-
|
818
|
-
when MethodType
|
817
|
+
unless name == :initialize
|
819
818
|
result = calculator.in_method_type(method_type: method_type, variables: param_names)
|
820
819
|
|
821
820
|
validate_params_with type_params, result: result do |param|
|
data/lib/rbs/environment.rb
CHANGED
@@ -13,7 +13,7 @@ module RBS
|
|
13
13
|
def context
|
14
14
|
@context ||= begin
|
15
15
|
(outer + [decl]).each.with_object([Namespace.root]) do |decl, array|
|
16
|
-
first = array.first or raise
|
16
|
+
first = array.first or raise
|
17
17
|
array.unshift(first + decl.name.to_namespace)
|
18
18
|
end
|
19
19
|
end
|
@@ -258,6 +258,8 @@ module RBS
|
|
258
258
|
outer: outer_,
|
259
259
|
prefix: prefix_
|
260
260
|
)
|
261
|
+
else
|
262
|
+
raise
|
261
263
|
end
|
262
264
|
end,
|
263
265
|
location: decl.location,
|
@@ -288,6 +290,8 @@ module RBS
|
|
288
290
|
outer: outer_,
|
289
291
|
prefix: prefix_
|
290
292
|
)
|
293
|
+
else
|
294
|
+
raise
|
291
295
|
end
|
292
296
|
end,
|
293
297
|
location: decl.location,
|
@@ -9,14 +9,14 @@ module RBS
|
|
9
9
|
end
|
10
10
|
end
|
11
11
|
|
12
|
-
LibraryPath = Struct.new(:name, :path, keyword_init: true)
|
13
|
-
GemPath = Struct.new(:name, :version, :path, keyword_init: true)
|
12
|
+
LibraryPath = _ = Struct.new(:name, :path, keyword_init: true)
|
13
|
+
GemPath = _ = Struct.new(:name, :version, :path, keyword_init: true)
|
14
14
|
|
15
15
|
attr_reader :paths
|
16
16
|
attr_reader :stdlib_root
|
17
17
|
attr_reader :gem_vendor_path
|
18
18
|
|
19
|
-
STDLIB_ROOT = Pathname(__dir__) + "../../stdlib"
|
19
|
+
STDLIB_ROOT = Pathname(_ = __dir__) + "../../stdlib"
|
20
20
|
|
21
21
|
def self.gem_sig_path(name, version)
|
22
22
|
Pathname(Gem::Specification.find_by_name(name, version).gem_dir) + "sig"
|
@@ -50,22 +50,20 @@ module RBS
|
|
50
50
|
end
|
51
51
|
|
52
52
|
def self.parse_library(lib)
|
53
|
-
lib.split(/:/)
|
53
|
+
_ = lib.split(/:/)
|
54
54
|
end
|
55
55
|
|
56
56
|
def stdlib?(name)
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
path
|
61
|
-
end
|
57
|
+
path = stdlib_root + name
|
58
|
+
if path.directory?
|
59
|
+
path
|
62
60
|
end
|
63
61
|
end
|
64
62
|
|
65
63
|
def gem?(name, version)
|
66
|
-
if gem_vendor_path
|
64
|
+
if path = gem_vendor_path
|
67
65
|
# Try vendored RBS first
|
68
|
-
gem_dir =
|
66
|
+
gem_dir = path + name
|
69
67
|
if gem_dir.directory?
|
70
68
|
return gem_dir
|
71
69
|
end
|
@@ -76,7 +74,7 @@ module RBS
|
|
76
74
|
end
|
77
75
|
|
78
76
|
def each_signature(path, immediate: true, &block)
|
79
|
-
if
|
77
|
+
if block
|
80
78
|
case
|
81
79
|
when path.file?
|
82
80
|
if path.extname == ".rbs" || immediate
|
@@ -116,6 +114,7 @@ module RBS
|
|
116
114
|
|
117
115
|
def each_decl
|
118
116
|
if block_given?
|
117
|
+
# @type var signature_files: Array[[path | :stdlib, Pathname]]
|
119
118
|
signature_files = []
|
120
119
|
|
121
120
|
unless no_builtin?
|
@@ -142,6 +141,7 @@ module RBS
|
|
142
141
|
end
|
143
142
|
|
144
143
|
def load(env:)
|
144
|
+
# @type var loadeds: Array[[AST::Declarations::t, Pathname, path | :stdlib]]
|
145
145
|
loadeds = []
|
146
146
|
|
147
147
|
each_decl do |decl, buffer, file_path, lib_path|
|