rbs 2.8.4 → 3.0.0.dev.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +0 -28
- data/Gemfile +1 -1
- data/Gemfile.lock +16 -16
- data/Rakefile +1 -9
- data/ext/rbs_extension/constants.c +2 -0
- data/ext/rbs_extension/constants.h +1 -0
- data/ext/rbs_extension/extconf.rb +1 -1
- data/ext/rbs_extension/parser.c +23 -13
- data/ext/rbs_extension/ruby_objs.c +15 -3
- data/ext/rbs_extension/ruby_objs.h +2 -1
- data/lib/rbs/ast/members.rb +49 -15
- data/lib/rbs/cli.rb +6 -1
- data/lib/rbs/collection/config/lockfile.rb +115 -0
- data/lib/rbs/collection/config/lockfile_generator.rb +89 -48
- data/lib/rbs/collection/config.rb +11 -39
- data/lib/rbs/collection/installer.rb +9 -13
- data/lib/rbs/collection/sources/base.rb +2 -2
- data/lib/rbs/collection/sources/git.rb +135 -62
- data/lib/rbs/collection/sources/rubygems.rb +10 -12
- data/lib/rbs/collection/sources/stdlib.rb +10 -13
- data/lib/rbs/collection/sources.rb +7 -1
- data/lib/rbs/collection.rb +1 -0
- data/lib/rbs/definition.rb +1 -1
- data/lib/rbs/definition_builder/method_builder.rb +3 -3
- data/lib/rbs/definition_builder.rb +449 -572
- data/lib/rbs/environment.rb +5 -3
- data/lib/rbs/environment_loader.rb +11 -10
- data/lib/rbs/locator.rb +2 -2
- data/lib/rbs/prototype/helpers.rb +29 -13
- data/lib/rbs/prototype/node_usage.rb +99 -0
- data/lib/rbs/prototype/rb.rb +3 -2
- data/lib/rbs/prototype/rbi.rb +6 -4
- data/lib/rbs/prototype/runtime.rb +25 -12
- data/lib/rbs/substitution.rb +19 -0
- data/lib/rbs/types.rb +1 -5
- data/lib/rbs/validator.rb +2 -1
- data/lib/rbs/version.rb +1 -1
- data/lib/rbs/writer.rb +26 -17
- data/lib/rbs.rb +1 -0
- data/lib/rdoc_plugin/parser.rb +1 -1
- data/rbs.gemspec +1 -1
- data/schema/members.json +15 -10
- data/sig/collection/config/lockfile.rbs +80 -0
- data/sig/collection/config/lockfile_generator.rbs +55 -0
- data/sig/collection/config.rbs +5 -48
- data/sig/collection/installer.rbs +1 -1
- data/sig/collection/sources.rbs +66 -29
- data/sig/definition_builder.rbs +94 -81
- data/sig/environment_loader.rbs +1 -1
- data/sig/errors.rbs +21 -0
- data/sig/members.rbs +31 -7
- data/sig/prototype/node_usage.rbs +20 -0
- data/sig/shims/bundler.rbs +13 -0
- data/sig/shims/rubygems.rbs +9 -0
- data/sig/shims.rbs +0 -22
- data/sig/substitution.rbs +6 -0
- data/sig/writer.rbs +2 -0
- data/steep/Gemfile +3 -0
- data/steep/Gemfile.lock +61 -0
- metadata +13 -4
@@ -12,25 +12,22 @@ module RBS
|
|
12
12
|
|
13
13
|
REPO = Repository.default
|
14
14
|
|
15
|
-
def has?(
|
16
|
-
lookup(
|
15
|
+
def has?(name, version)
|
16
|
+
lookup(name, version)
|
17
17
|
end
|
18
18
|
|
19
|
-
def versions(
|
20
|
-
REPO.gems[
|
19
|
+
def versions(name)
|
20
|
+
REPO.gems[name].versions.keys.map(&:to_s)
|
21
21
|
end
|
22
22
|
|
23
|
-
def install(dest:,
|
23
|
+
def install(dest:, name:, version:, stdout:)
|
24
24
|
# Do nothing because stdlib RBS is available by default
|
25
|
-
|
26
|
-
version = config_entry['version'] or raise
|
27
|
-
from = lookup(config_entry)
|
25
|
+
from = lookup(name, version)
|
28
26
|
stdout.puts "Using #{name}:#{version} (#{from})"
|
29
27
|
end
|
30
28
|
|
31
|
-
def manifest_of(
|
32
|
-
|
33
|
-
manifest_path = (lookup(config_entry) or raise).join('manifest.yaml')
|
29
|
+
def manifest_of(name, version)
|
30
|
+
manifest_path = (lookup(name, version) or raise).join('manifest.yaml')
|
34
31
|
YAML.safe_load(manifest_path.read) if manifest_path.exist?
|
35
32
|
end
|
36
33
|
|
@@ -40,8 +37,8 @@ module RBS
|
|
40
37
|
}
|
41
38
|
end
|
42
39
|
|
43
|
-
private def lookup(
|
44
|
-
REPO.lookup(
|
40
|
+
private def lookup(name, version)
|
41
|
+
REPO.lookup(name, version)
|
45
42
|
end
|
46
43
|
end
|
47
44
|
end
|
@@ -11,7 +11,13 @@ module RBS
|
|
11
11
|
def self.from_config_entry(source_entry)
|
12
12
|
case source_entry['type']
|
13
13
|
when 'git', nil # git source by default
|
14
|
-
|
14
|
+
# @type var source_entry: Git::source_entry
|
15
|
+
Git.new(
|
16
|
+
name: source_entry["name"],
|
17
|
+
revision: source_entry["revision"],
|
18
|
+
remote: source_entry["remote"],
|
19
|
+
repo_dir: source_entry["repo_dir"]
|
20
|
+
)
|
15
21
|
when 'stdlib'
|
16
22
|
Stdlib.instance
|
17
23
|
when 'rubygems'
|
data/lib/rbs/collection.rb
CHANGED
@@ -5,6 +5,7 @@ require 'bundler'
|
|
5
5
|
|
6
6
|
require_relative './collection/sources'
|
7
7
|
require_relative './collection/config'
|
8
|
+
require_relative './collection/config/lockfile'
|
8
9
|
require_relative './collection/config/lockfile_generator'
|
9
10
|
require_relative './collection/installer'
|
10
11
|
require_relative './collection/cleaner'
|
data/lib/rbs/definition.rb
CHANGED
@@ -113,14 +113,14 @@ module RBS
|
|
113
113
|
build_method(
|
114
114
|
methods,
|
115
115
|
type,
|
116
|
-
member: member.update(
|
116
|
+
member: member.update(overloads: member.overloads.map {|overload| overload.sub(subst) }),
|
117
117
|
accessibility: member.visibility || accessibility
|
118
118
|
)
|
119
119
|
when :singleton_instance
|
120
120
|
build_method(
|
121
121
|
methods,
|
122
122
|
type,
|
123
|
-
member: member.update(
|
123
|
+
member: member.update(overloads: member.overloads.map {|overload| overload.sub(subst) }),
|
124
124
|
accessibility: :private
|
125
125
|
)
|
126
126
|
end
|
@@ -215,7 +215,7 @@ module RBS
|
|
215
215
|
def build_method(methods, type, member:, accessibility:)
|
216
216
|
defn = methods.methods[member.name] ||= Methods::Definition.empty(type: type, name: member.name)
|
217
217
|
|
218
|
-
if member.
|
218
|
+
if member.overloading?
|
219
219
|
defn.overloads << member
|
220
220
|
else
|
221
221
|
defn.accessibilities << accessibility
|