packwerk 2.2.0 → 2.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +29 -20
- data/.github/workflows/cla.yml +22 -0
- data/.rubocop.yml +48 -19
- data/Gemfile +7 -2
- data/Gemfile.lock +201 -175
- data/README.md +1 -1
- data/RESOLVING_VIOLATIONS.md +81 -0
- data/Rakefile +1 -1
- data/USAGE.md +14 -5
- data/bin/m +1 -1
- data/bin/rake +1 -1
- data/bin/rubocop +1 -1
- data/bin/srb +1 -1
- data/bin/tapioca +1 -1
- data/gemfiles/Gemfile-rails-6-0 +1 -1
- data/gemfiles/Gemfile-rails-6-1 +22 -0
- data/lib/packwerk/application_validator.rb +7 -6
- data/lib/packwerk/association_inspector.rb +17 -15
- data/lib/packwerk/cache.rb +36 -29
- data/lib/packwerk/cli.rb +5 -6
- data/lib/packwerk/const_node_inspector.rb +8 -7
- data/lib/packwerk/constant_name_inspector.rb +2 -2
- data/lib/packwerk/deprecated_references.rb +34 -19
- data/lib/packwerk/file_processor.rb +14 -14
- data/lib/packwerk/files_for_processing.rb +27 -31
- data/lib/packwerk/formatters/offenses_formatter.rb +3 -3
- data/lib/packwerk/formatters/progress_formatter.rb +2 -2
- data/lib/packwerk/node.rb +1 -294
- data/lib/packwerk/node_helpers.rb +335 -0
- data/lib/packwerk/node_processor.rb +6 -5
- data/lib/packwerk/node_processor_factory.rb +3 -3
- data/lib/packwerk/node_visitor.rb +1 -1
- data/lib/packwerk/offense_collection.rb +6 -3
- data/lib/packwerk/offenses_formatter.rb +2 -2
- data/lib/packwerk/package.rb +3 -0
- data/lib/packwerk/package_set.rb +2 -0
- data/lib/packwerk/parse_run.rb +15 -13
- data/lib/packwerk/parsed_constant_definitions.rb +23 -20
- data/lib/packwerk/parsers/erb.rb +3 -3
- data/lib/packwerk/reference_checking/checkers/checker.rb +16 -3
- data/lib/packwerk/reference_checking/checkers/dependency_checker.rb +16 -0
- data/lib/packwerk/reference_checking/checkers/privacy_checker.rb +18 -0
- data/lib/packwerk/reference_checking/reference_checker.rb +3 -1
- data/lib/packwerk/reference_extractor.rb +51 -48
- data/lib/packwerk/reference_offense.rb +3 -27
- data/lib/packwerk/run_context.rb +3 -3
- data/lib/packwerk/spring_command.rb +1 -1
- data/lib/packwerk/version.rb +1 -1
- data/lib/packwerk.rb +1 -0
- data/packwerk.gemspec +4 -12
- data/sorbet/rbi/gems/actioncable@7.0.3.1.rbi +2754 -0
- data/sorbet/rbi/gems/actionmailbox@7.0.3.1.rbi +1496 -0
- data/sorbet/rbi/gems/actionmailer@7.0.3.1.rbi +2362 -0
- data/sorbet/rbi/gems/actionpack@7.0.3.1.rbi +19397 -0
- data/sorbet/rbi/gems/actiontext@7.0.3.1.rbi +1569 -0
- data/sorbet/rbi/gems/actionview@7.0.3.1.rbi +14907 -0
- data/sorbet/rbi/gems/activejob@7.0.3.1.rbi +2553 -0
- data/sorbet/rbi/gems/activemodel@7.0.3.1.rbi +5999 -0
- data/sorbet/rbi/gems/activerecord@7.0.3.1.rbi +37832 -0
- data/sorbet/rbi/gems/activestorage@7.0.3.1.rbi +2321 -0
- data/sorbet/rbi/gems/activesupport@7.0.3.1.rbi +18818 -0
- data/sorbet/rbi/gems/concurrent-ruby@1.1.10.rbi +11722 -0
- data/sorbet/rbi/gems/constant_resolver@0.2.0.rbi +90 -0
- data/sorbet/rbi/gems/diff-lcs@1.5.0.rbi +1079 -0
- data/sorbet/rbi/gems/digest@3.1.0.rbi +189 -0
- data/sorbet/rbi/gems/erubi@1.11.0.rbi +140 -0
- data/sorbet/rbi/gems/globalid@1.0.0.rbi +572 -0
- data/sorbet/rbi/gems/i18n@1.12.0.rbi +2296 -0
- data/sorbet/rbi/gems/json@2.6.2.rbi +1548 -0
- data/sorbet/rbi/gems/language_server-protocol@3.16.0.3.rbi +8 -0
- data/sorbet/rbi/gems/loofah@2.18.0.rbi +877 -0
- data/sorbet/rbi/gems/m@1.6.0.rbi +257 -0
- data/sorbet/rbi/gems/marcel@1.0.2.rbi +220 -0
- data/sorbet/rbi/gems/mini_mime@1.1.2.rbi +170 -0
- data/sorbet/rbi/gems/mini_portile2@2.8.0.rbi +8 -0
- data/sorbet/rbi/gems/minitest-focus@1.3.1.rbi +104 -0
- data/sorbet/rbi/gems/minitest@5.16.2.rbi +2136 -0
- data/sorbet/rbi/gems/mocha@1.14.0.rbi +4177 -0
- data/sorbet/rbi/gems/net-imap@0.2.3.rbi +2147 -0
- data/sorbet/rbi/gems/net-pop@0.1.1.rbi +926 -0
- data/sorbet/rbi/gems/net-protocol@0.1.3.rbi +11 -0
- data/sorbet/rbi/gems/net-smtp@0.3.1.rbi +1108 -0
- data/sorbet/rbi/gems/netrc@0.11.0.rbi +153 -0
- data/sorbet/rbi/gems/nio4r@2.5.8.rbi +292 -0
- data/sorbet/rbi/gems/nokogiri@1.13.8.rbi +6478 -0
- data/sorbet/rbi/gems/parallel@1.22.1.rbi +277 -0
- data/sorbet/rbi/gems/parser@3.1.2.1.rbi +9029 -0
- data/sorbet/rbi/gems/prettier_print@0.1.0.rbi +8 -0
- data/sorbet/rbi/gems/pry@0.14.1.rbi +8 -0
- data/sorbet/rbi/gems/racc@1.6.0.rbi +152 -0
- data/sorbet/rbi/gems/rack-test@2.0.2.rbi +953 -0
- data/sorbet/rbi/gems/rack@2.2.4.rbi +5636 -0
- data/sorbet/rbi/gems/rails-html-sanitizer@1.4.3.rbi +688 -0
- data/sorbet/rbi/gems/rails@7.0.3.1.rbi +8 -0
- data/sorbet/rbi/gems/railties@7.0.3.1.rbi +3507 -0
- data/sorbet/rbi/gems/rainbow@3.1.1.rbi +392 -0
- data/sorbet/rbi/gems/rake@13.0.6.rbi +2924 -0
- data/sorbet/rbi/gems/rbi@0.0.15.rbi +3007 -0
- data/sorbet/rbi/gems/regexp_parser@2.5.0.rbi +3383 -0
- data/sorbet/rbi/gems/rexml@3.2.5.rbi +4714 -0
- data/sorbet/rbi/gems/rubocop-ast@1.21.0.rbi +6961 -0
- data/sorbet/rbi/gems/rubocop-performance@1.14.3.rbi +2986 -0
- data/sorbet/rbi/gems/{rubocop-shopify@2.0.1.rbi → rubocop-shopify@2.9.0.rbi} +4 -4
- data/sorbet/rbi/gems/rubocop-sorbet@0.6.11.rbi +992 -0
- data/sorbet/rbi/gems/rubocop@1.34.1.rbi +51820 -0
- data/sorbet/rbi/gems/ruby-lsp@0.2.1.rbi +11 -0
- data/sorbet/rbi/gems/smart_properties@1.17.0.rbi +474 -0
- data/sorbet/rbi/gems/spoom@1.1.11.rbi +2181 -0
- data/sorbet/rbi/gems/spring@4.0.0.rbi +411 -0
- data/sorbet/rbi/gems/strscan@3.0.4.rbi +8 -0
- data/sorbet/rbi/gems/syntax_tree@3.3.0.rbi +8 -0
- data/sorbet/rbi/gems/tapioca@0.9.2.rbi +3181 -0
- data/sorbet/rbi/gems/thor@1.2.1.rbi +3956 -0
- data/sorbet/rbi/gems/timeout@0.3.0.rbi +142 -0
- data/sorbet/rbi/gems/tzinfo@2.0.5.rbi +5896 -0
- data/sorbet/rbi/gems/unicode-display_width@2.2.0.rbi +48 -0
- data/sorbet/rbi/gems/unparser@0.6.5.rbi +4529 -0
- data/sorbet/rbi/gems/webrick@1.7.0.rbi +2582 -0
- data/sorbet/rbi/gems/websocket-driver@0.7.5.rbi +993 -0
- data/sorbet/rbi/gems/yard-sorbet@0.6.1.rbi +388 -0
- data/sorbet/rbi/gems/yard@0.9.28.rbi +18242 -0
- data/sorbet/rbi/gems/zeitwerk@2.6.0.rbi +867 -0
- data/sorbet/rbi/shims/psych.rbi +5 -0
- data/sorbet/tapioca/require.rb +2 -3
- metadata +88 -157
- data/.github/probots.yml +0 -2
- data/library.yml +0 -6
- data/service.yml +0 -1
- data/sorbet/rbi/gems/actioncable@7.0.0.alpha-d612542336d9a61381311c95a27d801bb4094779.rbi +0 -860
- data/sorbet/rbi/gems/actionmailbox@7.0.0.alpha-d612542336d9a61381311c95a27d801bb4094779.rbi +0 -568
- data/sorbet/rbi/gems/actionmailer@7.0.0.alpha-d612542336d9a61381311c95a27d801bb4094779.rbi +0 -587
- data/sorbet/rbi/gems/actionpack@7.0.0.alpha-d612542336d9a61381311c95a27d801bb4094779.rbi +0 -5314
- data/sorbet/rbi/gems/actiontext@7.0.0.alpha-d612542336d9a61381311c95a27d801bb4094779.rbi +0 -699
- data/sorbet/rbi/gems/actionview@7.0.0.alpha-d612542336d9a61381311c95a27d801bb4094779.rbi +0 -2515
- data/sorbet/rbi/gems/activejob@7.0.0.alpha-d612542336d9a61381311c95a27d801bb4094779.rbi +0 -624
- data/sorbet/rbi/gems/activemodel@7.0.0.alpha-d612542336d9a61381311c95a27d801bb4094779.rbi +0 -1248
- data/sorbet/rbi/gems/activerecord@7.0.0.alpha-d612542336d9a61381311c95a27d801bb4094779.rbi +0 -8363
- data/sorbet/rbi/gems/activestorage@7.0.0.alpha-d612542336d9a61381311c95a27d801bb4094779.rbi +0 -876
- data/sorbet/rbi/gems/activesupport@7.0.0.alpha-d612542336d9a61381311c95a27d801bb4094779.rbi +0 -3987
- data/sorbet/rbi/gems/colorize@0.8.1.rbi +0 -40
- data/sorbet/rbi/gems/commander@4.5.2.rbi +0 -8
- data/sorbet/rbi/gems/concurrent-ruby@1.1.8.rbi +0 -1969
- data/sorbet/rbi/gems/constant_resolver@0.1.5.rbi +0 -26
- data/sorbet/rbi/gems/erubi@1.10.0.rbi +0 -41
- data/sorbet/rbi/gems/globalid@0.4.2.rbi +0 -178
- data/sorbet/rbi/gems/highline@2.0.3.rbi +0 -8
- data/sorbet/rbi/gems/i18n@1.8.10.rbi +0 -600
- data/sorbet/rbi/gems/loofah@2.9.0.rbi +0 -274
- data/sorbet/rbi/gems/m@1.5.1.rbi +0 -108
- data/sorbet/rbi/gems/marcel@1.0.0.rbi +0 -70
- data/sorbet/rbi/gems/mini_mime@1.0.3.rbi +0 -71
- data/sorbet/rbi/gems/minitest-focus@1.2.1.rbi +0 -8
- data/sorbet/rbi/gems/minitest@5.14.4.rbi +0 -544
- data/sorbet/rbi/gems/mocha@1.12.0.rbi +0 -953
- data/sorbet/rbi/gems/nio4r@2.5.7.rbi +0 -90
- data/sorbet/rbi/gems/nokogiri@1.11.2.rbi +0 -1647
- data/sorbet/rbi/gems/parallel@1.20.1.rbi +0 -117
- data/sorbet/rbi/gems/parlour@6.0.0.rbi +0 -1272
- data/sorbet/rbi/gems/parser@3.0.0.0.rbi +0 -1745
- data/sorbet/rbi/gems/pry@0.14.0.rbi +0 -8
- data/sorbet/rbi/gems/psych@3.3.2.rbi +0 -24
- data/sorbet/rbi/gems/racc@1.5.2.rbi +0 -57
- data/sorbet/rbi/gems/rack-test@1.1.0.rbi +0 -335
- data/sorbet/rbi/gems/rack@2.2.3.rbi +0 -1718
- data/sorbet/rbi/gems/rails-html-sanitizer@1.3.0.rbi +0 -213
- data/sorbet/rbi/gems/rails@7.0.0.alpha-d612542336d9a61381311c95a27d801bb4094779.rbi +0 -8
- data/sorbet/rbi/gems/railties@7.0.0.alpha-d612542336d9a61381311c95a27d801bb4094779.rbi +0 -880
- data/sorbet/rbi/gems/rainbow@3.0.0.rbi +0 -155
- data/sorbet/rbi/gems/rake@13.0.3.rbi +0 -837
- data/sorbet/rbi/gems/regexp_parser@2.1.1.rbi +0 -8
- data/sorbet/rbi/gems/rexml@3.2.4.rbi +0 -8
- data/sorbet/rbi/gems/rubocop-ast@1.4.1.rbi +0 -8
- data/sorbet/rbi/gems/rubocop-performance@1.10.2.rbi +0 -8
- data/sorbet/rbi/gems/rubocop-sorbet@0.6.1.rbi +0 -8
- data/sorbet/rbi/gems/rubocop@1.12.0.rbi +0 -8
- data/sorbet/rbi/gems/smart_properties@1.15.0.rbi +0 -168
- data/sorbet/rbi/gems/spoom@1.1.0.rbi +0 -1061
- data/sorbet/rbi/gems/spring@2.1.1.rbi +0 -160
- data/sorbet/rbi/gems/sprockets-rails@3.2.2.rbi +0 -451
- data/sorbet/rbi/gems/sprockets@4.0.2.rbi +0 -1133
- data/sorbet/rbi/gems/tapioca@0.4.19.rbi +0 -603
- data/sorbet/rbi/gems/thor@1.1.0.rbi +0 -893
- data/sorbet/rbi/gems/tzinfo@2.0.4.rbi +0 -566
- data/sorbet/rbi/gems/unicode-display_width@2.0.0.rbi +0 -8
- data/sorbet/rbi/gems/websocket-driver@0.7.3.rbi +0 -438
- data/sorbet/rbi/gems/zeitwerk@2.4.2.rbi +0 -177
@@ -0,0 +1,867 @@
|
|
1
|
+
# typed: true
|
2
|
+
|
3
|
+
# DO NOT EDIT MANUALLY
|
4
|
+
# This is an autogenerated file for types exported from the `zeitwerk` gem.
|
5
|
+
# Please instead update this file by running `bin/tapioca gem zeitwerk`.
|
6
|
+
|
7
|
+
# Kernel extensions for minitest
|
8
|
+
#
|
9
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/kernel.rb:3
|
10
|
+
module Kernel
|
11
|
+
private
|
12
|
+
|
13
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/kernel.rb:24
|
14
|
+
def require(path); end
|
15
|
+
|
16
|
+
class << self
|
17
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/kernel.rb:24
|
18
|
+
def require(path); end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk.rb:3
|
23
|
+
module Zeitwerk
|
24
|
+
class << self
|
25
|
+
# This is a dangerous method.
|
26
|
+
#
|
27
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk.rb:19
|
28
|
+
def with_loader; end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/error.rb:4
|
33
|
+
class Zeitwerk::Error < ::StandardError; end
|
34
|
+
|
35
|
+
# Centralizes the logic for the trace point used to detect the creation of
|
36
|
+
# explicit namespaces, needed to descend into matching subdirectories right
|
37
|
+
# after the constant has been defined.
|
38
|
+
#
|
39
|
+
# The implementation assumes an explicit namespace is managed by one loader.
|
40
|
+
# Loaders that reopen namespaces owned by other projects are responsible for
|
41
|
+
# loading their constant before setup. This is documented.
|
42
|
+
#
|
43
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/explicit_namespace.rb:11
|
44
|
+
module Zeitwerk::ExplicitNamespace
|
45
|
+
extend ::Zeitwerk::RealModName
|
46
|
+
|
47
|
+
class << self
|
48
|
+
# Maps constant paths that correspond to explicit namespaces according to
|
49
|
+
# the file system, to the loader responsible for them.
|
50
|
+
#
|
51
|
+
# @private
|
52
|
+
#
|
53
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/explicit_namespace.rb:20
|
54
|
+
def cpaths; end
|
55
|
+
|
56
|
+
# @private
|
57
|
+
#
|
58
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/explicit_namespace.rb:24
|
59
|
+
def mutex; end
|
60
|
+
|
61
|
+
# Asserts `cpath` corresponds to an explicit namespace for which `loader`
|
62
|
+
# is responsible.
|
63
|
+
#
|
64
|
+
# @private
|
65
|
+
#
|
66
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/explicit_namespace.rb:35
|
67
|
+
def register(cpath, loader); end
|
68
|
+
|
69
|
+
# @private
|
70
|
+
#
|
71
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/explicit_namespace.rb:28
|
72
|
+
def tracer; end
|
73
|
+
|
74
|
+
# @private
|
75
|
+
#
|
76
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/explicit_namespace.rb:46
|
77
|
+
def unregister_loader(loader); end
|
78
|
+
|
79
|
+
private
|
80
|
+
|
81
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/explicit_namespace.rb:54
|
82
|
+
def disable_tracer_if_unneeded; end
|
83
|
+
|
84
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/explicit_namespace.rb:61
|
85
|
+
def tracepoint_class_callback(event); end
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/gem_inflector.rb:5
|
90
|
+
class Zeitwerk::GemInflector < ::Zeitwerk::Inflector
|
91
|
+
# @return [GemInflector] a new instance of GemInflector
|
92
|
+
#
|
93
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/gem_inflector.rb:6
|
94
|
+
def initialize(root_file); end
|
95
|
+
|
96
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/gem_inflector.rb:13
|
97
|
+
def camelize(basename, abspath); end
|
98
|
+
end
|
99
|
+
|
100
|
+
# @private
|
101
|
+
#
|
102
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/gem_loader.rb:7
|
103
|
+
class Zeitwerk::GemLoader < ::Zeitwerk::Loader
|
104
|
+
# @return [GemLoader] a new instance of GemLoader
|
105
|
+
#
|
106
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/gem_loader.rb:17
|
107
|
+
def initialize(root_file, warn_on_extra_files:); end
|
108
|
+
|
109
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/gem_loader.rb:30
|
110
|
+
def setup; end
|
111
|
+
|
112
|
+
private
|
113
|
+
|
114
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/gem_loader.rb:38
|
115
|
+
def warn_on_extra_files; end
|
116
|
+
|
117
|
+
class << self
|
118
|
+
# @private
|
119
|
+
#
|
120
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/gem_loader.rb:12
|
121
|
+
def _new(root_file, warn_on_extra_files:); end
|
122
|
+
end
|
123
|
+
end
|
124
|
+
|
125
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/inflector.rb:4
|
126
|
+
class Zeitwerk::Inflector
|
127
|
+
# Very basic snake case -> camel case conversion.
|
128
|
+
#
|
129
|
+
# inflector = Zeitwerk::Inflector.new
|
130
|
+
# inflector.camelize("post", ...) # => "Post"
|
131
|
+
# inflector.camelize("users_controller", ...) # => "UsersController"
|
132
|
+
# inflector.camelize("api", ...) # => "Api"
|
133
|
+
#
|
134
|
+
# Takes into account hard-coded mappings configured with `inflect`.
|
135
|
+
#
|
136
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/inflector.rb:15
|
137
|
+
def camelize(basename, _abspath); end
|
138
|
+
|
139
|
+
# Configures hard-coded inflections:
|
140
|
+
#
|
141
|
+
# inflector = Zeitwerk::Inflector.new
|
142
|
+
# inflector.inflect(
|
143
|
+
# "html_parser" => "HTMLParser",
|
144
|
+
# "mysql_adapter" => "MySQLAdapter"
|
145
|
+
# )
|
146
|
+
#
|
147
|
+
# inflector.camelize("html_parser", abspath) # => "HTMLParser"
|
148
|
+
# inflector.camelize("mysql_adapter", abspath) # => "MySQLAdapter"
|
149
|
+
# inflector.camelize("users_controller", abspath) # => "UsersController"
|
150
|
+
#
|
151
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/inflector.rb:32
|
152
|
+
def inflect(inflections); end
|
153
|
+
|
154
|
+
private
|
155
|
+
|
156
|
+
# Hard-coded basename to constant name user maps that override the default
|
157
|
+
# inflection logic.
|
158
|
+
#
|
159
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/inflector.rb:42
|
160
|
+
def overrides; end
|
161
|
+
end
|
162
|
+
|
163
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/loader.rb:6
|
164
|
+
class Zeitwerk::Loader
|
165
|
+
include ::Zeitwerk::RealModName
|
166
|
+
include ::Zeitwerk::Loader::Callbacks
|
167
|
+
include ::Zeitwerk::Loader::Helpers
|
168
|
+
include ::Zeitwerk::Loader::Config
|
169
|
+
|
170
|
+
# @return [Loader] a new instance of Loader
|
171
|
+
#
|
172
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/loader.rb:83
|
173
|
+
def initialize; end
|
174
|
+
|
175
|
+
# We keep track of autoloaded directories to remove them from the registry
|
176
|
+
# at the end of eager loading.
|
177
|
+
#
|
178
|
+
# Files are removed as they are autoloaded, but directories need to wait due
|
179
|
+
# to concurrency (see why in Zeitwerk::Loader::Callbacks#on_dir_autoloaded).
|
180
|
+
#
|
181
|
+
# @private
|
182
|
+
#
|
183
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/loader.rb:39
|
184
|
+
def autoloaded_dirs; end
|
185
|
+
|
186
|
+
# Maps absolute paths for which an autoload has been set ---and not
|
187
|
+
# executed--- to their corresponding parent class or module and constant
|
188
|
+
# name.
|
189
|
+
#
|
190
|
+
# "/Users/fxn/blog/app/models/user.rb" => [Object, :User],
|
191
|
+
# "/Users/fxn/blog/app/models/hotel/pricing.rb" => [Hotel, :Pricing]
|
192
|
+
# ...
|
193
|
+
#
|
194
|
+
# @private
|
195
|
+
#
|
196
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/loader.rb:29
|
197
|
+
def autoloads; end
|
198
|
+
|
199
|
+
# Eager loads all files in the root directories, recursively. Files do not
|
200
|
+
# need to be in `$LOAD_PATH`, absolute file names are used. Ignored files
|
201
|
+
# are not eager loaded. You can opt-out specifically in specific files and
|
202
|
+
# directories with `do_not_eager_load`, and that can be overridden passing
|
203
|
+
# `force: true`.
|
204
|
+
#
|
205
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/loader.rb:218
|
206
|
+
def eager_load(force: T.unsafe(nil)); end
|
207
|
+
|
208
|
+
# Maps constant paths of namespaces to arrays of corresponding directories.
|
209
|
+
#
|
210
|
+
# For example, given this mapping:
|
211
|
+
#
|
212
|
+
# "Admin" => [
|
213
|
+
# "/Users/fxn/blog/app/controllers/admin",
|
214
|
+
# "/Users/fxn/blog/app/models/admin",
|
215
|
+
# ...
|
216
|
+
# ]
|
217
|
+
#
|
218
|
+
# when `Admin` gets defined we know that it plays the role of a namespace and
|
219
|
+
# that its children are spread over those directories. We'll visit them to set
|
220
|
+
# up the corresponding autoloads.
|
221
|
+
#
|
222
|
+
# @private
|
223
|
+
#
|
224
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/loader.rb:73
|
225
|
+
def lazy_subdirs; end
|
226
|
+
|
227
|
+
# @private
|
228
|
+
#
|
229
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/loader.rb:77
|
230
|
+
def mutex; end
|
231
|
+
|
232
|
+
# @private
|
233
|
+
#
|
234
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/loader.rb:81
|
235
|
+
def mutex2; end
|
236
|
+
|
237
|
+
# Unloads all loaded code, and calls setup again so that the loader is able
|
238
|
+
# to pick any changes in the file system.
|
239
|
+
#
|
240
|
+
# This method is not thread-safe, please see how this can be achieved by
|
241
|
+
# client code in the README of the project.
|
242
|
+
#
|
243
|
+
# @raise [Zeitwerk::Error]
|
244
|
+
#
|
245
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/loader.rb:202
|
246
|
+
def reload; end
|
247
|
+
|
248
|
+
# Sets autoloads in the root namespace.
|
249
|
+
#
|
250
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/loader.rb:101
|
251
|
+
def setup; end
|
252
|
+
|
253
|
+
# Stores metadata needed for unloading. Its entries look like this:
|
254
|
+
#
|
255
|
+
# "Admin::Role" => [".../admin/role.rb", [Admin, :Role]]
|
256
|
+
#
|
257
|
+
# The cpath as key helps implementing unloadable_cpath? The file name is
|
258
|
+
# stored in order to be able to delete it from $LOADED_FEATURES, and the
|
259
|
+
# pair [Module, Symbol] is used to remove_const the constant from the class
|
260
|
+
# or module object.
|
261
|
+
#
|
262
|
+
# If reloading is enabled, this hash is filled as constants are autoloaded
|
263
|
+
# or eager loaded. Otherwise, the collection remains empty.
|
264
|
+
#
|
265
|
+
# @private
|
266
|
+
#
|
267
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/loader.rb:55
|
268
|
+
def to_unload; end
|
269
|
+
|
270
|
+
# Removes loaded constants and configured autoloads.
|
271
|
+
#
|
272
|
+
# The objects the constants stored are no longer reachable through them. In
|
273
|
+
# addition, since said objects are normally not referenced from anywhere
|
274
|
+
# else, they are eligible for garbage collection, which would effectively
|
275
|
+
# unload them.
|
276
|
+
#
|
277
|
+
# This method is public but undocumented. Main interface is `reload`, which
|
278
|
+
# means `unload` + `setup`. This one is avaiable to be used together with
|
279
|
+
# `unregister`, which is undocumented too.
|
280
|
+
#
|
281
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/loader.rb:127
|
282
|
+
def unload; end
|
283
|
+
|
284
|
+
# Says if the given constant path would be unloaded on reload. This
|
285
|
+
# predicate returns `false` if reloading is disabled.
|
286
|
+
#
|
287
|
+
# @return [Boolean]
|
288
|
+
#
|
289
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/loader.rb:267
|
290
|
+
def unloadable_cpath?(cpath); end
|
291
|
+
|
292
|
+
# Returns an array with the constant paths that would be unloaded on reload.
|
293
|
+
# This predicate returns an empty array if reloading is disabled.
|
294
|
+
#
|
295
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/loader.rb:275
|
296
|
+
def unloadable_cpaths; end
|
297
|
+
|
298
|
+
# This is a dangerous method.
|
299
|
+
#
|
300
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/loader.rb:283
|
301
|
+
def unregister; end
|
302
|
+
|
303
|
+
private
|
304
|
+
|
305
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/loader.rb:397
|
306
|
+
def autoload_file(parent, cname, file); end
|
307
|
+
|
308
|
+
# @return [Boolean]
|
309
|
+
#
|
310
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/loader.rb:453
|
311
|
+
def autoload_path_set_by_me_for?(parent, cname); end
|
312
|
+
|
313
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/loader.rb:376
|
314
|
+
def autoload_subdir(parent, cname, subdir); end
|
315
|
+
|
316
|
+
# `dir` is the directory that would have autovivified a namespace. `file` is
|
317
|
+
# the file where we've found the namespace is explicitly defined.
|
318
|
+
#
|
319
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/loader.rb:421
|
320
|
+
def promote_namespace_from_implicit_to_explicit(dir:, file:, parent:, cname:); end
|
321
|
+
|
322
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/loader.rb:467
|
323
|
+
def raise_if_conflicting_directory(dir); end
|
324
|
+
|
325
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/loader.rb:462
|
326
|
+
def register_explicit_namespace(cpath); end
|
327
|
+
|
328
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/loader.rb:491
|
329
|
+
def run_on_unload_callbacks(cpath, value, abspath); end
|
330
|
+
|
331
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/loader.rb:432
|
332
|
+
def set_autoload(parent, cname, abspath); end
|
333
|
+
|
334
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/loader.rb:333
|
335
|
+
def set_autoloads_in_dir(dir, parent); end
|
336
|
+
|
337
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/loader.rb:498
|
338
|
+
def unload_autoload(parent, cname); end
|
339
|
+
|
340
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/loader.rb:504
|
341
|
+
def unload_cref(parent, cname); end
|
342
|
+
|
343
|
+
class << self
|
344
|
+
# Returns an array with the absolute paths of the root directories of all
|
345
|
+
# registered loaders. This is a read-only collection.
|
346
|
+
#
|
347
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/loader.rb:325
|
348
|
+
def all_dirs; end
|
349
|
+
|
350
|
+
# Returns the value of attribute default_logger.
|
351
|
+
#
|
352
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/loader.rb:292
|
353
|
+
def default_logger; end
|
354
|
+
|
355
|
+
# Sets the attribute default_logger
|
356
|
+
#
|
357
|
+
# @param value the value to set the attribute default_logger to.
|
358
|
+
#
|
359
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/loader.rb:292
|
360
|
+
def default_logger=(_arg0); end
|
361
|
+
|
362
|
+
# Broadcasts `eager_load` to all loaders.
|
363
|
+
#
|
364
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/loader.rb:317
|
365
|
+
def eager_load_all; end
|
366
|
+
|
367
|
+
# This is a shortcut for
|
368
|
+
#
|
369
|
+
# require "zeitwerk"
|
370
|
+
# loader = Zeitwerk::Loader.new
|
371
|
+
# loader.tag = File.basename(__FILE__, ".rb")
|
372
|
+
# loader.inflector = Zeitwerk::GemInflector.new(__FILE__)
|
373
|
+
# loader.push_dir(__dir__)
|
374
|
+
#
|
375
|
+
# except that this method returns the same object in subsequent calls from
|
376
|
+
# the same file, in the unlikely case the gem wants to be able to reload.
|
377
|
+
#
|
378
|
+
# This method returns a subclass of Zeitwerk::Loader, but the exact type
|
379
|
+
# is private, client code can only rely on the interface.
|
380
|
+
#
|
381
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/loader.rb:309
|
382
|
+
def for_gem(warn_on_extra_files: T.unsafe(nil)); end
|
383
|
+
end
|
384
|
+
end
|
385
|
+
|
386
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/loader/callbacks.rb:3
|
387
|
+
module Zeitwerk::Loader::Callbacks
|
388
|
+
include ::Zeitwerk::RealModName
|
389
|
+
|
390
|
+
# Invoked from our decorated Kernel#require when a managed directory is
|
391
|
+
# autoloaded.
|
392
|
+
#
|
393
|
+
# @private
|
394
|
+
#
|
395
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/loader/callbacks.rb:34
|
396
|
+
def on_dir_autoloaded(dir); end
|
397
|
+
|
398
|
+
# Invoked from our decorated Kernel#require when a managed file is autoloaded.
|
399
|
+
#
|
400
|
+
# @private
|
401
|
+
#
|
402
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/loader/callbacks.rb:10
|
403
|
+
def on_file_autoloaded(file); end
|
404
|
+
|
405
|
+
# Invoked when a class or module is created or reopened, either from the
|
406
|
+
# tracer or from module autovivification. If the namespace has matching
|
407
|
+
# subdirectories, we descend into them now.
|
408
|
+
#
|
409
|
+
# @private
|
410
|
+
#
|
411
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/loader/callbacks.rb:73
|
412
|
+
def on_namespace_loaded(namespace); end
|
413
|
+
|
414
|
+
private
|
415
|
+
|
416
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/loader/callbacks.rb:84
|
417
|
+
def run_on_load_callbacks(cpath, value, abspath); end
|
418
|
+
end
|
419
|
+
|
420
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/loader/config.rb:6
|
421
|
+
module Zeitwerk::Loader::Config
|
422
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/loader/config.rb:82
|
423
|
+
def initialize; end
|
424
|
+
|
425
|
+
# Configure directories or glob patterns to be collapsed.
|
426
|
+
#
|
427
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/loader/config.rb:191
|
428
|
+
def collapse(*glob_patterns); end
|
429
|
+
|
430
|
+
# The actual collection of absolute directory names at the time the collapse
|
431
|
+
# glob patterns were expanded. Computed on setup, and recomputed on reload.
|
432
|
+
#
|
433
|
+
# @private
|
434
|
+
#
|
435
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/loader/config.rb:51
|
436
|
+
def collapse_dirs; end
|
437
|
+
|
438
|
+
# Absolute paths of directories or glob patterns to be collapsed.
|
439
|
+
#
|
440
|
+
# @private
|
441
|
+
#
|
442
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/loader/config.rb:44
|
443
|
+
def collapse_glob_patterns; end
|
444
|
+
|
445
|
+
# Absolute paths of the root directories. This is a read-only collection,
|
446
|
+
# please push here via `push_dir`.
|
447
|
+
#
|
448
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/loader/config.rb:143
|
449
|
+
def dirs; end
|
450
|
+
|
451
|
+
# Let eager load ignore the given files or directories. The constants defined
|
452
|
+
# in those files are still autoloadable.
|
453
|
+
#
|
454
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/loader/config.rb:173
|
455
|
+
def do_not_eager_load(*paths); end
|
456
|
+
|
457
|
+
# Absolute paths of files or directories not to be eager loaded.
|
458
|
+
#
|
459
|
+
# @private
|
460
|
+
#
|
461
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/loader/config.rb:57
|
462
|
+
def eager_load_exclusions; end
|
463
|
+
|
464
|
+
# You need to call this method before setup in order to be able to reload.
|
465
|
+
# There is no way to undo this, either you want to reload or you don't.
|
466
|
+
#
|
467
|
+
# @raise [Zeitwerk::Error]
|
468
|
+
#
|
469
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/loader/config.rb:152
|
470
|
+
def enable_reloading; end
|
471
|
+
|
472
|
+
# Configure files, directories, or glob patterns to be totally ignored.
|
473
|
+
#
|
474
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/loader/config.rb:180
|
475
|
+
def ignore(*glob_patterns); end
|
476
|
+
|
477
|
+
# Absolute paths of files, directories, or glob patterns to be totally
|
478
|
+
# ignored.
|
479
|
+
#
|
480
|
+
# @private
|
481
|
+
#
|
482
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/loader/config.rb:30
|
483
|
+
def ignored_glob_patterns; end
|
484
|
+
|
485
|
+
# The actual collection of absolute file and directory names at the time the
|
486
|
+
# ignored glob patterns were expanded. Computed on setup, and recomputed on
|
487
|
+
# reload.
|
488
|
+
#
|
489
|
+
# @private
|
490
|
+
#
|
491
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/loader/config.rb:38
|
492
|
+
def ignored_paths; end
|
493
|
+
|
494
|
+
# @private
|
495
|
+
# @return [Boolean]
|
496
|
+
#
|
497
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/loader/config.rb:269
|
498
|
+
def ignores?(abspath); end
|
499
|
+
|
500
|
+
# Returns the value of attribute inflector.
|
501
|
+
#
|
502
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/loader/config.rb:23
|
503
|
+
def inflector; end
|
504
|
+
|
505
|
+
# Sets the attribute inflector
|
506
|
+
#
|
507
|
+
# @param value the value to set the attribute inflector to.
|
508
|
+
#
|
509
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/loader/config.rb:23
|
510
|
+
def inflector=(_arg0); end
|
511
|
+
|
512
|
+
# Logs to `$stdout`, handy shortcut for debugging.
|
513
|
+
#
|
514
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/loader/config.rb:263
|
515
|
+
def log!; end
|
516
|
+
|
517
|
+
# Returns the value of attribute logger.
|
518
|
+
#
|
519
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/loader/config.rb:80
|
520
|
+
def logger; end
|
521
|
+
|
522
|
+
# Sets the attribute logger
|
523
|
+
#
|
524
|
+
# @param value the value to set the attribute logger to.
|
525
|
+
#
|
526
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/loader/config.rb:80
|
527
|
+
def logger=(_arg0); end
|
528
|
+
|
529
|
+
# Configure a block to be invoked once a certain constant path is loaded.
|
530
|
+
# Supports multiple callbacks, and if there are many, they are executed in
|
531
|
+
# the order in which they were defined.
|
532
|
+
#
|
533
|
+
# loader.on_load("SomeApiClient") do |klass, _abspath|
|
534
|
+
# klass.endpoint = "https://api.dev"
|
535
|
+
# end
|
536
|
+
#
|
537
|
+
# Can also be configured for any constant loaded:
|
538
|
+
#
|
539
|
+
# loader.on_load do |cpath, value, abspath|
|
540
|
+
# # ...
|
541
|
+
# end
|
542
|
+
#
|
543
|
+
# @raise [TypeError]
|
544
|
+
#
|
545
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/loader/config.rb:227
|
546
|
+
def on_load(cpath = T.unsafe(nil), &block); end
|
547
|
+
|
548
|
+
# User-oriented callbacks to be fired when a constant is loaded.
|
549
|
+
#
|
550
|
+
# @private
|
551
|
+
#
|
552
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/loader/config.rb:70
|
553
|
+
def on_load_callbacks; end
|
554
|
+
|
555
|
+
# Configure a block to be called after setup and on each reload.
|
556
|
+
# If setup was already done, the block runs immediately.
|
557
|
+
#
|
558
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/loader/config.rb:203
|
559
|
+
def on_setup(&block); end
|
560
|
+
|
561
|
+
# User-oriented callbacks to be fired on setup and on reload.
|
562
|
+
#
|
563
|
+
# @private
|
564
|
+
#
|
565
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/loader/config.rb:63
|
566
|
+
def on_setup_callbacks; end
|
567
|
+
|
568
|
+
# Configure a block to be invoked right before a certain constant is removed.
|
569
|
+
# Supports multiple callbacks, and if there are many, they are executed in the
|
570
|
+
# order in which they were defined.
|
571
|
+
#
|
572
|
+
# loader.on_unload("Country") do |klass, _abspath|
|
573
|
+
# klass.clear_cache
|
574
|
+
# end
|
575
|
+
#
|
576
|
+
# Can also be configured for any removed constant:
|
577
|
+
#
|
578
|
+
# loader.on_unload do |cpath, value, abspath|
|
579
|
+
# # ...
|
580
|
+
# end
|
581
|
+
#
|
582
|
+
# @raise [TypeError]
|
583
|
+
#
|
584
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/loader/config.rb:252
|
585
|
+
def on_unload(cpath = T.unsafe(nil), &block); end
|
586
|
+
|
587
|
+
# User-oriented callbacks to be fired before constants are removed.
|
588
|
+
#
|
589
|
+
# @private
|
590
|
+
#
|
591
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/loader/config.rb:77
|
592
|
+
def on_unload_callbacks; end
|
593
|
+
|
594
|
+
# Pushes `path` to the list of root directories.
|
595
|
+
#
|
596
|
+
# Raises `Zeitwerk::Error` if `path` does not exist, or if another loader in
|
597
|
+
# the same process already manages that directory or one of its ascendants or
|
598
|
+
# descendants.
|
599
|
+
#
|
600
|
+
# @raise [Zeitwerk::Error]
|
601
|
+
#
|
602
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/loader/config.rb:107
|
603
|
+
def push_dir(path, namespace: T.unsafe(nil)); end
|
604
|
+
|
605
|
+
# @return [Boolean]
|
606
|
+
#
|
607
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/loader/config.rb:165
|
608
|
+
def reloading_enabled?; end
|
609
|
+
|
610
|
+
# Absolute paths of the root directories. Stored in a hash to preserve
|
611
|
+
# order, easily handle duplicates, and also be able to have a fast lookup,
|
612
|
+
# needed for detecting nested paths.
|
613
|
+
#
|
614
|
+
# "/Users/fxn/blog/app/assets" => true,
|
615
|
+
# "/Users/fxn/blog/app/channels" => true,
|
616
|
+
# ...
|
617
|
+
#
|
618
|
+
# This is a private collection maintained by the loader. The public
|
619
|
+
# interface for it is `push_dir` and `dirs`.
|
620
|
+
#
|
621
|
+
# @private
|
622
|
+
#
|
623
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/loader/config.rb:20
|
624
|
+
def root_dirs; end
|
625
|
+
|
626
|
+
# Returns the loader's tag.
|
627
|
+
#
|
628
|
+
# Implemented as a method instead of via attr_reader for symmetry with the
|
629
|
+
# writer below.
|
630
|
+
#
|
631
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/loader/config.rb:128
|
632
|
+
def tag; end
|
633
|
+
|
634
|
+
# Sets a tag for the loader, useful for logging.
|
635
|
+
#
|
636
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/loader/config.rb:135
|
637
|
+
def tag=(tag); end
|
638
|
+
|
639
|
+
private
|
640
|
+
|
641
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/loader/config.rb:278
|
642
|
+
def actual_root_dirs; end
|
643
|
+
|
644
|
+
# @return [Boolean]
|
645
|
+
#
|
646
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/loader/config.rb:295
|
647
|
+
def collapse?(dir); end
|
648
|
+
|
649
|
+
# @return [Boolean]
|
650
|
+
#
|
651
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/loader/config.rb:290
|
652
|
+
def excluded_from_eager_load?(abspath); end
|
653
|
+
|
654
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/loader/config.rb:305
|
655
|
+
def expand_glob_patterns(glob_patterns); end
|
656
|
+
|
657
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/loader/config.rb:300
|
658
|
+
def expand_paths(paths); end
|
659
|
+
|
660
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/loader/config.rb:317
|
661
|
+
def recompute_collapse_dirs; end
|
662
|
+
|
663
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/loader/config.rb:312
|
664
|
+
def recompute_ignored_paths; end
|
665
|
+
|
666
|
+
# @return [Boolean]
|
667
|
+
#
|
668
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/loader/config.rb:285
|
669
|
+
def root_dir?(dir); end
|
670
|
+
end
|
671
|
+
|
672
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/loader/helpers.rb:3
|
673
|
+
module Zeitwerk::Loader::Helpers
|
674
|
+
private
|
675
|
+
|
676
|
+
# @return [Boolean]
|
677
|
+
#
|
678
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/loader/helpers.rb:120
|
679
|
+
def cdef?(parent, cname); end
|
680
|
+
|
681
|
+
# @raise [NameError]
|
682
|
+
#
|
683
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/loader/helpers.rb:126
|
684
|
+
def cget(parent, cname); end
|
685
|
+
|
686
|
+
# Symbol#name was introduced in Ruby 3.0. It returns always the same
|
687
|
+
# frozen object, so we may save a few string allocations.
|
688
|
+
#
|
689
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/loader/helpers.rb:114
|
690
|
+
def cpath(parent, cname); end
|
691
|
+
|
692
|
+
# @return [Boolean]
|
693
|
+
#
|
694
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/loader/helpers.rb:68
|
695
|
+
def dir?(path); end
|
696
|
+
|
697
|
+
# @return [Boolean]
|
698
|
+
#
|
699
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/loader/helpers.rb:46
|
700
|
+
def has_at_least_one_ruby_file?(dir); end
|
701
|
+
|
702
|
+
# @return [Boolean]
|
703
|
+
#
|
704
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/loader/helpers.rb:73
|
705
|
+
def hidden?(basename); end
|
706
|
+
|
707
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/loader/helpers.rb:9
|
708
|
+
def log(message); end
|
709
|
+
|
710
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/loader/helpers.rb:17
|
711
|
+
def ls(dir); end
|
712
|
+
|
713
|
+
# @return [Boolean]
|
714
|
+
#
|
715
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/loader/helpers.rb:63
|
716
|
+
def ruby?(path); end
|
717
|
+
|
718
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/loader/helpers.rb:101
|
719
|
+
def strict_autoload_path(parent, cname); end
|
720
|
+
end
|
721
|
+
|
722
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/loader.rb:16
|
723
|
+
Zeitwerk::Loader::MUTEX = T.let(T.unsafe(nil), Thread::Mutex)
|
724
|
+
|
725
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/error.rb:13
|
726
|
+
class Zeitwerk::NameError < ::NameError; end
|
727
|
+
|
728
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/real_mod_name.rb:3
|
729
|
+
module Zeitwerk::RealModName
|
730
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/real_mod_name.rb:14
|
731
|
+
def real_mod_name(mod); end
|
732
|
+
end
|
733
|
+
|
734
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/real_mod_name.rb:4
|
735
|
+
Zeitwerk::RealModName::UNBOUND_METHOD_MODULE_NAME = T.let(T.unsafe(nil), UnboundMethod)
|
736
|
+
|
737
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/registry.rb:4
|
738
|
+
module Zeitwerk::Registry
|
739
|
+
class << self
|
740
|
+
# Maps absolute paths to the loaders responsible for them.
|
741
|
+
#
|
742
|
+
# This information is used by our decorated `Kernel#require` to be able to
|
743
|
+
# invoke callbacks and autovivify modules.
|
744
|
+
#
|
745
|
+
# @private
|
746
|
+
#
|
747
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/registry.rb:26
|
748
|
+
def autoloads; end
|
749
|
+
|
750
|
+
# Registers gem loaders to let `for_gem` be idempotent in case of reload.
|
751
|
+
#
|
752
|
+
# @private
|
753
|
+
#
|
754
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/registry.rb:17
|
755
|
+
def gem_loaders_by_root_file; end
|
756
|
+
|
757
|
+
# @private
|
758
|
+
# @return [Boolean]
|
759
|
+
#
|
760
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/registry.rb:113
|
761
|
+
def inception?(cpath); end
|
762
|
+
|
763
|
+
# This hash table addresses an edge case in which an autoload is ignored.
|
764
|
+
#
|
765
|
+
# For example, let's suppose we want to autoload in a gem like this:
|
766
|
+
#
|
767
|
+
# # lib/my_gem.rb
|
768
|
+
# loader = Zeitwerk::Loader.new
|
769
|
+
# loader.push_dir(__dir__)
|
770
|
+
# loader.setup
|
771
|
+
#
|
772
|
+
# module MyGem
|
773
|
+
# end
|
774
|
+
#
|
775
|
+
# if you require "my_gem", as Bundler would do, this happens while setting
|
776
|
+
# up autoloads:
|
777
|
+
#
|
778
|
+
# 1. Object.autoload?(:MyGem) returns `nil` because the autoload for
|
779
|
+
# the constant is issued by Zeitwerk while the same file is being
|
780
|
+
# required.
|
781
|
+
# 2. The constant `MyGem` is undefined while setup runs.
|
782
|
+
#
|
783
|
+
# Therefore, a directory `lib/my_gem` would autovivify a module according to
|
784
|
+
# the existing information. But that would be wrong.
|
785
|
+
#
|
786
|
+
# To overcome this fundamental limitation, we keep track of the constant
|
787
|
+
# paths that are in this situation ---in the example above, "MyGem"--- and
|
788
|
+
# take this collection into account for the autovivification logic.
|
789
|
+
#
|
790
|
+
# Note that you cannot generally address this by moving the setup code
|
791
|
+
# below the constant definition, because we want libraries to be able to
|
792
|
+
# use managed constants in the module body:
|
793
|
+
#
|
794
|
+
# module MyGem
|
795
|
+
# include MyConcern
|
796
|
+
# end
|
797
|
+
#
|
798
|
+
# @private
|
799
|
+
#
|
800
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/registry.rb:65
|
801
|
+
def inceptions; end
|
802
|
+
|
803
|
+
# @private
|
804
|
+
#
|
805
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/registry.rb:121
|
806
|
+
def loader_for(path); end
|
807
|
+
|
808
|
+
# This method returns always a loader, the same instance for the same root
|
809
|
+
# file. That is how Zeitwerk::Loader.for_gem is idempotent.
|
810
|
+
#
|
811
|
+
# @private
|
812
|
+
#
|
813
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/registry.rb:89
|
814
|
+
def loader_for_gem(root_file, warn_on_extra_files:); end
|
815
|
+
|
816
|
+
# Keeps track of all loaders. Useful to broadcast messages and to prevent
|
817
|
+
# them from being garbage collected.
|
818
|
+
#
|
819
|
+
# @private
|
820
|
+
#
|
821
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/registry.rb:11
|
822
|
+
def loaders; end
|
823
|
+
|
824
|
+
# @private
|
825
|
+
#
|
826
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/registry.rb:127
|
827
|
+
def on_unload(loader); end
|
828
|
+
|
829
|
+
# @private
|
830
|
+
#
|
831
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/registry.rb:95
|
832
|
+
def register_autoload(loader, abspath); end
|
833
|
+
|
834
|
+
# @private
|
835
|
+
#
|
836
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/registry.rb:107
|
837
|
+
def register_inception(cpath, abspath, loader); end
|
838
|
+
|
839
|
+
# Registers a loader.
|
840
|
+
#
|
841
|
+
# @private
|
842
|
+
#
|
843
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/registry.rb:71
|
844
|
+
def register_loader(loader); end
|
845
|
+
|
846
|
+
# @private
|
847
|
+
#
|
848
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/registry.rb:101
|
849
|
+
def unregister_autoload(abspath); end
|
850
|
+
|
851
|
+
# @private
|
852
|
+
#
|
853
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/registry.rb:77
|
854
|
+
def unregister_loader(loader); end
|
855
|
+
end
|
856
|
+
end
|
857
|
+
|
858
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/error.rb:7
|
859
|
+
class Zeitwerk::ReloadingDisabledError < ::Zeitwerk::Error
|
860
|
+
# @return [ReloadingDisabledError] a new instance of ReloadingDisabledError
|
861
|
+
#
|
862
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/error.rb:8
|
863
|
+
def initialize; end
|
864
|
+
end
|
865
|
+
|
866
|
+
# source://zeitwerk-2.6.0/lib/zeitwerk/version.rb:4
|
867
|
+
Zeitwerk::VERSION = T.let(T.unsafe(nil), String)
|