rbi 0.0.17 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/lib/rbi/loc.rb +20 -1
- data/lib/rbi/model.rb +2 -2
- data/lib/rbi/parser.rb +599 -545
- data/lib/rbi/version.rb +1 -1
- metadata +7 -35
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0ab48b069bf534228e48c5c76caeb71daca4dd905a00cbdbfdd0ce7ce9374987
|
4
|
+
data.tar.gz: f301b0ce6eff170542931c88095d78ff60ffd5e20720eb04461bdbb3eeb98a8d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d2f844f5e4d6ec819125d1b91bd40e9af9821f32a4ca76036ccabe5beac985dc566d0cc8d9946ed1488c78115d3a64d798833d13256d829c686df1668353e314
|
7
|
+
data.tar.gz: a1bb0eabd7e81e3563e20bfb35eb0bf2044d152c0019ed78018327d6b60c4897b89a94f4fd741f077e7cb5186a82fbd7cf3c08b3340d2f1caa913b2d773adddc
|
data/Gemfile
CHANGED
@@ -10,7 +10,7 @@ group(:development, :test) do
|
|
10
10
|
gem("minitest")
|
11
11
|
gem("minitest-reporters")
|
12
12
|
gem("rake", "~> 13.0")
|
13
|
-
gem("rubocop", "~> 1.
|
13
|
+
gem("rubocop", "~> 1.56", require: false)
|
14
14
|
gem("rubocop-shopify", require: false)
|
15
15
|
gem("rubocop-sorbet", require: false)
|
16
16
|
gem("sorbet", ">= 0.5.9204", require: false)
|
data/lib/rbi/loc.rb
CHANGED
@@ -5,6 +5,21 @@ module RBI
|
|
5
5
|
class Loc
|
6
6
|
extend T::Sig
|
7
7
|
|
8
|
+
class << self
|
9
|
+
extend T::Sig
|
10
|
+
|
11
|
+
sig { params(file: String, yarp_location: YARP::Location).returns(Loc) }
|
12
|
+
def from_yarp(file, yarp_location)
|
13
|
+
new(
|
14
|
+
file: file,
|
15
|
+
begin_line: yarp_location.start_line,
|
16
|
+
end_line: yarp_location.end_line,
|
17
|
+
begin_column: yarp_location.start_column,
|
18
|
+
end_column: yarp_location.end_column,
|
19
|
+
)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
8
23
|
sig { returns(T.nilable(String)) }
|
9
24
|
attr_reader :file
|
10
25
|
|
@@ -30,7 +45,11 @@ module RBI
|
|
30
45
|
|
31
46
|
sig { returns(String) }
|
32
47
|
def to_s
|
33
|
-
|
48
|
+
if end_line && end_column
|
49
|
+
"#{file}:#{begin_line}:#{begin_column}-#{end_line}:#{end_column}"
|
50
|
+
else
|
51
|
+
"#{file}:#{begin_line}:#{begin_column}"
|
52
|
+
end
|
34
53
|
end
|
35
54
|
|
36
55
|
sig { returns(T.nilable(String)) }
|
data/lib/rbi/model.rb
CHANGED
@@ -353,7 +353,7 @@ module RBI
|
|
353
353
|
abstract!
|
354
354
|
|
355
355
|
sig { returns(T::Array[Symbol]) }
|
356
|
-
|
356
|
+
attr_reader :names
|
357
357
|
|
358
358
|
sig { returns(Visibility) }
|
359
359
|
attr_accessor :visibility
|
@@ -774,7 +774,7 @@ module RBI
|
|
774
774
|
abstract!
|
775
775
|
|
776
776
|
sig { returns(T::Array[String]) }
|
777
|
-
|
777
|
+
attr_reader :names
|
778
778
|
|
779
779
|
sig do
|
780
780
|
params(
|