rbs 3.4.4 → 3.5.0.pre.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ruby.yml +7 -0
  3. data/CHANGELOG.md +0 -26
  4. data/Gemfile +12 -1
  5. data/Gemfile.lock +51 -34
  6. data/README.md +2 -1
  7. data/Rakefile +2 -2
  8. data/core/enumerator.rbs +1 -1
  9. data/core/gc.rbs +272 -150
  10. data/core/integer.rbs +4 -3
  11. data/core/io/wait.rbs +4 -4
  12. data/core/io.rbs +10 -3
  13. data/core/kernel.rbs +8 -7
  14. data/core/module.rbs +17 -4
  15. data/core/range.rbs +2 -2
  16. data/core/regexp.rbs +101 -90
  17. data/core/ruby_vm.rbs +103 -103
  18. data/core/string.rbs +3 -3
  19. data/core/symbol.rbs +2 -1
  20. data/core/thread.rbs +1 -1
  21. data/core/time.rbs +24 -4
  22. data/docs/architecture.md +110 -0
  23. data/docs/syntax.md +5 -1
  24. data/ext/rbs_extension/constants.c +2 -0
  25. data/ext/rbs_extension/constants.h +1 -0
  26. data/ext/rbs_extension/location.c +79 -70
  27. data/ext/rbs_extension/location.h +23 -5
  28. data/ext/rbs_extension/parser.c +82 -24
  29. data/ext/rbs_extension/parserstate.c +4 -0
  30. data/ext/rbs_extension/ruby_objs.c +13 -3
  31. data/ext/rbs_extension/ruby_objs.h +1 -0
  32. data/lib/rbs/collection/config.rb +1 -1
  33. data/lib/rbs/collection/sources/git.rb +1 -6
  34. data/lib/rbs/definition_builder/method_builder.rb +1 -1
  35. data/lib/rbs/definition_builder.rb +8 -8
  36. data/lib/rbs/diff.rb +1 -1
  37. data/lib/rbs/environment_loader.rb +2 -1
  38. data/lib/rbs/errors.rb +0 -14
  39. data/lib/rbs/parser_aux.rb +0 -5
  40. data/lib/rbs/prototype/helpers.rb +22 -12
  41. data/lib/rbs/prototype/rb.rb +38 -4
  42. data/lib/rbs/prototype/rbi.rb +30 -20
  43. data/lib/rbs/test/errors.rb +19 -14
  44. data/lib/rbs/test/tester.rb +1 -1
  45. data/lib/rbs/test/type_check.rb +95 -16
  46. data/lib/rbs/types.rb +112 -13
  47. data/lib/rbs/unit_test/spy.rb +1 -1
  48. data/lib/rbs/version.rb +1 -1
  49. data/rbs.gemspec +1 -1
  50. data/sig/environment_loader.rbs +1 -1
  51. data/sig/errors.rbs +1 -1
  52. data/sig/method_types.rbs +3 -3
  53. data/sig/prototype/helpers.rbs +4 -0
  54. data/sig/prototype/rbi.rbs +2 -0
  55. data/sig/types.rbs +54 -4
  56. data/sig/variance_calculator.rbs +2 -2
  57. data/stdlib/csv/0/csv.rbs +4 -1
  58. data/stdlib/fileutils/0/fileutils.rbs +1 -1
  59. data/stdlib/net-http/0/net-http.rbs +29 -27
  60. data/stdlib/socket/0/socket.rbs +2 -2
  61. data/stdlib/timeout/0/timeout.rbs +6 -0
  62. data/stdlib/uri/0/generic.rbs +2 -2
  63. data/stdlib/uri/0/http.rbs +2 -2
  64. metadata +3 -6
  65. data/lib/rbs/parser_compat/lexer_error.rb +0 -6
  66. data/lib/rbs/parser_compat/located_value.rb +0 -7
  67. data/lib/rbs/parser_compat/semantics_error.rb +0 -6
  68. data/lib/rbs/parser_compat/syntax_error.rb +0 -6
@@ -13,6 +13,10 @@ module RBS
13
13
 
14
14
  def keyword_hash?: (node) -> bool
15
15
 
16
+ # Returns a symbol if the node is a symbol literal node
17
+ #
18
+ def symbol_literal_node?: (node) -> Symbol?
19
+
16
20
  def args_from_node: (node?) -> Array[untyped]
17
21
 
18
22
  def untyped: () -> Types::Bases::Any
@@ -1,6 +1,8 @@
1
1
  module RBS
2
2
  module Prototype
3
3
  class RBI
4
+ include Helpers
5
+
4
6
  attr_reader decls: Array[AST::Declarations::t]
5
7
 
6
8
  type module_decl = AST::Declarations::Class | AST::Declarations::Module
data/sig/types.rbs CHANGED
@@ -301,11 +301,16 @@ module RBS
301
301
  end
302
302
 
303
303
  class Record
304
+ attr_reader all_fields: Hash[Symbol, [t, bool]]
305
+
304
306
  attr_reader fields: Hash[Symbol, t]
305
307
 
308
+ attr_reader optional_fields: Hash[Symbol, t]
309
+
306
310
  type loc = Location[bot, bot]
307
311
 
308
312
  def initialize: (fields: Hash[Symbol, t], location: loc?) -> void
313
+ | (all_fields: Hash[Symbol, [t, bool]], location: loc?) -> void
309
314
 
310
315
  include _TypeBase
311
316
 
@@ -443,13 +448,58 @@ module RBS
443
448
  def with_nonreturn_void?: () -> bool
444
449
  end
445
450
 
451
+ # Function type without type checking arguments
452
+ #
453
+ class UntypedFunction
454
+ attr_reader return_type: t
455
+
456
+ def initialize: (return_type: t) -> void
457
+
458
+ def free_variables: (?Set[Symbol]) -> Set[Symbol]
459
+
460
+ def map_type: { (t) -> t } -> UntypedFunction
461
+ | -> Enumerator[t, UntypedFunction]
462
+
463
+ def map_type_name: () { (TypeName, Location[untyped, untyped]?, t) -> TypeName } -> UntypedFunction
464
+
465
+ def each_type: () { (t) -> void } -> void
466
+ | -> Enumerator[t, void]
467
+
468
+ def each_param: () { (Function::Param) -> void } -> void
469
+ | -> Enumerator[Function::Param, void]
470
+
471
+ include _ToJson
472
+
473
+ def sub: (Substitution) -> UntypedFunction
474
+
475
+ def with_return_type: (t) -> UntypedFunction
476
+
477
+ def update: (?return_type: t) -> UntypedFunction
478
+
479
+ def empty?: () -> bool
480
+
481
+ def has_self_type?: () -> bool
482
+
483
+ def has_classish_type?: () -> bool
484
+
485
+ def with_nonreturn_void?: () -> bool
486
+
487
+ # Returns `?`
488
+ def param_to_s: () -> String
489
+
490
+ # Returns `return_type.to_s(1)`
491
+ def return_to_s: () -> String
492
+ end
493
+
494
+ type function = Types::Function | Types::UntypedFunction
495
+
446
496
  class Block
447
- attr_reader type: Types::Function
497
+ attr_reader type: function
448
498
  attr_reader required: bool
449
499
 
450
500
  attr_reader self_type: t?
451
501
 
452
- def initialize: (type: Types::Function, ?self_type: t?, required: boolish) -> void
502
+ def initialize: (type: function, ?self_type: t?, required: boolish) -> void
453
503
 
454
504
  def ==: (untyped other) -> bool
455
505
 
@@ -465,14 +515,14 @@ module RBS
465
515
  end
466
516
 
467
517
  class Proc
468
- attr_reader type: Function
518
+ attr_reader type: function
469
519
  attr_reader block: Block?
470
520
 
471
521
  attr_reader self_type: t?
472
522
 
473
523
  type loc = Location[bot, bot]
474
524
 
475
- def initialize: (location: loc?, type: Function, ?self_type: t?, block: Block?) -> void
525
+ def initialize: (location: loc?, type: function, ?self_type: t?, block: Block?) -> void
476
526
 
477
527
  include _TypeBase
478
528
 
@@ -73,14 +73,14 @@ module RBS
73
73
  def in_inherit: (name: TypeName, args: Array[Types::t], variables: Array[Symbol]) -> Result
74
74
 
75
75
  # The type name must be normalized
76
- #
76
+ #
77
77
  def in_type_alias: (name: TypeName) -> Result
78
78
 
79
79
  private
80
80
 
81
81
  def type: (Types::t, result: Result, context: variance) -> void
82
82
 
83
- def function: (Types::Function, result: Result, context: variance) -> void
83
+ def function: (Types::function, result: Result, context: variance) -> void
84
84
 
85
85
  def negate: (variance) -> variance
86
86
  end
data/stdlib/csv/0/csv.rbs CHANGED
@@ -1722,7 +1722,10 @@ class CSV < Object
1722
1722
  # would read `UTF-32BE` data from the file but transcode it to `UTF-8`
1723
1723
  # before parsing.
1724
1724
  #
1725
- def self.foreach: [U] (String | IO | StringIO path, ?::Hash[Symbol, U] options) { (::Array[String?] arg0) -> void } -> void
1725
+ def self.foreach: (String | IO path, ?String mode, headers: true, **untyped options) { (::CSV::Row arg0) -> void } -> void
1726
+ | (String | IO path, ?String mode, headers: true, **untyped options) -> Enumerator[::CSV::Row, void]
1727
+ | (String | IO path, ?String mode, **untyped options) { (::Array[String?] arg0) -> void } -> void
1728
+ | (String | IO path, ?String mode, **untyped options) -> Enumerator[::Array[String?], void]
1726
1729
 
1727
1730
  # <!--
1728
1731
  # rdoc-file=lib/csv.rb
@@ -1771,5 +1771,5 @@ module FileUtils
1771
1771
  #
1772
1772
  # Related: FileUtils.touch.
1773
1773
  #
1774
- def self?.uptodate?: (path new, pathlist old_list) -> bool
1774
+ def self?.uptodate?: (path new, _Each[path] old_list) -> bool
1775
1775
  end
@@ -1,4 +1,6 @@
1
1
  module Net
2
+ type headers = Hash[String | Symbol, untyped]
3
+
2
4
  class HTTPBadResponse < StandardError
3
5
  end
4
6
 
@@ -775,7 +777,7 @@ module Net
775
777
  # -->
776
778
  # Like Net::HTTP.get, but writes the returned body to $stdout; returns `nil`.
777
779
  #
778
- def self.get_print: (URI::Generic uri, ?Hash[String, untyped] header) -> void
780
+ def self.get_print: (URI::Generic uri, ?headers header) -> void
779
781
  | (String host, String path, ?Integer port) -> void
780
782
 
781
783
  # <!--
@@ -811,7 +813,7 @@ module Net
811
813
  # * Net::HTTP::Get: request class for HTTP method `GET`.
812
814
  # * Net::HTTP#get: convenience method for HTTP method `GET`.
813
815
  #
814
- def self.get: (URI::Generic uri, ?Hash[String, untyped] header) -> String
816
+ def self.get: (URI::Generic uri, ?headers header) -> String
815
817
  | (String host, String path, ?Integer port) -> String
816
818
 
817
819
  # <!--
@@ -822,7 +824,7 @@ module Net
822
824
  # Like Net::HTTP.get, but returns a Net::HTTPResponse object instead of the body
823
825
  # string.
824
826
  #
825
- def self.get_response: (URI::Generic uri, ?Hash[String, untyped] header) ?{ (Net::HTTPResponse) -> void } -> Net::HTTPResponse
827
+ def self.get_response: (URI::Generic uri, ?headers header) ?{ (Net::HTTPResponse) -> void } -> Net::HTTPResponse
826
828
  | (String host, String path, ?Integer port) -> Net::HTTPResponse
827
829
 
828
830
  # <!--
@@ -854,7 +856,7 @@ module Net
854
856
  # * Net::HTTP::Post: request class for HTTP method `POST`.
855
857
  # * Net::HTTP#post: convenience method for HTTP method `POST`.
856
858
  #
857
- def self.post: (URI::Generic url, String data, ?Hash[String, untyped] header) -> Net::HTTPResponse
859
+ def self.post: (URI::Generic url, String data, ?headers header) -> Net::HTTPResponse
858
860
 
859
861
  # <!--
860
862
  # rdoc-file=lib/net/http.rb
@@ -1613,7 +1615,7 @@ module Net
1613
1615
  # * Net::HTTP::Get: request class for HTTP method GET.
1614
1616
  # * Net::HTTP.get: sends GET request, returns response body.
1615
1617
  #
1616
- def get: (String path, ?Hash[String, untyped] initheader, ?bot dest) ?{ (String body_segment) -> void } -> Net::HTTPResponse
1618
+ def get: (String path, ?headers initheader, ?bot dest) ?{ (String body_segment) -> void } -> Net::HTTPResponse
1617
1619
 
1618
1620
  # <!--
1619
1621
  # rdoc-file=lib/net/http.rb
@@ -1633,7 +1635,7 @@ module Net
1633
1635
  # ["content-type", ["application/json; charset=utf-8"]],
1634
1636
  # ["connection", ["close"]]]
1635
1637
  #
1636
- def head: (String path, ?Hash[String, untyped] initheader) -> Net::HTTPResponse
1638
+ def head: (String path, ?headers initheader) -> Net::HTTPResponse
1637
1639
 
1638
1640
  # <!--
1639
1641
  # rdoc-file=lib/net/http.rb
@@ -1666,7 +1668,7 @@ module Net
1666
1668
  # * Net::HTTP::Post: request class for HTTP method POST.
1667
1669
  # * Net::HTTP.post: sends POST request, returns response body.
1668
1670
  #
1669
- def post: (String path, String data, ?Hash[String, untyped] initheader, ?bot dest) ?{ (String body_segment) -> void } -> Net::HTTPResponse
1671
+ def post: (String path, String data, ?headers initheader, ?bot dest) ?{ (String body_segment) -> void } -> Net::HTTPResponse
1670
1672
 
1671
1673
  # <!--
1672
1674
  # rdoc-file=lib/net/http.rb
@@ -1694,7 +1696,7 @@ module Net
1694
1696
  #
1695
1697
  # http.patch('/todos/1', data) # => #<Net::HTTPCreated 201 Created readbody=true>
1696
1698
  #
1697
- def patch: (String path, String data, ?Hash[String, untyped] initheader, ?bot dest) ?{ (String body_segment) -> void } -> Net::HTTPResponse
1699
+ def patch: (String path, String data, ?headers initheader, ?bot dest) ?{ (String body_segment) -> void } -> Net::HTTPResponse
1698
1700
 
1699
1701
  # <!--
1700
1702
  # rdoc-file=lib/net/http.rb
@@ -1710,7 +1712,7 @@ module Net
1710
1712
  # http = Net::HTTP.new(hostname)
1711
1713
  # http.put('/todos/1', data) # => #<Net::HTTPOK 200 OK readbody=true>
1712
1714
  #
1713
- def put: (String path, String data, ?Hash[String, untyped] initheader) -> Net::HTTPResponse
1715
+ def put: (String path, String data, ?headers initheader) -> Net::HTTPResponse
1714
1716
 
1715
1717
  # <!--
1716
1718
  # rdoc-file=lib/net/http.rb
@@ -1726,7 +1728,7 @@ module Net
1726
1728
  # http = Net::HTTP.new(hostname)
1727
1729
  # http.proppatch('/todos/1', data)
1728
1730
  #
1729
- def proppatch: (String path, String body, ?Hash[String, untyped] initheader) -> Net::HTTPResponse
1731
+ def proppatch: (String path, String body, ?headers initheader) -> Net::HTTPResponse
1730
1732
 
1731
1733
  # <!--
1732
1734
  # rdoc-file=lib/net/http.rb
@@ -1742,7 +1744,7 @@ module Net
1742
1744
  # http = Net::HTTP.new(hostname)
1743
1745
  # http.lock('/todos/1', data)
1744
1746
  #
1745
- def lock: (String path, String body, ?Hash[String, untyped] initheader) -> Net::HTTPResponse
1747
+ def lock: (String path, String body, ?headers initheader) -> Net::HTTPResponse
1746
1748
 
1747
1749
  # <!--
1748
1750
  # rdoc-file=lib/net/http.rb
@@ -1758,7 +1760,7 @@ module Net
1758
1760
  # http = Net::HTTP.new(hostname)
1759
1761
  # http.unlock('/todos/1', data)
1760
1762
  #
1761
- def unlock: (String path, String body, ?Hash[String, untyped] initheader) -> Net::HTTPResponse
1763
+ def unlock: (String path, String body, ?headers initheader) -> Net::HTTPResponse
1762
1764
 
1763
1765
  # <!--
1764
1766
  # rdoc-file=lib/net/http.rb
@@ -1773,7 +1775,7 @@ module Net
1773
1775
  # http = Net::HTTP.new(hostname)
1774
1776
  # http.options('/')
1775
1777
  #
1776
- def options: (String path, ?Hash[String, untyped] initheader) -> Net::HTTPResponse
1778
+ def options: (String path, ?headers initheader) -> Net::HTTPResponse
1777
1779
 
1778
1780
  # <!--
1779
1781
  # rdoc-file=lib/net/http.rb
@@ -1789,7 +1791,7 @@ module Net
1789
1791
  # http = Net::HTTP.new(hostname)
1790
1792
  # http.propfind('/todos/1', data)
1791
1793
  #
1792
- def propfind: (String path, ?untyped? body, ?Hash[String, untyped] initheader) -> Net::HTTPResponse
1794
+ def propfind: (String path, ?untyped? body, ?headers initheader) -> Net::HTTPResponse
1793
1795
 
1794
1796
  # <!--
1795
1797
  # rdoc-file=lib/net/http.rb
@@ -1804,7 +1806,7 @@ module Net
1804
1806
  # http = Net::HTTP.new(hostname)
1805
1807
  # http.delete('/todos/1')
1806
1808
  #
1807
- def delete: (String path, ?Hash[String, untyped] initheader) -> Net::HTTPResponse
1809
+ def delete: (String path, ?headers initheader) -> Net::HTTPResponse
1808
1810
 
1809
1811
  # <!--
1810
1812
  # rdoc-file=lib/net/http.rb
@@ -1819,7 +1821,7 @@ module Net
1819
1821
  # http = Net::HTTP.new(hostname)
1820
1822
  # http.move('/todos/1')
1821
1823
  #
1822
- def move: (String path, ?Hash[String, untyped] initheader) -> Net::HTTPResponse
1824
+ def move: (String path, ?headers initheader) -> Net::HTTPResponse
1823
1825
 
1824
1826
  # <!--
1825
1827
  # rdoc-file=lib/net/http.rb
@@ -1834,7 +1836,7 @@ module Net
1834
1836
  # http = Net::HTTP.new(hostname)
1835
1837
  # http.copy('/todos/1')
1836
1838
  #
1837
- def copy: (String path, ?Hash[String, untyped] initheader) -> Net::HTTPResponse
1839
+ def copy: (String path, ?headers initheader) -> Net::HTTPResponse
1838
1840
 
1839
1841
  # <!--
1840
1842
  # rdoc-file=lib/net/http.rb
@@ -1850,7 +1852,7 @@ module Net
1850
1852
  # http.mkcol('/todos/1', data)
1851
1853
  # http = Net::HTTP.new(hostname)
1852
1854
  #
1853
- def mkcol: (String path, ?untyped? body, ?Hash[String, untyped] initheader) -> Net::HTTPResponse
1855
+ def mkcol: (String path, ?untyped? body, ?headers initheader) -> Net::HTTPResponse
1854
1856
 
1855
1857
  # <!--
1856
1858
  # rdoc-file=lib/net/http.rb
@@ -1865,7 +1867,7 @@ module Net
1865
1867
  # http = Net::HTTP.new(hostname)
1866
1868
  # http.trace('/todos/1')
1867
1869
  #
1868
- def trace: (String path, ?Hash[String, untyped] initheader) -> Net::HTTPResponse
1870
+ def trace: (String path, ?headers initheader) -> Net::HTTPResponse
1869
1871
 
1870
1872
  # <!--
1871
1873
  # rdoc-file=lib/net/http.rb
@@ -1893,7 +1895,7 @@ module Net
1893
1895
  #
1894
1896
  # #<Net::HTTPOK 200 OK readbody=false>
1895
1897
  #
1896
- def request_get: (String path, ?Hash[String, untyped] initheader) ?{ (Net::HTTPResponse response) -> void } -> Net::HTTPResponse
1898
+ def request_get: (String path, ?headers initheader) ?{ (Net::HTTPResponse response) -> void } -> Net::HTTPResponse
1897
1899
 
1898
1900
  # <!--
1899
1901
  # rdoc-file=lib/net/http.rb
@@ -1908,7 +1910,7 @@ module Net
1908
1910
  # http = Net::HTTP.new(hostname)
1909
1911
  # http.head('/todos/1') # => #<Net::HTTPOK 200 OK readbody=true>
1910
1912
  #
1911
- def request_head: (String path, ?Hash[String, untyped] initheader) ?{ (Net::HTTPResponse response) -> void } -> Net::HTTPResponse
1913
+ def request_head: (String path, ?headers initheader) ?{ (Net::HTTPResponse response) -> void } -> Net::HTTPResponse
1912
1914
 
1913
1915
  # <!--
1914
1916
  # rdoc-file=lib/net/http.rb
@@ -1937,9 +1939,9 @@ module Net
1937
1939
  #
1938
1940
  # "{\n \"xyzzy\": \"\",\n \"id\": 201\n}"
1939
1941
  #
1940
- def request_post: (String path, String data, ?Hash[String, untyped] initheader) ?{ (Net::HTTPResponse response) -> void } -> Net::HTTPResponse
1942
+ def request_post: (String path, String data, ?headers initheader) ?{ (Net::HTTPResponse response) -> void } -> Net::HTTPResponse
1941
1943
 
1942
- def request_put: (String path, String data, ?Hash[String, untyped] initheader) ?{ (Net::HTTPResponse response) -> void } -> Net::HTTPResponse
1944
+ def request_put: (String path, String data, ?headers initheader) ?{ (Net::HTTPResponse response) -> void } -> Net::HTTPResponse
1943
1945
 
1944
1946
  # <!--
1945
1947
  # rdoc-file=lib/net/http.rb
@@ -1987,7 +1989,7 @@ module Net
1987
1989
  # http.send_request('POST', '/todos', 'xyzzy')
1988
1990
  # # => #<Net::HTTPCreated 201 Created readbody=true>
1989
1991
  #
1990
- def send_request: (String name, String path, ?String? data, ?Hash[String, untyped]? header) -> Net::HTTPResponse
1992
+ def send_request: (String name, String path, ?String? data, ?headers? header) -> Net::HTTPResponse
1991
1993
 
1992
1994
  # <!--
1993
1995
  # rdoc-file=lib/net/http.rb
@@ -2076,7 +2078,7 @@ module Net
2076
2078
  # - new(m, reqbody, resbody, uri_or_path, initheader = nil)
2077
2079
  # -->
2078
2080
  #
2079
- def initialize: (String m, boolish reqbody, boolish resbody, URI::Generic | String uri_or_path, ?Hash[String, untyped] initheader) -> Net::HTTP
2081
+ def initialize: (String m, boolish reqbody, boolish resbody, URI::Generic | String uri_or_path, ?headers initheader) -> Net::HTTP
2080
2082
 
2081
2083
  # <!-- rdoc-file=lib/net/http/generic_request.rb -->
2082
2084
  # Returns the string method name for the request:
@@ -3288,8 +3290,8 @@ module Net
3288
3290
  # to enable compression of the response body unless Accept-Encoding or Range are
3289
3291
  # supplied in `initheader`.
3290
3292
  #
3291
- def initialize: (String path, ?Hash[String, untyped] initheader) -> void
3292
- | (URI::Generic uri, ?Hash[String, untyped] initheader) -> void
3293
+ def initialize: (String path, ?headers initheader) -> void
3294
+ | (URI::Generic uri, ?headers initheader) -> void
3293
3295
  end
3294
3296
 
3295
3297
  # <!-- rdoc-file=lib/net/http/requests.rb -->
@@ -482,8 +482,8 @@ class Socket < BasicSocket
482
482
  # puts sock.read
483
483
  # }
484
484
  #
485
- def self.tcp: (String host, Integer port, ?String local_host, ?Integer local_port, ?resolv_timeout: Numeric, ?connect_timeout: Numeric) -> instance
486
- | (String host, Integer port, ?String local_host, ?Integer local_port, ?resolv_timeout: Numeric, ?connect_timeout: Numeric) { (instance) -> void } -> void
485
+ def self.tcp: (String host, Integer port, ?String local_host, ?Integer local_port, ?resolv_timeout: Time::_Timeout, ?connect_timeout: Time::_Timeout) -> instance
486
+ | (String host, Integer port, ?String local_host, ?Integer local_port, ?resolv_timeout: Time::_Timeout, ?connect_timeout: Time::_Timeout) { (instance) -> void } -> void
487
487
 
488
488
  # <!--
489
489
  # rdoc-file=ext/socket/lib/socket.rb
@@ -62,6 +62,12 @@ module Timeout
62
62
  def self?.timeout: [T] (Numeric? sec, ?singleton(Exception) klass, ?String message) { (Numeric sec) -> T } -> T
63
63
  end
64
64
 
65
+ # <!-- rdoc-file=lib/timeout.rb -->
66
+ # Internal error raised to when a timeout is triggered.
67
+ #
68
+ class Timeout::ExitException < Exception
69
+ end
70
+
65
71
  # <!-- rdoc-file=lib/timeout.rb -->
66
72
  # Raised by Timeout.timeout when the block times out.
67
73
  #
@@ -154,7 +154,7 @@ module URI
154
154
  # then it does URI::Escape.escape all URI components and tries again.
155
155
  #
156
156
  def self.build2: (Array[nil | String | Integer]) -> URI::Generic
157
- | ({ scheme: String?, userinfo: String?, host: String?, port: Integer?, registry: String?, path: String?, opaque: String?, query: String?, fragment: String? }) -> URI::Generic
157
+ | ({ scheme: String?, userinfo: String?, host: String?, port: Integer?, registry: String?, path: String?, opaque: String?, query: String?, fragment: String? }) -> instance
158
158
 
159
159
  # <!--
160
160
  # rdoc-file=lib/uri/generic.rb
@@ -172,7 +172,7 @@ module URI
172
172
  # See ::new for hash keys to use or for order of array items.
173
173
  #
174
174
  def self.build: (Array[nil | String | Integer]) -> URI::Generic
175
- | ({ scheme: String?, userinfo: String?, host: String?, port: Integer?, registry: String?, path: String?, opaque: String?, query: String?, fragment: String? }) -> URI::Generic
175
+ | ({ scheme: String?, userinfo: String?, host: String?, port: Integer?, registry: String?, path: String?, opaque: String?, query: String?, fragment: String? }) -> instance
176
176
 
177
177
  # <!--
178
178
  # rdoc-file=lib/uri/generic.rb
@@ -45,8 +45,8 @@ module URI
45
45
  # Currently, if passed userinfo components this method generates invalid HTTP
46
46
  # URIs as per RFC 1738.
47
47
  #
48
- def self.build: (Array[String | Integer] args) -> URI::HTTP
49
- | ({ userinfo: String?, host: String?, port: Integer?, path: String?, query: String?, fragment: String? }) -> URI::HTTP
48
+ def self.build: (Array[String | Integer] args) -> instance
49
+ | ({ userinfo: String?, host: String?, port: Integer?, path: String?, query: String?, fragment: String? }) -> instance
50
50
 
51
51
  # <!--
52
52
  # rdoc-file=lib/uri/http.rb
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbs
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.4.4
4
+ version: 3.5.0.pre.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Soutaro Matsumoto
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-02-08 00:00:00.000000000 Z
11
+ date: 2024-04-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: abbrev
@@ -132,6 +132,7 @@ files:
132
132
  - core/unbound_method.rbs
133
133
  - core/warning.rbs
134
134
  - docs/CONTRIBUTING.md
135
+ - docs/architecture.md
135
136
  - docs/collection.md
136
137
  - docs/data_and_struct.md
137
138
  - docs/gem.md
@@ -210,10 +211,6 @@ files:
210
211
  - lib/rbs/method_type.rb
211
212
  - lib/rbs/namespace.rb
212
213
  - lib/rbs/parser_aux.rb
213
- - lib/rbs/parser_compat/lexer_error.rb
214
- - lib/rbs/parser_compat/located_value.rb
215
- - lib/rbs/parser_compat/semantics_error.rb
216
- - lib/rbs/parser_compat/syntax_error.rb
217
214
  - lib/rbs/prototype/helpers.rb
218
215
  - lib/rbs/prototype/node_usage.rb
219
216
  - lib/rbs/prototype/rb.rb
@@ -1,6 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- RBS.print_warning {
4
- "RBS::Parser::LexerError is deprecated and will be deleted in RBS 2.0."
5
- }
6
- RBS::Parser::LexerError = RBS::ParsingError
@@ -1,7 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- RBS.print_warning {
4
- "RBS::Parser::LocatedValue is deprecated and will be deleted in RBS 2.0."
5
- }
6
- class RBS::Parser::LocatedValue
7
- end
@@ -1,6 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- RBS.print_warning {
4
- "RBS::Parser::SemanticsError is deprecated and will be deleted in RBS 2.0."
5
- }
6
- RBS::Parser::SemanticsError = RBS::ParsingError
@@ -1,6 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- RBS.print_warning {
4
- "RBS::Parser::SyntaxError is deprecated and will be deleted in RBS 2.0."
5
- }
6
- RBS::Parser::SyntaxError = RBS::ParsingError