rbs 3.2.2 → 3.3.0.pre.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (125) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/comments.yml +1 -1
  3. data/.github/workflows/ruby.yml +7 -2
  4. data/CHANGELOG.md +85 -0
  5. data/Gemfile.lock +14 -14
  6. data/README.md +11 -2
  7. data/Rakefile +10 -7
  8. data/Steepfile +7 -7
  9. data/core/basic_object.rbs +7 -7
  10. data/core/binding.rbs +3 -3
  11. data/core/builtin.rbs +171 -5
  12. data/core/constants.rbs +17 -17
  13. data/core/dir.rbs +3 -3
  14. data/core/encoding.rbs +434 -628
  15. data/core/enumerator.rbs +37 -0
  16. data/core/exception.rbs +11 -11
  17. data/core/false_class.rbs +5 -11
  18. data/core/fiber.rbs +3 -3
  19. data/core/file_test.rbs +28 -26
  20. data/core/kernel.rbs +900 -21
  21. data/core/marshal.rbs +24 -14
  22. data/core/match_data.rbs +8 -8
  23. data/core/math.rbs +57 -53
  24. data/core/method.rbs +3 -1
  25. data/core/module.rbs +38 -36
  26. data/core/nil_class.rbs +7 -13
  27. data/core/object.rbs +3 -966
  28. data/core/process.rbs +3 -3
  29. data/core/ractor.rbs +2 -2
  30. data/core/rb_config.rbs +64 -43
  31. data/core/regexp.rbs +3 -3
  32. data/core/signal.rbs +10 -4
  33. data/core/struct.rbs +1 -1
  34. data/core/thread.rbs +7 -7
  35. data/core/thread_group.rbs +9 -9
  36. data/core/true_class.rbs +5 -11
  37. data/core/unbound_method.rbs +56 -7
  38. data/core/warning.rbs +33 -0
  39. data/docs/collection.md +56 -6
  40. data/docs/data_and_struct.md +57 -0
  41. data/docs/stdlib.md +61 -2
  42. data/docs/syntax.md +123 -2
  43. data/ext/rbs_extension/lexer.c +624 -569
  44. data/ext/rbs_extension/lexer.h +1 -0
  45. data/ext/rbs_extension/lexer.re +1 -0
  46. data/ext/rbs_extension/lexstate.c +1 -0
  47. data/ext/rbs_extension/parser.c +6 -0
  48. data/goodcheck.yml +2 -2
  49. data/lib/rbs/annotate/formatter.rb +13 -3
  50. data/lib/rbs/annotate/rdoc_source.rb +10 -1
  51. data/lib/rbs/cli/colored_io.rb +48 -0
  52. data/lib/rbs/cli/diff.rb +80 -0
  53. data/lib/rbs/cli.rb +151 -16
  54. data/lib/rbs/collection/config/lockfile.rb +0 -25
  55. data/lib/rbs/collection/config/lockfile_generator.rb +0 -6
  56. data/lib/rbs/collection/installer.rb +1 -1
  57. data/lib/rbs/collection/sources/git.rb +6 -4
  58. data/lib/rbs/collection/sources/local.rb +7 -5
  59. data/lib/rbs/diff.rb +104 -0
  60. data/lib/rbs/environment.rb +1 -1
  61. data/lib/rbs/method_type.rb +23 -0
  62. data/lib/rbs/prototype/rb.rb +2 -9
  63. data/lib/rbs/prototype/runtime/helpers.rb +59 -0
  64. data/lib/rbs/prototype/runtime/value_object_generator.rb +236 -0
  65. data/lib/rbs/prototype/runtime.rb +234 -150
  66. data/lib/rbs/sorter.rb +144 -117
  67. data/lib/rbs/test/guaranteed.rb +31 -0
  68. data/lib/rbs/test/type_check.rb +4 -4
  69. data/lib/rbs/test.rb +3 -0
  70. data/lib/rbs/types.rb +184 -3
  71. data/lib/rbs/version.rb +1 -1
  72. data/lib/rbs/writer.rb +4 -4
  73. data/lib/rbs.rb +1 -0
  74. data/rbs.gemspec +1 -0
  75. data/sig/annotate/formatter.rbs +2 -2
  76. data/sig/annotate/rdoc_annotater.rbs +1 -1
  77. data/sig/cli/colored_io.rbs +15 -0
  78. data/sig/cli/diff.rbs +21 -0
  79. data/sig/cli.rbs +2 -0
  80. data/sig/collection/config/lockfile.rbs +0 -6
  81. data/sig/diff.rbs +23 -0
  82. data/sig/errors.rbs +1 -5
  83. data/sig/method_types.rbs +6 -0
  84. data/sig/prototype/runtime.rbs +108 -0
  85. data/sig/rdoc/rbs.rbs +4 -0
  86. data/sig/shims/bundler.rbs +5 -0
  87. data/sig/sorter.rbs +23 -5
  88. data/sig/types.rbs +29 -0
  89. data/stdlib/benchmark/0/benchmark.rbs +1 -1
  90. data/stdlib/cgi/0/core.rbs +2 -2
  91. data/stdlib/did_you_mean/0/did_you_mean.rbs +2 -2
  92. data/stdlib/digest/0/digest.rbs +1 -1
  93. data/stdlib/fileutils/0/fileutils.rbs +1 -1
  94. data/stdlib/forwardable/0/forwardable.rbs +4 -4
  95. data/stdlib/io-console/0/io-console.rbs +1 -1
  96. data/stdlib/json/0/json.rbs +37 -0
  97. data/stdlib/logger/0/logger.rbs +2 -2
  98. data/stdlib/net-http/0/manifest.yaml +1 -1
  99. data/stdlib/net-http/0/net-http.rbs +16 -63
  100. data/stdlib/net-protocol/0/manifest.yaml +2 -0
  101. data/stdlib/net-protocol/0/net-protocol.rbs +56 -0
  102. data/stdlib/openssl/0/openssl.rbs +1 -1
  103. data/stdlib/pp/0/manifest.yaml +2 -0
  104. data/stdlib/pp/0/pp.rbs +301 -0
  105. data/stdlib/{yaml → psych}/0/dbm.rbs +3 -3
  106. data/stdlib/psych/0/manifest.yaml +3 -0
  107. data/stdlib/psych/0/psych.rbs +391 -0
  108. data/stdlib/{yaml → psych}/0/store.rbs +2 -2
  109. data/stdlib/rdoc/0/code_object.rbs +55 -0
  110. data/stdlib/rdoc/0/comment.rbs +60 -0
  111. data/stdlib/rdoc/0/context.rbs +153 -0
  112. data/stdlib/rdoc/0/markup.rbs +119 -0
  113. data/stdlib/rdoc/0/parser.rbs +56 -0
  114. data/stdlib/rdoc/0/rdoc.rbs +0 -372
  115. data/stdlib/rdoc/0/ri.rbs +17 -0
  116. data/stdlib/rdoc/0/store.rbs +48 -0
  117. data/stdlib/rdoc/0/top_level.rbs +97 -0
  118. data/stdlib/socket/0/basic_socket.rbs +1 -1
  119. data/stdlib/socket/0/socket.rbs +1 -1
  120. data/stdlib/uri/0/common.rbs +1 -1
  121. data/stdlib/yaml/0/manifest.yaml +1 -2
  122. data/stdlib/yaml/0/yaml.rbs +1 -199
  123. metadata +46 -9
  124. data/sig/shims/pp.rbs +0 -3
  125. data/sig/shims.rbs +0 -47
data/lib/rbs.rb CHANGED
@@ -30,6 +30,7 @@ require "rbs/definition"
30
30
  require "rbs/definition_builder"
31
31
  require "rbs/definition_builder/ancestor_builder"
32
32
  require "rbs/definition_builder/method_builder"
33
+ require "rbs/diff"
33
34
  require "rbs/variance_calculator"
34
35
  require "rbs/substitution"
35
36
  require "rbs/constant"
data/rbs.gemspec CHANGED
@@ -36,4 +36,5 @@ Gem::Specification.new do |spec|
36
36
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
37
37
  spec.require_paths = ["lib"]
38
38
  spec.required_ruby_version = ">= 3.0"
39
+ spec.add_dependency "abbrev"
39
40
  end
@@ -17,8 +17,8 @@ module RBS
17
17
 
18
18
  def self.translate: (RDoc::Markup::Document) -> String?
19
19
 
20
- def self.each_part: (RDoc::Markup::Document) { (RDoc::Markup::Document) -> void } -> void
21
- | (RDoc::Markup::Document) -> Enumerator[RDoc::Markup::Document, void]
20
+ def self.each_part: (RDoc::Markup::Document | RDoc::Comment | String) { (RDoc::Markup::Document) -> void } -> void
21
+ | (RDoc::Markup::Document | RDoc::Comment | String) -> Enumerator[RDoc::Markup::Document, void]
22
22
  end
23
23
  end
24
24
  end
@@ -17,7 +17,7 @@ module RBS
17
17
  end
18
18
 
19
19
  interface _WithRDocComment
20
- def comment: () -> RDoc::Markup::Document
20
+ def comment: () -> (RDoc::Markup::Document | RDoc::Comment | String)
21
21
  end
22
22
 
23
23
  def each_part: (Array[Object & _WithRDocComment], tester: _PathTester) { ([RDoc::Markup::Document, Object & _WithRDocComment]) -> void } -> void
@@ -0,0 +1,15 @@
1
+ module RBS
2
+ class CLI
3
+ class ColoredIO
4
+ attr_reader stdout: CLI::_IO
5
+ def initialize: (stdout: CLI::_IO) -> void
6
+ def puts_green: (String) -> void
7
+ def puts_red: (String) -> void
8
+ def puts: (?String) -> void
9
+
10
+ private def can_display_colors?: () -> bool
11
+ private def are_colors_supported?: () -> bool
12
+ private def are_colors_disabled?: () -> bool
13
+ end
14
+ end
15
+ end
data/sig/cli/diff.rbs ADDED
@@ -0,0 +1,21 @@
1
+ module RBS
2
+ class CLI
3
+ class Diff
4
+ @format: String
5
+ @stdout: _IO
6
+ @stderr: _IO
7
+ @diff: RBS::Diff
8
+
9
+ def initialize: (
10
+ argv: Array[String],
11
+ library_options: RBS::CLI::LibraryOptions,
12
+ ?stdout: _IO,
13
+ ?stderr: _IO,
14
+ ) -> void
15
+
16
+ def run: () -> void
17
+ def run_diff: () -> void
18
+ def run_markdown: () -> void
19
+ end
20
+ end
21
+ end
data/sig/cli.rbs CHANGED
@@ -18,6 +18,8 @@ module RBS
18
18
  interface _IO
19
19
  def puts: (*untyped) -> void
20
20
 
21
+ def tty?: () -> bool
22
+
21
23
  def print: (*untyped) -> void
22
24
 
23
25
  def flush: () -> void
@@ -7,7 +7,6 @@ module RBS
7
7
  # Data structure stored in `rbs_collection.lock.yaml`
8
8
  #
9
9
  type lockfile_data = {
10
- "sources" => Array[Sources::Git::source_entry]?, # null if empty
11
10
  "path" => String,
12
11
  "gems" => Array[library_data]?, # null if empty
13
12
  "gemfile_lock_path" => String? # gemfile_lock_path is optional because older versions doesn't have it
@@ -43,8 +42,6 @@ module RBS
43
42
  #
44
43
  attr_reader gemfile_lock_path: Pathname?
45
44
 
46
- attr_reader sources: Hash[String, Sources::Git]
47
-
48
45
  attr_reader gems: Hash[String, library]
49
46
 
50
47
  def initialize: (lockfile_path: Pathname, path: Pathname, gemfile_lock_path: Pathname?) -> void
@@ -59,9 +56,6 @@ module RBS
59
56
 
60
57
  def to_lockfile: () -> lockfile_data
61
58
 
62
- def each_source: () { (Sources::t) -> void } -> void
63
- | () -> Enumerator[Sources::t, void]
64
-
65
59
  def self.from_lockfile: (lockfile_path: Pathname, data: lockfile_data) -> Lockfile
66
60
 
67
61
  # Validates if directories are set up correctly
data/sig/diff.rbs ADDED
@@ -0,0 +1,23 @@
1
+ module RBS
2
+ class Diff
3
+ @type_name: TypeName
4
+ @library_options: RBS::CLI::LibraryOptions
5
+ @after_path: Array[String]
6
+ @before_path: Array[String]
7
+
8
+ def initialize: (
9
+ type_name: TypeName,
10
+ library_options: RBS::CLI::LibraryOptions,
11
+ ?after_path: Array[String],
12
+ ?before_path: Array[String]
13
+ ) -> void
14
+
15
+ def each_diff: () { (String before, String after) -> void } -> void
16
+
17
+ private def each_diff_by: (Symbol kind, Hash[::Symbol, Definition::Method] before_methods, Hash[::Symbol, Definition::Method] after_methods) { (String before, String after) -> void } -> void
18
+ private def build_methods: (Array[String] path) -> [ Hash[::Symbol, Definition::Method], Hash[::Symbol, Definition::Method] ]
19
+ private def build_env: (Array[String] path) -> Environment
20
+ private def build_builder: (Environment env) -> DefinitionBuilder
21
+ private def definition_method_to_s: (Symbol key, Symbol kind, Definition::Method definition_method) -> String?
22
+ end
23
+ end
data/sig/errors.rbs CHANGED
@@ -20,11 +20,7 @@ module RBS
20
20
  %a{pure} def location: () -> Location[untyped, untyped]?
21
21
  end
22
22
 
23
- interface _DetailedMessage
24
- def detailed_message: (**untyped) -> String
25
- end
26
-
27
- module DetailedMessageable : _Location, _DetailedMessage
23
+ module DetailedMessageable : _Location, Exception
28
24
  def detailed_message: (?highlight: boolish, **untyped) -> String
29
25
  end
30
26
 
data/sig/method_types.rbs CHANGED
@@ -48,5 +48,11 @@ module RBS
48
48
  def to_s: () -> String
49
49
 
50
50
  def type_param_names: () -> Array[Symbol]
51
+
52
+ def has_self_type?: () -> bool
53
+
54
+ def has_classish_type?: () -> bool
55
+
56
+ def with_nonreturn_void?: () -> bool
51
57
  end
52
58
  end
@@ -0,0 +1,108 @@
1
+ module RBS
2
+ module Prototype
3
+ class Runtime
4
+ class Todo
5
+ @builder: DefinitionBuilder
6
+
7
+ @mixin_decls_cache: Hash[TypeName, Array[untyped]]
8
+
9
+ def initialize: (builder: DefinitionBuilder) -> void
10
+
11
+ def skip_mixin?: (type_name: TypeName, module_name: TypeName, mixin_class: mixin_class) -> bool
12
+
13
+ def skip_singleton_method?: (module_name: TypeName, name: Symbol) -> bool
14
+
15
+ def skip_instance_method?: (module_name: TypeName, name: Symbol) -> bool
16
+
17
+ def skip_constant?: (module_name: String, name: Symbol) -> bool
18
+
19
+ private def mixin_decls: (TypeName type_name) -> Array[AST::Members::Include | AST::Members::Extend | AST::Members::Prepend]
20
+ end
21
+
22
+ type mixin_class = singleton(AST::Members::Include) | singleton(AST::Members::Prepend) | singleton(AST::Members::Extend)
23
+
24
+ @decls: Array[AST::Declarations::t]?
25
+
26
+ @modules: Hash[String, Module]
27
+
28
+ @builder: DefinitionBuilder
29
+
30
+ @module_name_method: UnboundMethod
31
+ @object_class: UnboundMethod
32
+
33
+ @todo_object: Todo?
34
+
35
+ include Helpers
36
+
37
+ attr_reader patterns: Array[String]
38
+
39
+ attr_reader env: Environment
40
+
41
+ attr_reader merge: bool
42
+
43
+ attr_reader todo: bool
44
+
45
+ attr_accessor outline: bool
46
+
47
+ attr_reader owners_included: Array[Module]
48
+
49
+ def initialize: (patterns: Array[String], env: Environment, merge: bool, ?todo: bool, ?owners_included: Array[Symbol]) -> void
50
+
51
+ def target?: (Module const) -> bool
52
+
53
+ def todo_object: () -> Todo?
54
+
55
+ def builder: () -> DefinitionBuilder
56
+
57
+ def parse: (String file) -> void
58
+
59
+ def decls: () -> Array[AST::Declarations::t]
60
+
61
+ def to_type_name: (String name, ?full_name: bool) -> TypeName
62
+
63
+ def each_mixined_module: (TypeName type_name, Module mod) { (TypeName, TypeName, mixin_class) -> void } -> void
64
+
65
+ def each_mixined_module_one: (TypeName type_name, Module mod) { (TypeName, TypeName, bool) -> void } -> void
66
+
67
+ def method_type: (UnboundMethod method) -> MethodType
68
+
69
+ def merge_rbs: [A] (TypeName module_name, Array[AST::Declarations::Class::member] members, singleton: Symbol) { () -> A } -> A?
70
+ | [A] (TypeName module_name, Array[AST::Declarations::Class::member] members, instance: Symbol) { () -> A } -> A?
71
+
72
+ def target_method?: (Module mod, instance: Symbol) -> bool
73
+ | (Module mod, singleton: Symbol) -> bool
74
+
75
+ def generate_methods: (Module mod, TypeName module_name, Array[AST::Declarations::Class::member] members) -> void
76
+
77
+ def generate_constants: (Module mod, Array[AST::Declarations::Class::member] decls) -> void
78
+
79
+ def generate_super_class: (Class mod) -> AST::Declarations::Class::Super?
80
+
81
+ def generate_class: (Class mod) -> void
82
+
83
+ def generate_module: (Module mod) -> void
84
+
85
+ # Generate/find outer module declarations
86
+ # This is broken down into another method to comply with `DRY`
87
+ # This generates/finds declarations in nested form & returns the last array of declarations
88
+ def ensure_outer_module_declarations: (Module mod) -> Array[AST::Declarations::Class::member]
89
+
90
+ # Returns the exact name & not compactly declared name
91
+ def only_name: (Module mod) -> String
92
+
93
+ def const_name: (Module const) -> String?
94
+
95
+ def const_name!: (Module const) -> String
96
+
97
+ def object_class: (untyped) -> untyped
98
+
99
+ def type_args: (TypeName type_name) -> Array[Types::t]
100
+
101
+ def block_from_ast_of: (UnboundMethod method) -> Types::Block?
102
+
103
+ def can_alias?: (Module, UnboundMethod) -> bool
104
+
105
+ def type_params: (Module) -> Array[AST::TypeParam]
106
+ end
107
+ end
108
+ end
data/sig/rdoc/rbs.rbs CHANGED
@@ -8,6 +8,10 @@ end
8
8
  module RBS
9
9
  module RDocPlugin
10
10
  class Parser
11
+ @top_level: RDoc::TopLevel
12
+
13
+ @content: String
14
+
11
15
  type allowed_decls = RBS::AST::Declarations::Class
12
16
  | RBS::AST::Declarations::Module
13
17
  | RBS::AST::Declarations::Constant
@@ -30,4 +30,9 @@ module Bundler
30
30
  def self.default_lockfile: () -> Pathname
31
31
 
32
32
  def self.definition: () -> Definition
33
+
34
+ module Source
35
+ class Gemspec
36
+ end
37
+ end
33
38
  end
data/sig/sorter.rbs CHANGED
@@ -14,10 +14,28 @@ module RBS
14
14
 
15
15
  def run: () -> void
16
16
 
17
- def group: (member member) -> Numeric
18
-
19
- def key: (member member) -> String
20
-
21
- def sort_decl!: (AST::Declarations::t decl) -> void
17
+ type partitioned = {
18
+ type_alias_decls: Array[AST::Declarations::TypeAlias],
19
+ constant_decls: Array[AST::Declarations::Constant],
20
+ class_decls: Array[AST::Declarations::Class | AST::Declarations::Module | AST::Declarations::Interface],
21
+ mixin_includes: Array[AST::Members::Include],
22
+ mixin_prepends: Array[AST::Members::Prepend],
23
+ mixin_extends: Array[AST::Members::Extend],
24
+ class_variables: Array[AST::Members::ClassVariable],
25
+ class_instance_variables: Array[AST::Members::ClassInstanceVariable],
26
+ instance_variables: Array[AST::Members::InstanceVariable],
27
+ singleton_attributes: Array[AST::Members::AttrAccessor | AST::Members::AttrWriter | AST::Members::AttrReader],
28
+ instance_attributes: Array[AST::Members::AttrAccessor | AST::Members::AttrWriter | AST::Members::AttrReader],
29
+ module_functions: Array[AST::Members::MethodDefinition],
30
+ singleton_new_methods: Array[AST::Members::MethodDefinition],
31
+ public_singleton_methods: Array[AST::Members::MethodDefinition | AST::Members::Alias],
32
+ private_singleton_methods: Array[AST::Members::MethodDefinition],
33
+ instance_initialize_methods: Array[AST::Members::MethodDefinition],
34
+ public_instance_methods: Array[AST::Members::MethodDefinition | AST::Members::Alias],
35
+ private_instance_methods: Array[AST::Members::MethodDefinition],
36
+ other_decls: Array[member]
37
+ }
38
+
39
+ def sort_decl!: (member decl) -> void
22
40
  end
23
41
  end
data/sig/types.rbs CHANGED
@@ -41,6 +41,20 @@ module RBS
41
41
  # ```
42
42
  #
43
43
  def to_s: (?Integer level) -> String
44
+
45
+ # Returns `true` if it has `self` type
46
+ #
47
+ def has_self_type?: () -> bool
48
+
49
+ # Returns `true` if it has `instance` or `class` types
50
+ def has_classish_type?: () -> bool
51
+
52
+ # Returns `true` if it has `void` types other than *return* position
53
+ #
54
+ # * The function return type is a return position (`() -> void`)
55
+ # * Generic parameter is a return position (`Enumerator[Integer, void]`)
56
+ #
57
+ def with_nonreturn_void?: () -> bool
44
58
  end
45
59
 
46
60
  # t represents union of all possible types.
@@ -97,6 +111,9 @@ module RBS
97
111
  end
98
112
 
99
113
  class Any < Base
114
+ @string: String?
115
+
116
+ def todo!: () -> self
100
117
  end
101
118
 
102
119
  class Nil < Base
@@ -191,6 +208,12 @@ module RBS
191
208
 
192
209
  def each_type: () { (t) -> void } -> void
193
210
  | () -> Enumerator[t, void]
211
+
212
+ def has_self_type?: () -> bool
213
+
214
+ def has_classish_type?: () -> bool
215
+
216
+ def with_nonreturn_void?: () -> bool
194
217
  end
195
218
 
196
219
  class Interface
@@ -412,6 +435,12 @@ module RBS
412
435
  def amap: [A, B] (Array[A]) { (A) -> B } -> Array[B]
413
436
 
414
437
  def hmapv: [X, Y, Z] (Hash[X, Y]) { (Y) -> Z } -> Hash[X, Z]
438
+
439
+ def has_self_type?: () -> bool
440
+
441
+ def has_classish_type?: () -> bool
442
+
443
+ def with_nonreturn_void?: () -> bool
415
444
  end
416
445
 
417
446
  class Block
@@ -146,7 +146,7 @@ module Benchmark
146
146
  # >total: 2.930000 0.000000 2.930000 ( 2.932889)
147
147
  # >avg: 0.976667 0.000000 0.976667 ( 0.977630)
148
148
  #
149
- def self?.benchmark: (String caption, ?Integer? label_width, ?String? format, *String labels) { (Report report) -> (Array[Tms] | void) } -> Array[Tms]
149
+ def self?.benchmark: (String caption, ?Integer? label_width, ?String? format, *String labels) { (Report report) -> (Array[Tms] | untyped) } -> Array[Tms]
150
150
 
151
151
  # <!--
152
152
  # rdoc-file=lib/benchmark.rb
@@ -515,7 +515,7 @@ class CGI
515
515
  # This method does not perform charset conversion.
516
516
  #
517
517
  def http_header: (?String options) -> String
518
- | (?Hash[String | Symbol, untyped] header_hash) -> String
518
+ | (?Hash[interned, untyped] header_hash) -> String
519
519
 
520
520
  def nph?: () -> untyped
521
521
 
@@ -586,7 +586,7 @@ class CGI
586
586
  # # string
587
587
  #
588
588
  def out: (?String content_type_string) { () -> String } -> void
589
- | (Hash[String | Symbol, untyped] headers_hash) { () -> String } -> void
589
+ | (Hash[interned, untyped] headers_hash) { () -> String } -> void
590
590
 
591
591
  # <!--
592
592
  # rdoc-file=lib/cgi/core.rb
@@ -266,14 +266,14 @@ module DidYouMean
266
266
  # - new(dictionary:)
267
267
  # -->
268
268
  #
269
- def initialize: (dictionary: Array[String | Symbol]) -> void
269
+ def initialize: (dictionary: Array[interned]) -> void
270
270
 
271
271
  # <!--
272
272
  # rdoc-file=lib/did_you_mean/spell_checker.rb
273
273
  # - correct(input)
274
274
  # -->
275
275
  #
276
- def correct: (String | Symbol input) -> Array[String]
276
+ def correct: (interned input) -> Array[String]
277
277
  end
278
278
 
279
279
  # <!-- rdoc-file=lib/did_you_mean/tree_spell_checker.rb -->
@@ -560,5 +560,5 @@ class Object
560
560
  # Digest(:Foo)
561
561
  # # => LoadError: library not found for class Digest::Foo -- digest/foo
562
562
  #
563
- def Digest: (String | Symbol name) -> singleton(::Digest::Base)
563
+ def Digest: (interned name) -> singleton(::Digest::Base)
564
564
  end
@@ -1507,7 +1507,7 @@ module FileUtils
1507
1507
  #
1508
1508
  # Related: [methods for deleting](rdoc-ref:FileUtils@Deleting).
1509
1509
  #
1510
- def self?.remove_file: (path path, ?void force) -> void
1510
+ def self?.remove_file: (path path, ?boolish force) -> void
1511
1511
 
1512
1512
  # <!--
1513
1513
  # rdoc-file=lib/fileutils.rb
@@ -134,7 +134,7 @@ module Forwardable
134
134
  # def_delegator :@records, :<<
135
135
  # def_delegator :@records, :map
136
136
  #
137
- def def_instance_delegators: (Symbol | String accessor, *Symbol methods) -> void
137
+ def def_instance_delegators: (interned accessor, *Symbol methods) -> void
138
138
 
139
139
  # <!--
140
140
  # rdoc-file=lib/forwardable.rb
@@ -171,7 +171,7 @@ module Forwardable
171
171
  # q.push 23 #=> NoMethodError
172
172
  # q.to_i #=> 1
173
173
  #
174
- def def_instance_delegator: (Symbol | String accessor, Symbol method, ?Symbol ali) -> void
174
+ def def_instance_delegator: (interned accessor, Symbol method, ?Symbol ali) -> void
175
175
 
176
176
  # <!--
177
177
  # rdoc-file=lib/forwardable.rb
@@ -240,7 +240,7 @@ module SingleForwardable
240
240
  # def_delegator :@records, :<<
241
241
  # def_delegator :@records, :map
242
242
  #
243
- def def_single_delegators: (Symbol | String accessor, *Symbol methods) -> void
243
+ def def_single_delegators: (interned accessor, *Symbol methods) -> void
244
244
 
245
245
  # <!--
246
246
  # rdoc-file=lib/forwardable.rb
@@ -257,7 +257,7 @@ module SingleForwardable
257
257
  # method of the same name in *accessor*). If *new_name* is provided, it is used
258
258
  # as the name for the delegate method. Returns the name of the method defined.
259
259
  #
260
- def def_single_delegator: (Symbol | String accessor, Symbol method, ?Symbol ali) -> void
260
+ def def_single_delegator: (interned accessor, Symbol method, ?Symbol ali) -> void
261
261
 
262
262
  # <!--
263
263
  # rdoc-file=lib/forwardable.rb
@@ -270,7 +270,7 @@ class IO
270
270
  # - pressed?(p1)
271
271
  # -->
272
272
  #
273
- def pressed?: (Integer | Symbol | String) -> bool
273
+ def pressed?: (Integer | interned) -> bool
274
274
 
275
275
  # <!--
276
276
  # rdoc-file=ext/io/console/console.c
@@ -1164,6 +1164,43 @@ JSON::VERSION_MAJOR: Integer
1164
1164
 
1165
1165
  JSON::VERSION_MINOR: Integer
1166
1166
 
1167
+ %a{annotate:rdoc:skip}
1168
+ module Kernel
1169
+ private
1170
+
1171
+ # <!--
1172
+ # rdoc-file=ext/json/lib/json/common.rb
1173
+ # - j(*objs)
1174
+ # -->
1175
+ # Outputs *objs* to STDOUT as JSON strings in the shortest form, that is in one
1176
+ # line.
1177
+ #
1178
+ def j: (*_ToJson) -> nil
1179
+
1180
+ # <!--
1181
+ # rdoc-file=ext/json/lib/json/common.rb
1182
+ # - jj(*objs)
1183
+ # -->
1184
+ # Outputs *objs* to STDOUT as JSON strings in a pretty format, with indentation
1185
+ # and over many lines.
1186
+ #
1187
+ def jj: (*_ToJson) -> nil
1188
+
1189
+ # <!--
1190
+ # rdoc-file=ext/json/lib/json/common.rb
1191
+ # - JSON(object, *args)
1192
+ # -->
1193
+ # If *object* is string-like, parse the string and return the parsed result as a
1194
+ # Ruby data structure. Otherwise, generate a JSON text from the Ruby data
1195
+ # structure object and return it.
1196
+ #
1197
+ # The *opts* argument is passed through to generate/parse respectively. See
1198
+ # generate and parse for their documentation.
1199
+ #
1200
+ def JSON: (string source, ?json_options opts) -> untyped
1201
+ | (_ToJson obj, ?json_options opts) -> String
1202
+ end
1203
+
1167
1204
  %a{annotate:rdoc:skip}
1168
1205
  class Object
1169
1206
  # Converts this object to a string (calling #to_s), converts
@@ -640,7 +640,7 @@ class Logger
640
640
  #
641
641
  # Logger#sev_threshold= is an alias for Logger#level=.
642
642
  #
643
- def level=: (Integer | String | Symbol severity) -> Integer
643
+ def level=: (Integer | interned severity) -> Integer
644
644
 
645
645
  # <!--
646
646
  # rdoc-file=lib/logger.rb
@@ -796,7 +796,7 @@ class Logger
796
796
  # periodic log file rotation; default is `'%Y%m%d'`. See [Periodic
797
797
  # Rotation](rdoc-ref:Logger@Periodic+Rotation).
798
798
  #
799
- def initialize: (logdev? logdev, ?Numeric | String shift_age, ?Integer shift_size, ?shift_period_suffix: String, ?binmode: boolish, ?datetime_format: String, ?formatter: _Formatter, ?progname: String, ?level: Integer | String | Symbol) -> void
799
+ def initialize: (logdev? logdev, ?Numeric | String shift_age, ?Integer shift_size, ?shift_period_suffix: String, ?binmode: boolish, ?datetime_format: String, ?formatter: _Formatter, ?progname: String, ?level: Integer | interned) -> void
800
800
  end
801
801
 
802
802
  Logger::ProgName: String
@@ -1,3 +1,3 @@
1
1
  dependencies:
2
+ - name: net-protocol
2
3
  - name: uri
3
- - name: timeout