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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 88fce4a776d172e793f815ac8eee6c6958a140f0657532eb2d792f4caf6d18e1
4
- data.tar.gz: ea01e4a38874e2e9045e8ea528ca595fef2c1da4178e527642cc81078cc31de0
3
+ metadata.gz: bb6fb8a53743efb4df3621e3ab0c7ee9d7ccd5a31ffe0d93ff444176235c8633
4
+ data.tar.gz: 4a2f5ba296d1c251f9af85b3f2e79c7b3306a91814582b1c48edd54a45e05b63
5
5
  SHA512:
6
- metadata.gz: 948f130aa780426a010b991355d2ea3c45bb175b714b97b19094ac52a369cf45be637589e590fa72a3fbebcfe96e58f77979f40e05c90702d60da9ffa90cc8f9
7
- data.tar.gz: bdae9d96ba12457444d6f1073c006b242ca2e683a6414698eee0bfa1ae9da164cb2b5b25337d637d46c55bc989de0a00b4b990d40bdd3fb5d5a79053be677621
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.60", require: false)
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
@@ -70,7 +70,7 @@ module RBI
70
70
  end
71
71
  end
72
72
 
73
- # A Node that can be refered to by a unique ID inside an index
73
+ # A Node that can be referred to by a unique ID inside an index
74
74
  module Indexable
75
75
  extend T::Sig
76
76
  extend T::Helpers
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
@@ -2,5 +2,5 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module RBI
5
- VERSION = "0.1.9"
5
+ VERSION = "0.1.11"
6
6
  end
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.9
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-02-15 00:00:00.000000000 Z
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.25'
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.25'
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.6
96
+ rubygems_version: 3.5.9
97
97
  signing_key:
98
98
  specification_version: 4
99
99
  summary: RBI generation framework