rbi 0.1.9 → 0.1.11
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/index.rb +1 -1
- data/lib/rbi/model.rb +78 -0
- data/lib/rbi/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bb6fb8a53743efb4df3621e3ab0c7ee9d7ccd5a31ffe0d93ff444176235c8633
|
4
|
+
data.tar.gz: 4a2f5ba296d1c251f9af85b3f2e79c7b3306a91814582b1c48edd54a45e05b63
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 19808585218a9a3231b3b74df2b6104cd04e7007a37593be4ba90a41850712bc266afeb86801e1ef333226b7fc0b116bc90097a0936c3e52691eb4cfc4849252
|
7
|
+
data.tar.gz: 781eb909a5a681ca1967d06ac43dd5b75c6394e01359dc991357464a95f17768112511fcf8d0757b016559fc6749201c3ebafc20e184da6850ea017425e2b16a
|
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.1")
|
13
|
-
gem("rubocop", "~> 1.
|
13
|
+
gem("rubocop", "~> 1.62", 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/index.rb
CHANGED
data/lib/rbi/model.rb
CHANGED
@@ -534,6 +534,79 @@ module RBI
|
|
534
534
|
@params << param
|
535
535
|
end
|
536
536
|
|
537
|
+
sig { params(name: String).void }
|
538
|
+
def add_param(name)
|
539
|
+
@params << ReqParam.new(name)
|
540
|
+
end
|
541
|
+
|
542
|
+
sig { params(name: String, default_value: String).void }
|
543
|
+
def add_opt_param(name, default_value)
|
544
|
+
@params << OptParam.new(name, default_value)
|
545
|
+
end
|
546
|
+
|
547
|
+
sig { params(name: String).void }
|
548
|
+
def add_rest_param(name)
|
549
|
+
@params << RestParam.new(name)
|
550
|
+
end
|
551
|
+
|
552
|
+
sig { params(name: String).void }
|
553
|
+
def add_kw_param(name)
|
554
|
+
@params << KwParam.new(name)
|
555
|
+
end
|
556
|
+
|
557
|
+
sig { params(name: String, default_value: String).void }
|
558
|
+
def add_kw_opt_param(name, default_value)
|
559
|
+
@params << KwOptParam.new(name, default_value)
|
560
|
+
end
|
561
|
+
|
562
|
+
sig { params(name: String).void }
|
563
|
+
def add_kw_rest_param(name)
|
564
|
+
@params << KwRestParam.new(name)
|
565
|
+
end
|
566
|
+
|
567
|
+
sig { params(name: String).void }
|
568
|
+
def add_block_param(name)
|
569
|
+
@params << BlockParam.new(name)
|
570
|
+
end
|
571
|
+
|
572
|
+
sig do
|
573
|
+
params(
|
574
|
+
params: T::Array[SigParam],
|
575
|
+
return_type: T.nilable(String),
|
576
|
+
is_abstract: T::Boolean,
|
577
|
+
is_override: T::Boolean,
|
578
|
+
is_overridable: T::Boolean,
|
579
|
+
is_final: T::Boolean,
|
580
|
+
type_params: T::Array[String],
|
581
|
+
checked: T.nilable(Symbol),
|
582
|
+
block: T.proc.params(node: Sig).void,
|
583
|
+
).void
|
584
|
+
end
|
585
|
+
def add_sig(
|
586
|
+
params: [],
|
587
|
+
return_type: nil,
|
588
|
+
is_abstract: false,
|
589
|
+
is_override: false,
|
590
|
+
is_overridable: false,
|
591
|
+
is_final: false,
|
592
|
+
type_params: [],
|
593
|
+
checked: nil,
|
594
|
+
&block
|
595
|
+
)
|
596
|
+
sig = Sig.new(
|
597
|
+
params: params,
|
598
|
+
return_type: return_type,
|
599
|
+
is_abstract: is_abstract,
|
600
|
+
is_override: is_override,
|
601
|
+
is_overridable: is_overridable,
|
602
|
+
is_final: is_final,
|
603
|
+
type_params: type_params,
|
604
|
+
checked: checked,
|
605
|
+
&block
|
606
|
+
)
|
607
|
+
@sigs << sig
|
608
|
+
end
|
609
|
+
|
537
610
|
sig { returns(String) }
|
538
611
|
def fully_qualified_name
|
539
612
|
if is_singleton
|
@@ -1085,6 +1158,11 @@ module RBI
|
|
1085
1158
|
@params << param
|
1086
1159
|
end
|
1087
1160
|
|
1161
|
+
sig { params(name: String, type: String).void }
|
1162
|
+
def add_param(name, type)
|
1163
|
+
@params << SigParam.new(name, type)
|
1164
|
+
end
|
1165
|
+
|
1088
1166
|
sig { params(other: Object).returns(T::Boolean) }
|
1089
1167
|
def ==(other)
|
1090
1168
|
return false unless other.is_a?(Sig)
|
data/lib/rbi/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rbi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexandre Terrasa
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-04-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: prism
|
@@ -19,7 +19,7 @@ dependencies:
|
|
19
19
|
version: 0.18.0
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: '0.
|
22
|
+
version: '0.27'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -29,7 +29,7 @@ dependencies:
|
|
29
29
|
version: 0.18.0
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: '0.
|
32
|
+
version: '0.27'
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: sorbet-runtime
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -93,7 +93,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
93
93
|
- !ruby/object:Gem::Version
|
94
94
|
version: '0'
|
95
95
|
requirements: []
|
96
|
-
rubygems_version: 3.5.
|
96
|
+
rubygems_version: 3.5.9
|
97
97
|
signing_key:
|
98
98
|
specification_version: 4
|
99
99
|
summary: RBI generation framework
|