rbi 0.1.13 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +2 -2
- data/lib/rbi/formatter.rb +4 -16
- data/lib/rbi/index.rb +1 -1
- data/lib/rbi/model.rb +38 -36
- data/lib/rbi/parser.rb +90 -53
- data/lib/rbi/printer.rb +512 -611
- data/lib/rbi/rewriters/attr_to_methods.rb +169 -0
- data/lib/rbi/rewriters/flatten_singleton_methods.rb +65 -0
- data/lib/rbi/rewriters/flatten_visibilities.rb +65 -0
- data/lib/rbi/rewriters/group_nodes.rb +46 -47
- data/lib/rbi/rewriters/merge_trees.rb +15 -45
- data/lib/rbi/rewriters/{nest_non_public_methods.rb → nest_non_public_members.rb} +4 -4
- data/lib/rbi/rewriters/nest_top_level_members.rb +68 -0
- data/lib/rbi/type.rb +765 -0
- data/lib/rbi/type_parser.rb +320 -0
- data/lib/rbi/type_visitor.rb +112 -0
- data/lib/rbi/version.rb +1 -1
- data/lib/rbi/visitor.rb +228 -2
- data/lib/rbi.rb +15 -1
- metadata +19 -18
data/lib/rbi.rb
CHANGED
@@ -3,21 +3,35 @@
|
|
3
3
|
|
4
4
|
require "sorbet-runtime"
|
5
5
|
require "stringio"
|
6
|
+
|
7
|
+
module RBI
|
8
|
+
class Error < StandardError
|
9
|
+
extend T::Sig
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
6
13
|
require "rbi/loc"
|
7
14
|
require "rbi/model"
|
15
|
+
require "rbi/type"
|
8
16
|
require "rbi/visitor"
|
9
17
|
require "rbi/index"
|
10
18
|
require "rbi/rewriters/add_sig_templates"
|
11
19
|
require "rbi/rewriters/annotate"
|
12
20
|
require "rbi/rewriters/deannotate"
|
13
21
|
require "rbi/rewriters/filter_versions"
|
22
|
+
require "rbi/rewriters/flatten_singleton_methods"
|
23
|
+
require "rbi/rewriters/flatten_visibilities"
|
14
24
|
require "rbi/rewriters/merge_trees"
|
25
|
+
require "rbi/rewriters/nest_non_public_members"
|
15
26
|
require "rbi/rewriters/nest_singleton_methods"
|
16
|
-
require "rbi/rewriters/
|
27
|
+
require "rbi/rewriters/nest_top_level_members"
|
17
28
|
require "rbi/rewriters/group_nodes"
|
18
29
|
require "rbi/rewriters/remove_known_definitions"
|
30
|
+
require "rbi/rewriters/attr_to_methods"
|
19
31
|
require "rbi/rewriters/sort_nodes"
|
20
32
|
require "rbi/parser"
|
33
|
+
require "rbi/type_parser"
|
34
|
+
require "rbi/type_visitor"
|
21
35
|
require "rbi/printer"
|
22
36
|
require "rbi/formatter"
|
23
37
|
require "rbi/version"
|
metadata
CHANGED
@@ -1,35 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rbi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexandre Terrasa
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-08-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: prism
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: 0.18.0
|
20
|
-
- - "<"
|
17
|
+
- - "~>"
|
21
18
|
- !ruby/object:Gem::Version
|
22
|
-
version: 1.0
|
19
|
+
version: '1.0'
|
23
20
|
type: :runtime
|
24
21
|
prerelease: false
|
25
22
|
version_requirements: !ruby/object:Gem::Requirement
|
26
23
|
requirements:
|
27
|
-
- - "
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
version: 0.18.0
|
30
|
-
- - "<"
|
24
|
+
- - "~>"
|
31
25
|
- !ruby/object:Gem::Version
|
32
|
-
version: 1.0
|
26
|
+
version: '1.0'
|
33
27
|
- !ruby/object:Gem::Dependency
|
34
28
|
name: sorbet-runtime
|
35
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -44,7 +38,7 @@ dependencies:
|
|
44
38
|
- - ">="
|
45
39
|
- !ruby/object:Gem::Version
|
46
40
|
version: 0.5.9204
|
47
|
-
description:
|
41
|
+
description:
|
48
42
|
email:
|
49
43
|
- ruby@shopify.com
|
50
44
|
executables: []
|
@@ -63,14 +57,21 @@ files:
|
|
63
57
|
- lib/rbi/printer.rb
|
64
58
|
- lib/rbi/rewriters/add_sig_templates.rb
|
65
59
|
- lib/rbi/rewriters/annotate.rb
|
60
|
+
- lib/rbi/rewriters/attr_to_methods.rb
|
66
61
|
- lib/rbi/rewriters/deannotate.rb
|
67
62
|
- lib/rbi/rewriters/filter_versions.rb
|
63
|
+
- lib/rbi/rewriters/flatten_singleton_methods.rb
|
64
|
+
- lib/rbi/rewriters/flatten_visibilities.rb
|
68
65
|
- lib/rbi/rewriters/group_nodes.rb
|
69
66
|
- lib/rbi/rewriters/merge_trees.rb
|
70
|
-
- lib/rbi/rewriters/
|
67
|
+
- lib/rbi/rewriters/nest_non_public_members.rb
|
71
68
|
- lib/rbi/rewriters/nest_singleton_methods.rb
|
69
|
+
- lib/rbi/rewriters/nest_top_level_members.rb
|
72
70
|
- lib/rbi/rewriters/remove_known_definitions.rb
|
73
71
|
- lib/rbi/rewriters/sort_nodes.rb
|
72
|
+
- lib/rbi/type.rb
|
73
|
+
- lib/rbi/type_parser.rb
|
74
|
+
- lib/rbi/type_visitor.rb
|
74
75
|
- lib/rbi/version.rb
|
75
76
|
- lib/rbi/visitor.rb
|
76
77
|
homepage: https://github.com/Shopify/rbi
|
@@ -78,7 +79,7 @@ licenses:
|
|
78
79
|
- MIT
|
79
80
|
metadata:
|
80
81
|
allowed_push_host: https://rubygems.org
|
81
|
-
post_install_message:
|
82
|
+
post_install_message:
|
82
83
|
rdoc_options: []
|
83
84
|
require_paths:
|
84
85
|
- lib
|
@@ -93,8 +94,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
93
94
|
- !ruby/object:Gem::Version
|
94
95
|
version: '0'
|
95
96
|
requirements: []
|
96
|
-
rubygems_version: 3.5.
|
97
|
-
signing_key:
|
97
|
+
rubygems_version: 3.5.17
|
98
|
+
signing_key:
|
98
99
|
specification_version: 4
|
99
100
|
summary: RBI generation framework
|
100
101
|
test_files: []
|