rbs 3.6.0.pre.2 → 3.6.0.pre.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (78) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +21 -0
  3. data/Rakefile +2 -2
  4. data/core/array.rbs +0 -2
  5. data/core/complex.rbs +0 -2
  6. data/core/data.rbs +0 -2
  7. data/core/dir.rbs +0 -2
  8. data/core/encoding.rbs +0 -2
  9. data/core/enumerator/product.rbs +0 -2
  10. data/core/enumerator.rbs +1 -1
  11. data/core/errors.rbs +0 -12
  12. data/core/file.rbs +0 -2
  13. data/core/float.rbs +0 -2
  14. data/core/hash.rbs +0 -2
  15. data/core/integer.rbs +0 -2
  16. data/core/io/buffer.rbs +0 -2
  17. data/core/kernel.rbs +5 -5
  18. data/core/module.rbs +2 -2
  19. data/core/numeric.rbs +0 -2
  20. data/core/object_space/weak_key_map.rbs +0 -2
  21. data/core/ractor.rbs +0 -6
  22. data/core/rational.rbs +0 -2
  23. data/core/rbs/unnamed/argf.rbs +0 -2
  24. data/core/ruby_vm.rbs +305 -0
  25. data/lib/rbs/ast/type_param.rb +44 -11
  26. data/lib/rbs/cli/validate.rb +6 -4
  27. data/lib/rbs/definition.rb +2 -8
  28. data/lib/rbs/definition_builder/ancestor_builder.rb +23 -7
  29. data/lib/rbs/definition_builder.rb +7 -6
  30. data/lib/rbs/errors.rb +38 -0
  31. data/lib/rbs/version.rb +1 -1
  32. data/sig/definition.rbs +1 -1
  33. data/sig/errors.rbs +14 -0
  34. data/sig/members.rbs +1 -2
  35. data/sig/type_param.rbs +9 -5
  36. data/stdlib/bigdecimal/0/big_decimal.rbs +0 -2
  37. data/stdlib/cgi/0/core.rbs +0 -10
  38. data/stdlib/date/0/date.rbs +0 -2
  39. data/stdlib/date/0/date_time.rbs +0 -2
  40. data/stdlib/dbm/0/dbm.rbs +0 -2
  41. data/stdlib/delegate/0/delegator.rbs +0 -2
  42. data/stdlib/delegate/0/simple_delegator.rbs +0 -2
  43. data/stdlib/digest/0/digest.rbs +0 -4
  44. data/stdlib/etc/0/etc.rbs +0 -4
  45. data/stdlib/json/0/json.rbs +22 -0
  46. data/stdlib/logger/0/formatter.rbs +0 -2
  47. data/stdlib/logger/0/log_device.rbs +0 -2
  48. data/stdlib/logger/0/logger.rbs +0 -2
  49. data/stdlib/monitor/0/monitor.rbs +0 -6
  50. data/stdlib/mutex_m/0/mutex_m.rbs +0 -2
  51. data/stdlib/net-http/0/net-http.rbs +0 -8
  52. data/stdlib/observable/0/observable.rbs +0 -2
  53. data/stdlib/open-uri/0/open-uri.rbs +1 -1
  54. data/stdlib/open3/0/open3.rbs +155 -0
  55. data/stdlib/openssl/0/openssl.rbs +0 -112
  56. data/stdlib/optparse/0/optparse.rbs +0 -22
  57. data/stdlib/pathname/0/pathname.rbs +0 -2
  58. data/stdlib/pstore/0/pstore.rbs +0 -2
  59. data/stdlib/resolv/0/resolv.rbs +0 -74
  60. data/stdlib/singleton/0/singleton.rbs +0 -2
  61. data/stdlib/socket/0/addrinfo.rbs +0 -2
  62. data/stdlib/socket/0/basic_socket.rbs +0 -2
  63. data/stdlib/socket/0/ip_socket.rbs +0 -2
  64. data/stdlib/socket/0/socket.rbs +0 -8
  65. data/stdlib/socket/0/tcp_server.rbs +0 -2
  66. data/stdlib/socket/0/udp_socket.rbs +0 -2
  67. data/stdlib/socket/0/unix_server.rbs +0 -2
  68. data/stdlib/socket/0/unix_socket.rbs +0 -2
  69. data/stdlib/strscan/0/string_scanner.rbs +0 -2
  70. data/stdlib/tempfile/0/tempfile.rbs +0 -4
  71. data/stdlib/zlib/0/deflate.rbs +0 -2
  72. data/stdlib/zlib/0/gzip_file/error.rbs +0 -2
  73. data/stdlib/zlib/0/gzip_file.rbs +0 -2
  74. data/stdlib/zlib/0/gzip_reader.rbs +0 -2
  75. data/stdlib/zlib/0/gzip_writer.rbs +0 -2
  76. data/stdlib/zlib/0/inflate.rbs +0 -2
  77. data/stdlib/zlib/0/zstream.rbs +0 -2
  78. metadata +3 -2
@@ -154,39 +154,72 @@ module RBS
154
154
  end
155
155
 
156
156
  def self.application(params, args)
157
- subst = Substitution.new()
158
-
159
157
  if params.empty?
160
158
  return nil
161
159
  end
162
160
 
163
- min_count = params.count { _1.default_type.nil? }
164
- max_count = params.size
161
+ optional_params, required_params = params.partition {|param| param.default_type }
162
+
163
+ param_subst = Substitution.new()
164
+ app_subst = Substitution.new()
165
+
166
+ required_params.zip(args.take(required_params.size)).each do |param, arg|
167
+ arg ||= Types::Bases::Any.new(location: nil)
168
+ param_subst.add(from: param.name, to: arg)
169
+ app_subst.add(from: param.name, to: arg)
170
+ end
165
171
 
166
- unless min_count <= args.size && args.size <= max_count
167
- raise "Invalid type application: required type params=#{min_count}, optional type params=#{max_count - min_count}, given args=#{args.size}"
172
+ optional_params.each do |param|
173
+ param_subst.add(from: param.name, to: Types::Bases::Any.new(location: nil))
168
174
  end
169
175
 
170
- params.zip(args).each do |param, arg|
176
+ optional_params.zip(args.drop(required_params.size)).each do |param, arg|
171
177
  if arg
172
- subst.add(from: param.name, to: arg)
178
+ app_subst.add(from: param.name, to: arg)
173
179
  else
174
- subst.add(from: param.name, to: param.default_type || raise)
180
+ param.default_type or raise
181
+ app_subst.add(from: param.name, to: param.default_type.sub(param_subst))
175
182
  end
176
183
  end
177
184
 
178
- subst
185
+ app_subst
179
186
  end
180
187
 
181
188
  def self.normalize_args(params, args)
189
+ app = application(params, args) or return []
190
+
191
+ min_count = params.count { _1.default_type.nil? }
192
+ unless min_count <= args.size && args.size <= params.size
193
+ return args
194
+ end
195
+
182
196
  params.zip(args).filter_map do |param, arg|
183
197
  if arg
184
198
  arg
185
199
  else
186
- param.default_type
200
+ if param.default_type
201
+ param.default_type.sub(app)
202
+ else
203
+ Types::Bases::Any.new(location: nil)
204
+ end
187
205
  end
188
206
  end
189
207
  end
208
+
209
+ def self.validate(type_params)
210
+ optionals = type_params.filter {|param| param.default_type }
211
+
212
+ optional_param_names = optionals.map(&:name).sort
213
+
214
+ optionals.filter! do |param|
215
+ default_type = param.default_type or raise
216
+ optional_param_names.any? { default_type.free_variables.include?(_1) }
217
+ end
218
+
219
+ unless optionals.empty?
220
+ optionals
221
+ end
222
+ end
190
223
  end
191
224
  end
192
225
  end
@@ -117,10 +117,6 @@ EOU
117
117
  no_classish_type_validator(arg)
118
118
  @validator.validate_type(arg, context: nil)
119
119
  end
120
-
121
- if super_entry = @env.normalized_class_entry(super_class.name)
122
- InvalidTypeApplicationError.check!(type_name: super_class.name, args: super_class.args, params: super_entry.type_params, location: super_class.location)
123
- end
124
120
  end
125
121
  end
126
122
  when Environment::ModuleEntry
@@ -171,6 +167,8 @@ EOU
171
167
  end
172
168
  end
173
169
 
170
+ TypeParamDefaultReferenceError.check!(d.type_params)
171
+
174
172
  entry.decls.each do |d|
175
173
  d.decl.each_member do |member|
176
174
  case member
@@ -248,6 +246,8 @@ EOU
248
246
  end
249
247
  end
250
248
 
249
+ TypeParamDefaultReferenceError.check!(decl.decl.type_params)
250
+
251
251
  decl.decl.members.each do |member|
252
252
  case member
253
253
  when AST::Members::MethodDefinition
@@ -319,6 +319,8 @@ EOU
319
319
  end
320
320
  end
321
321
 
322
+ TypeParamDefaultReferenceError.check!(decl.decl.type_params)
323
+
322
324
  no_self_type_validator(decl.decl.type)
323
325
  no_classish_type_validator(decl.decl.type)
324
326
  void_type_context_validator(decl.decl.type)
@@ -237,14 +237,8 @@ module RBS
237
237
  @ancestors = ancestors
238
238
  end
239
239
 
240
- def apply(args, location:)
241
- # Assume default types of type parameters are already added to `args`
242
- InvalidTypeApplicationError.check!(
243
- type_name: type_name,
244
- args: args,
245
- params: params.map { AST::TypeParam.new(name: _1, variance: :invariant, upper_bound: nil, location: nil, default_type: nil) },
246
- location: location
247
- )
240
+ def apply(args, env:, location:)
241
+ InvalidTypeApplicationError.check2!(env: env, type_name: type_name, args: args, location: location)
248
242
 
249
243
  subst = Substitution.build(params, args)
250
244
 
@@ -213,7 +213,7 @@ module RBS
213
213
  end
214
214
 
215
215
  super_name = env.normalize_module_name(super_name)
216
-
216
+
217
217
  NoSuperclassFoundError.check!(super_name, env: env, location: primary.decl.location)
218
218
  if super_class
219
219
  InheritModuleError.check!(super_class, env: env)
@@ -458,7 +458,9 @@ module RBS
458
458
  super_name = super_class.name
459
459
  super_args = super_class.args
460
460
 
461
- super_ancestors = instance_ancestors(super_name, building_ancestors: building_ancestors).apply(super_args, location: entry.primary.decl.location)
461
+ super_ancestors =
462
+ instance_ancestors(super_name, building_ancestors: building_ancestors)
463
+ .apply(super_args, env: env, location: entry.primary.decl.super_class&.location)
462
464
  super_ancestors.map! {|ancestor| fill_ancestor_source(ancestor, name: super_name, source: :super) }
463
465
  ancestors.unshift(*super_ancestors)
464
466
  end
@@ -477,7 +479,10 @@ module RBS
477
479
  included_modules.each do |mod|
478
480
  name = mod.name
479
481
  arg_types = mod.args
480
- mod_ancestors = instance_ancestors(name, building_ancestors: building_ancestors).apply(arg_types, location: entry.primary.decl.location)
482
+ mod.source.is_a?(AST::Members::Include) or raise
483
+ mod_ancestors =
484
+ instance_ancestors(name, building_ancestors: building_ancestors)
485
+ .apply(arg_types, env: env, location: mod.source.location)
481
486
  mod_ancestors.map! {|ancestor| fill_ancestor_source(ancestor, name: name, source: mod.source) }
482
487
  ancestors.unshift(*mod_ancestors)
483
488
  end
@@ -489,7 +494,10 @@ module RBS
489
494
  prepended_modules.each do |mod|
490
495
  name = mod.name
491
496
  arg_types = mod.args
492
- mod_ancestors = instance_ancestors(name, building_ancestors: building_ancestors).apply(arg_types, location: entry.primary.decl.location)
497
+ mod.source.is_a?(AST::Members::Prepend) or raise
498
+ mod_ancestors =
499
+ instance_ancestors(name, building_ancestors: building_ancestors)
500
+ .apply(arg_types, env: env, location: mod.source.location)
493
501
  mod_ancestors.map! {|ancestor| fill_ancestor_source(ancestor, name: name, source: mod.source) }
494
502
  ancestors.unshift(*mod_ancestors)
495
503
  end
@@ -524,7 +532,9 @@ module RBS
524
532
  super_name = super_class.name
525
533
  super_args = super_class.args
526
534
 
527
- super_ancestors = instance_ancestors(super_name, building_ancestors: building_ancestors).apply(super_args, location: entry.primary.decl.location)
535
+ super_ancestors =
536
+ instance_ancestors(super_name, building_ancestors: building_ancestors)
537
+ .apply(super_args, env: env, location: nil)
528
538
  super_ancestors.map! {|ancestor| fill_ancestor_source(ancestor, name: super_name, source: :super) }
529
539
  ancestors.unshift(*super_ancestors)
530
540
 
@@ -539,7 +549,10 @@ module RBS
539
549
  extended_modules.each do |mod|
540
550
  name = mod.name
541
551
  args = mod.args
542
- mod_ancestors = instance_ancestors(name, building_ancestors: building_ancestors).apply(args, location: entry.primary.decl.location)
552
+ mod.source.is_a?(AST::Members::Extend) or raise
553
+ mod_ancestors =
554
+ instance_ancestors(name, building_ancestors: building_ancestors)
555
+ .apply(args, env: env, location: mod.source.location)
543
556
  mod_ancestors.map! {|ancestor| fill_ancestor_source(ancestor, name: name, source: mod.source) }
544
557
  ancestors.unshift(*mod_ancestors)
545
558
  end
@@ -572,7 +585,10 @@ module RBS
572
585
 
573
586
  included_interfaces = one_ancestors.included_interfaces or raise
574
587
  included_interfaces.each do |a|
575
- included_ancestors = interface_ancestors(a.name, building_ancestors: building_ancestors).apply(a.args, location: entry.decl.location)
588
+ a.source.is_a?(AST::Members::Include) or raise
589
+ included_ancestors =
590
+ interface_ancestors(a.name, building_ancestors: building_ancestors)
591
+ .apply(a.args, env: env, location: a.source.location)
576
592
  included_ancestors.map! {|ancestor| fill_ancestor_source(ancestor, name: a.name, source: a.source) }
577
593
  ancestors.unshift(*included_ancestors)
578
594
  end
@@ -79,7 +79,7 @@ module RBS
79
79
  raise
80
80
  end
81
81
 
82
- Substitution.build(params.map(&:name), args)
82
+ AST::TypeParam.application(params, args) || Substitution.new()
83
83
  end
84
84
 
85
85
  def define_instance(definition, type_name, subst)
@@ -549,16 +549,17 @@ module RBS
549
549
  interfaces_methods.each do |interface, (methods, member)|
550
550
  unless interface.args.empty?
551
551
  methods.type.is_a?(Types::Interface) or raise
552
- params = methods.type.args.map do |arg|
553
- arg.is_a?(Types::Variable) or raise
554
- arg.name
555
- end
556
552
 
557
553
  interface.args.each do |arg|
558
554
  validate_type_presence(arg)
559
555
  end
560
556
 
561
- subst_ = subst + Substitution.build(params, interface.args)
557
+ type_params = env.interface_decls.fetch(interface.name).decl.type_params
558
+ if s = AST::TypeParam.application(type_params, interface.args)
559
+ subst_ = subst + s
560
+ else
561
+ subst_ = subst
562
+ end
562
563
  else
563
564
  subst_ = subst
564
565
  end
data/lib/rbs/errors.rb CHANGED
@@ -88,6 +88,23 @@ module RBS
88
88
  raise new(type_name: type_name, args: args, params: params, location: location)
89
89
  end
90
90
  end
91
+
92
+ def self.check2!(env:, type_name:, args:, location:)
93
+ params =
94
+ case
95
+ when type_name.class?
96
+ decl = env.normalized_module_class_entry(type_name) or raise
97
+ decl.type_params
98
+ when type_name.interface?
99
+ env.interface_decls.fetch(type_name).decl.type_params
100
+ when type_name.alias?
101
+ env.type_alias_decls.fetch(type_name).decl.type_params
102
+ else
103
+ raise
104
+ end
105
+
106
+ check!(type_name: type_name, args: args, params: params, location: location)
107
+ end
91
108
  end
92
109
 
93
110
  class RecursiveAncestorError < DefinitionError
@@ -559,4 +576,25 @@ module RBS
559
576
  @location = location
560
577
  end
561
578
  end
579
+
580
+ class TypeParamDefaultReferenceError < DefinitionError
581
+ include DetailedMessageable
582
+
583
+ attr_reader :type_param
584
+ attr_reader :location
585
+
586
+ def initialize(type_param, location:)
587
+ super "#{Location.to_string(location)}: the default of #{type_param.name} cannot include optional type parameter"
588
+ @location = location
589
+ @type_param = type_param
590
+ end
591
+
592
+ def self.check!(type_params)
593
+ if errors = AST::TypeParam.validate(type_params)
594
+ error = errors[0] or raise
595
+ error.default_type or raise
596
+ raise new(error, location: error.default_type.location)
597
+ end
598
+ end
599
+ end
562
600
  end
data/lib/rbs/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RBS
4
- VERSION = "3.6.0.pre.2"
4
+ VERSION = "3.6.0.pre.3"
5
5
  end
data/sig/definition.rbs CHANGED
@@ -109,7 +109,7 @@ module RBS
109
109
 
110
110
  def initialize: (type_name: TypeName, params: Array[Symbol], ancestors: Array[Ancestor::t]) -> void
111
111
 
112
- def apply: (Array[Types::t], location: Location[untyped, untyped]?) -> Array[Ancestor::t]
112
+ def apply: (Array[Types::t], env: Environment, location: Location[untyped, untyped]?) -> Array[Ancestor::t]
113
113
  end
114
114
 
115
115
  class SingletonAncestors
data/sig/errors.rbs CHANGED
@@ -66,6 +66,8 @@ module RBS
66
66
  def initialize: (type_name: TypeName, args: Array[Types::t], params: Array[AST::TypeParam], location: Location[untyped, untyped]?) -> void
67
67
 
68
68
  def self.check!: (type_name: TypeName, args: Array[Types::t], params: Array[AST::TypeParam], location: Location[untyped, untyped]?) -> void
69
+
70
+ def self.check2!: (env: Environment, type_name: TypeName, args: Array[Types::t], location: Location[untyped, untyped]?) -> void
69
71
  end
70
72
 
71
73
  class RecursiveAncestorError < DefinitionError
@@ -366,4 +368,16 @@ module RBS
366
368
 
367
369
  attr_reader location: Location[untyped, untyped]?
368
370
  end
371
+
372
+ class TypeParamDefaultReferenceError < BaseError
373
+ include DetailedMessageable
374
+
375
+ attr_reader type_param: AST::TypeParam
376
+
377
+ def initialize: (AST::TypeParam, location: Location[untyped, untyped]?) -> void
378
+
379
+ attr_reader location: Location[untyped, untyped]?
380
+
381
+ def self.check!: (Array[AST::TypeParam]) -> void
382
+ end
369
383
  end
data/sig/members.rbs CHANGED
@@ -122,8 +122,7 @@ module RBS
122
122
  # include Array[String]
123
123
  # ^^^^^^^ keyword
124
124
  # ^^^^^ name
125
- # ^ arg_open
126
- # ^ arg_close
125
+ # ^^^^^^^^ args
127
126
  #
128
127
  type loc = Location[:name | :keyword, :args]
129
128
 
data/sig/type_param.rbs CHANGED
@@ -75,7 +75,14 @@ module RBS
75
75
 
76
76
  def to_s: () -> String
77
77
 
78
- # Returns an application with respect to type params` default
78
+ # Validates TypeParams if it refers another optiional type params
79
+ #
80
+ # * Returns array of TypeParam objects that refers other optional type params
81
+ # * Returns `nil` if all type params are valid
82
+ #
83
+ def self.validate: (Array[TypeParam]) -> Array[TypeParam]?
84
+
85
+ # Returns an application with respect to type params' default
79
86
  #
80
87
  def self.application: (Array[TypeParam], Array[Types::t]) -> Substitution?
81
88
 
@@ -95,10 +102,7 @@ module RBS
95
102
  # _Foo[String, Integer, untyped] # => _Foo[String, Integer, untyped] (Keeping extra args)
96
103
  # ```
97
104
  #
98
- # Note that it allows iinvalid arities.
99
- #
100
- # * Missing args will be omitted
101
- # * Extra args will be keeped
105
+ # Note that it allows iinvalid arities, returning the `args` immediately.
102
106
  #
103
107
  def self.normalize_args: (Array[TypeParam], Array[Types::t]) -> Array[Types::t]
104
108
  end
@@ -408,8 +408,6 @@ class BigDecimal < Numeric
408
408
  #
409
409
  def self.save_rounding_mode: () { (?nil) -> void } -> void
410
410
 
411
- public
412
-
413
411
  # <!--
414
412
  # rdoc-file=ext/bigdecimal/bigdecimal.c
415
413
  # - a % b
@@ -382,8 +382,6 @@ class CGI
382
382
  #
383
383
  def self.parse: (String query) -> Hash[String, Array[String]]
384
384
 
385
- public
386
-
387
385
  # <!-- rdoc-file=lib/cgi/core.rb -->
388
386
  # Return the accept character set for this CGI instance.
389
387
  #
@@ -706,8 +704,6 @@ class CGI
706
704
  #
707
705
  def self.parse: (String raw_cookie) -> Hash[String, instance]
708
706
 
709
- public
710
-
711
707
  # <!-- rdoc-file=lib/cgi/cookie.rb -->
712
708
  # Domain for which this cookie applies, as a `String`
713
709
  #
@@ -864,8 +860,6 @@ class CGI
864
860
  end
865
861
 
866
862
  module Escape
867
- public
868
-
869
863
  # <!--
870
864
  # rdoc-file=ext/cgi/escape/escape.c
871
865
  # - CGI.escape(string) -> string
@@ -940,8 +934,6 @@ class CGI
940
934
  # mode.
941
935
  #
942
936
  module QueryExtension
943
- public
944
-
945
937
  # <!--
946
938
  # rdoc-file=lib/cgi/core.rb
947
939
  # - [](key)
@@ -1135,8 +1127,6 @@ class CGI
1135
1127
  module Util
1136
1128
  include CGI::Escape
1137
1129
 
1138
- public
1139
-
1140
1130
  # <!--
1141
1131
  # rdoc-file=lib/cgi/util.rb
1142
1132
  # - escapeElement(string, *elements)
@@ -733,8 +733,6 @@ class Date
733
733
  #
734
734
  def self.xmlschema: (String str, ?Integer start) -> Date
735
735
 
736
- public
737
-
738
736
  # <!--
739
737
  # rdoc-file=ext/date/date_core.c
740
738
  # - d + other -> date
@@ -388,8 +388,6 @@ class DateTime < Date
388
388
  #
389
389
  def self.xmlschema: (String str, ?Integer start) -> DateTime
390
390
 
391
- public
392
-
393
391
  # <!--
394
392
  # rdoc-file=ext/date/date_core.c
395
393
  # - deconstruct_keys(array_of_names_or_nil) -> hash
data/stdlib/dbm/0/dbm.rbs CHANGED
@@ -74,8 +74,6 @@ class DBM
74
74
  def self.open: (String filename, ?Integer mode, ?Integer flags) -> DBM
75
75
  | [T] (String filename, ?Integer mode, ?Integer flags) { (DBM) -> T } -> T
76
76
 
77
- public
78
-
79
77
  # <!--
80
78
  # rdoc-file=ext/dbm/dbm.c
81
79
  # - dbm[key] -> string value or nil
@@ -40,8 +40,6 @@ class Delegator < BasicObject
40
40
 
41
41
  def self.public_api: () -> untyped
42
42
 
43
- public
44
-
45
43
  # <!--
46
44
  # rdoc-file=lib/delegate.rb
47
45
  # - !()
@@ -67,8 +67,6 @@
67
67
  # Unique: 6
68
68
  #
69
69
  class SimpleDelegator < Delegator
70
- public
71
-
72
70
  # <!--
73
71
  # rdoc-file=lib/delegate.rb
74
72
  # - __getobj__() { || ... }
@@ -103,8 +103,6 @@ Digest::REQUIRE_MUTEX: Thread::Mutex
103
103
  # calculate message digest values.
104
104
  #
105
105
  module Digest::Instance
106
- public
107
-
108
106
  # <!-- rdoc-file=ext/digest/digest.c -->
109
107
  # Updates the digest using a given *string* and returns self.
110
108
  #
@@ -403,8 +401,6 @@ end
403
401
  # Data_Wrap_Struct(0, 0, 0, (void *)&sha1));
404
402
  #
405
403
  class Digest::Base < Digest::Class
406
- public
407
-
408
404
  # <!-- rdoc-file=ext/digest/digest.c -->
409
405
  # Update the digest using given *string* and return `self`.
410
406
  #
data/stdlib/etc/0/etc.rbs CHANGED
@@ -709,8 +709,6 @@ module Etc
709
709
 
710
710
  def self.new: (*untyped) -> untyped
711
711
 
712
- public
713
-
714
712
  def gid: () -> Integer
715
713
 
716
714
  def gid=: (Integer new_gid) -> void
@@ -807,8 +805,6 @@ module Etc
807
805
 
808
806
  def self.new: (*untyped) -> untyped
809
807
 
810
- public
811
-
812
808
  def change: () -> Integer
813
809
 
814
810
  def change=: (Integer new_change) -> void
@@ -980,6 +980,28 @@ module JSON
980
980
  #
981
981
  def self?.load: (string | _JsonReadableIO | _JsonRead source, ?Proc proc, ?json_options options) -> untyped
982
982
 
983
+ # <!--
984
+ # rdoc-file=ext/json/lib/json/common.rb
985
+ # - JSON.load_file(path, opts={}) -> object
986
+ # -->
987
+ # Calls:
988
+ # parse(File.read(path), opts)
989
+ #
990
+ # See method #parse.
991
+ #
992
+ def self?.load_file: (string path, ?json_options opts) -> untyped
993
+
994
+ # <!--
995
+ # rdoc-file=ext/json/lib/json/common.rb
996
+ # - JSON.load_file!(path, opts = {})
997
+ # -->
998
+ # Calls:
999
+ # JSON.parse!(File.read(path, opts))
1000
+ #
1001
+ # See method #parse!
1002
+ #
1003
+ def self?.load_file!: (string path, ?json_options opts) -> untyped
1004
+
983
1005
  # <!-- rdoc-file=ext/json/lib/json/common.rb -->
984
1006
  # Sets or returns default options for the JSON.load method. Initially:
985
1007
  # opts = JSON.load_default_options
@@ -4,8 +4,6 @@ class Logger
4
4
  # Default formatter for log messages.
5
5
  #
6
6
  class Formatter
7
- public
8
-
9
7
  attr_accessor datetime_format: String?
10
8
 
11
9
  # <!--
@@ -11,8 +11,6 @@ class Logger
11
11
  attr_reader dev: _WriteCloser
12
12
  attr_reader filename: String?
13
13
 
14
- public
15
-
16
14
  # <!--
17
15
  # rdoc-file=lib/logger/log_device.rb
18
16
  # - close()
@@ -357,8 +357,6 @@ class Logger
357
357
 
358
358
  include Logger::Severity
359
359
 
360
- public
361
-
362
360
  # <!--
363
361
  # rdoc-file=lib/logger.rb
364
362
  # - <<(msg)
@@ -10,8 +10,6 @@
10
10
  # end
11
11
  #
12
12
  class Monitor
13
- public
14
-
15
13
  # <!--
16
14
  # rdoc-file=ext/monitor/monitor.c
17
15
  # - enter()
@@ -195,8 +193,6 @@ module MonitorMixin
195
193
  #
196
194
  def self.extend_object: (untyped obj) -> untyped
197
195
 
198
- public
199
-
200
196
  # <!--
201
197
  # rdoc-file=ext/monitor/lib/monitor.rb
202
198
  # - mon_enter()
@@ -303,8 +299,6 @@ end
303
299
  # calls while_wait and signal, this class should be documented.
304
300
  #
305
301
  class MonitorMixin::ConditionVariable
306
- public
307
-
308
302
  # <!--
309
303
  # rdoc-file=ext/monitor/lib/monitor.rb
310
304
  # - broadcast()
@@ -34,8 +34,6 @@ module Mutex_m
34
34
 
35
35
  def self.extend_object: (Object obj) -> untyped
36
36
 
37
- public
38
-
39
37
  def mu_extended: () -> untyped
40
38
 
41
39
  # <!--
@@ -1485,8 +1485,6 @@ module Net
1485
1485
  def start: [T] () { (Net::HTTP) -> T } -> T
1486
1486
  | () -> Net::HTTP
1487
1487
 
1488
- public
1489
-
1490
1488
  # <!--
1491
1489
  # rdoc-file=lib/net/http.rb
1492
1490
  # - finish()
@@ -1503,8 +1501,6 @@ module Net
1503
1501
  #
1504
1502
  def finish: () -> void
1505
1503
 
1506
- public
1507
-
1508
1504
  # <!--
1509
1505
  # rdoc-file=lib/net/http.rb
1510
1506
  # - Proxy(p_addr = :ENV, p_port = nil, p_user = nil, p_pass = nil)
@@ -1583,8 +1579,6 @@ module Net
1583
1579
  #
1584
1580
  alias proxyport proxy_port
1585
1581
 
1586
- public
1587
-
1588
1582
  # <!--
1589
1583
  # rdoc-file=lib/net/http.rb
1590
1584
  # - get(path, initheader = nil) {|res| ... }
@@ -3976,8 +3970,6 @@ module Net
3976
3970
  #
3977
3971
  def self.body_permitted?: () -> bool
3978
3972
 
3979
- public
3980
-
3981
3973
  include Net::HTTPHeader
3982
3974
 
3983
3975
  # <!-- rdoc-file=lib/net/http/response.rb -->
@@ -130,8 +130,6 @@
130
130
  # ticker.run
131
131
  #
132
132
  module Observable
133
- public
134
-
135
133
  # <!--
136
134
  # rdoc-file=lib/observer.rb
137
135
  # - add_observer(observer, func=:update)