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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b377a351b9385e3c256fa079584f193232a767df408850e72265db4319346aa9
4
- data.tar.gz: 04a3e0cd339374e9ccc3f0d2d769e564730ad69881c73c4f42ae328db48bcad5
3
+ metadata.gz: 0ab48b069bf534228e48c5c76caeb71daca4dd905a00cbdbfdd0ce7ce9374987
4
+ data.tar.gz: f301b0ce6eff170542931c88095d78ff60ffd5e20720eb04461bdbb3eeb98a8d
5
5
  SHA512:
6
- metadata.gz: e9123353786e09d5869e8621f086ef057d57b21ff8a05ddb6c1be3dffa5dc0d94bc433e0074f0e7b4dff0eb63ed66d300ab11856d536a299f8560ec53912f444
7
- data.tar.gz: 6a12ef064826678ce3a47b6a1d327e8de0b506fd09c100f4f88111afe6b84d11549cf41ef727a70bb9b93e16dd1868a00f3ed7a3e5b9e10578e159a7aafa2c04
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.54", require: false)
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
- "#{file}:#{begin_line}:#{begin_column}-#{end_line}:#{end_column}"
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
- attr_accessor :names
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
- attr_accessor :names
777
+ attr_reader :names
778
778
 
779
779
  sig do
780
780
  params(