@@ -324,10 +324,8 @@ def all_dirs
324
324
end
325
325
end
326
326
327
- private # -------------------------------------------------------------------------------------
328
-
329
327
# @sig (String, Module) -> void
330
- def set_autoloads_in_dir ( dir , parent )
328
+ private def set_autoloads_in_dir ( dir , parent )
331
329
ls ( dir ) do |basename , abspath |
332
330
begin
333
331
if ruby? ( basename )
@@ -362,7 +360,7 @@ def set_autoloads_in_dir(dir, parent)
362
360
end
363
361
364
362
# @sig (Module, Symbol, String) -> void
365
- def autoload_subdir ( parent , cname , subdir )
363
+ private def autoload_subdir ( parent , cname , subdir )
366
364
if autoload_path = autoload_path_set_by_me_for? ( parent , cname )
367
365
cpath = cpath ( parent , cname )
368
366
if ruby? ( autoload_path )
@@ -392,7 +390,7 @@ def autoload_subdir(parent, cname, subdir)
392
390
end
393
391
394
392
# @sig (Module, Symbol, String) -> void
395
- def autoload_file ( parent , cname , file )
393
+ private def autoload_file ( parent , cname , file )
396
394
if autoload_path = strict_autoload_path ( parent , cname ) || Registry . inception? ( cpath ( parent , cname ) )
397
395
# First autoload for a Ruby file wins, just ignore subsequent ones.
398
396
if ruby? ( autoload_path )
@@ -418,7 +416,7 @@ def autoload_file(parent, cname, file)
418
416
# the file where we've found the namespace is explicitly defined.
419
417
#
420
418
# @sig (dir: String, file: String, parent: Module, cname: Symbol) -> void
421
- def promote_namespace_from_implicit_to_explicit ( dir :, file :, parent :, cname :)
419
+ private def promote_namespace_from_implicit_to_explicit ( dir :, file :, parent :, cname :)
422
420
autoloads . delete ( dir )
423
421
Registry . unregister_autoload ( dir )
424
422
@@ -429,7 +427,7 @@ def promote_namespace_from_implicit_to_explicit(dir:, file:, parent:, cname:)
429
427
end
430
428
431
429
# @sig (Module, Symbol, String) -> void
432
- def set_autoload ( parent , cname , abspath )
430
+ private def set_autoload ( parent , cname , abspath )
433
431
parent . autoload ( cname , abspath )
434
432
435
433
if logger
@@ -450,7 +448,7 @@ def set_autoload(parent, cname, abspath)
450
448
end
451
449
452
450
# @sig (Module, Symbol) -> String?
453
- def autoload_path_set_by_me_for? ( parent , cname )
451
+ private def autoload_path_set_by_me_for? ( parent , cname )
454
452
if autoload_path = strict_autoload_path ( parent , cname )
455
453
autoload_path if autoloads . key? ( autoload_path )
456
454
else
@@ -459,12 +457,12 @@ def autoload_path_set_by_me_for?(parent, cname)
459
457
end
460
458
461
459
# @sig (String) -> void
462
- def register_explicit_namespace ( cpath )
460
+ private def register_explicit_namespace ( cpath )
463
461
ExplicitNamespace . __register ( cpath , self )
464
462
end
465
463
466
464
# @sig (String) -> void
467
- def raise_if_conflicting_directory ( dir )
465
+ private def raise_if_conflicting_directory ( dir )
468
466
MUTEX . synchronize do
469
467
dir_slash = dir + "/"
470
468
@@ -489,20 +487,20 @@ def raise_if_conflicting_directory(dir)
489
487
end
490
488
491
489
# @sig (String, Object, String) -> void
492
- def run_on_unload_callbacks ( cpath , value , abspath )
490
+ private def run_on_unload_callbacks ( cpath , value , abspath )
493
491
# Order matters. If present, run the most specific one.
494
492
on_unload_callbacks [ cpath ] &.each { |c | c . call ( value , abspath ) }
495
493
on_unload_callbacks [ :ANY ] &.each { |c | c . call ( cpath , value , abspath ) }
496
494
end
497
495
498
496
# @sig (Module, Symbol) -> void
499
- def unload_autoload ( parent , cname )
497
+ private def unload_autoload ( parent , cname )
500
498
crem ( parent , cname )
501
499
log ( "autoload for #{ cpath ( parent , cname ) } removed" ) if logger
502
500
end
503
501
504
502
# @sig (Module, Symbol) -> void
505
- def unload_cref ( parent , cname )
503
+ private def unload_cref ( parent , cname )
506
504
# Let's optimistically remove_const. The way we use it, this is going to
507
505
# succeed always if all is good.
508
506
crem ( parent , cname )
0 commit comments