rbi 0.1.9 → 0.1.10
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 +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4161675b7c71e44d7f0f7ee6b2b6901509bc367ab9d34fdcdca5fb7dfb600cff
|
4
|
+
data.tar.gz: b34c191ab1806649d81e5620dcaf57a86b9a5881a164724f5f900176dde2e0d1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2efc52240df29f1ddffed5daeff5d51c5b63a234d30219b70cf283e7b53086845f23f4438894991f864006198779bfaeea47857b60715086853c5eb321a6762b
|
7
|
+
data.tar.gz: fa1c376c7432db658ec2d8fa356e74dc9c22f55d2035743a7f28a603c4339df9102bfc95dbe6d1d05d18f0a453496836ae568209adbc3736de4bb64ca7e6385c
|
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.10
|
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-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: prism
|
@@ -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.7
|
97
97
|
signing_key:
|
98
98
|
specification_version: 4
|
99
99
|
summary: RBI generation framework
|