acts-as-messageable 0.5.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/dependabot.yml +8 -0
- data/.github/workflows/test.yml +152 -0
- data/.rubocop.yml +14 -1
- data/.rubocop_todo.yml +49 -7
- data/.ruby-version +1 -0
- data/Appraisals +11 -0
- data/Dockerfile +2 -1
- data/Gemfile +19 -13
- data/Gemfile.lock +186 -97
- data/README.md +2 -3
- data/Rakefile +6 -1
- data/VERSION +1 -1
- data/acts-as-messageable.gemspec +193 -40
- data/bin/tapioca +29 -0
- data/docker-compose.yml +82 -71
- data/gemfiles/rails_3.2.gemfile +14 -9
- data/gemfiles/rails_4.2.gemfile +14 -9
- data/gemfiles/rails_5.2.gemfile +14 -9
- data/gemfiles/rails_6.0.gemfile +14 -9
- data/gemfiles/rails_7.0.gemfile +29 -0
- data/gemfiles/rails_master.gemfile +15 -9
- data/lib/acts-as-messageable.rb +1 -0
- data/lib/acts_as_messageable/message.rb +62 -5
- data/lib/acts_as_messageable/model.rb +71 -20
- data/lib/acts_as_messageable/rails3.rb +27 -2
- data/lib/acts_as_messageable/rails4.rb +31 -4
- data/lib/acts_as_messageable/rails6.rb +34 -2
- data/lib/acts_as_messageable/railtie.rb +1 -0
- data/lib/acts_as_messageable/relation.rb +18 -2
- data/lib/acts_as_messageable/scopes.rb +11 -0
- data/lib/acts_as_messageable.rb +18 -0
- data/lib/generators/acts_as_messageable/migration/migration_generator.rb +4 -0
- data/lib/generators/acts_as_messageable/migration/templates/migration.rb +1 -0
- data/lib/generators/acts_as_messageable/migration/templates/migration_indexes.rb +1 -0
- data/lib/generators/acts_as_messageable/migration/templates/migration_opened_as_datetime.rb +1 -0
- data/lib/generators/acts_as_messageable/migration/templates/migration_permanent.rb +1 -0
- data/sorbet/config +4 -0
- data/sorbet/rbi/annotations/actionpack.rbi +428 -0
- data/sorbet/rbi/annotations/actionview.rbi +77 -0
- data/sorbet/rbi/annotations/activerecord.rbi +18 -0
- data/sorbet/rbi/annotations/activesupport.rbi +52 -0
- data/sorbet/rbi/annotations/faraday.rbi +17 -0
- data/sorbet/rbi/annotations/railties.rbi +58 -0
- data/sorbet/rbi/annotations/rainbow.rbi +269 -0
- data/sorbet/rbi/dsl/abstract_controller/caching/fragments.rbi +23 -0
- data/sorbet/rbi/dsl/abstract_controller/caching.rbi +30 -0
- data/sorbet/rbi/dsl/abstract_controller/callbacks.rbi +23 -0
- data/sorbet/rbi/dsl/abstract_controller/helpers.rbi +23 -0
- data/sorbet/rbi/dsl/abstract_controller/rendering.rbi +9 -0
- data/sorbet/rbi/dsl/abstract_controller/url_for.rbi +23 -0
- data/sorbet/rbi/dsl/action_controller/caching.rbi +29 -0
- data/sorbet/rbi/dsl/action_controller/conditional_get.rbi +23 -0
- data/sorbet/rbi/dsl/action_controller/content_security_policy.rbi +31 -0
- data/sorbet/rbi/dsl/action_controller/data_streaming.rbi +9 -0
- data/sorbet/rbi/dsl/action_controller/etag_with_flash.rbi +24 -0
- data/sorbet/rbi/dsl/action_controller/etag_with_template_digest.rbi +30 -0
- data/sorbet/rbi/dsl/action_controller/flash.rbi +19 -0
- data/sorbet/rbi/dsl/action_controller/form_builder.rbi +19 -0
- data/sorbet/rbi/dsl/action_controller/helpers.rbi +36 -0
- data/sorbet/rbi/dsl/action_controller/params_wrapper.rbi +23 -0
- data/sorbet/rbi/dsl/action_controller/redirecting.rbi +24 -0
- data/sorbet/rbi/dsl/action_controller/renderers/all.rbi +24 -0
- data/sorbet/rbi/dsl/action_controller/renderers.rbi +23 -0
- data/sorbet/rbi/dsl/action_controller/request_forgery_protection.rbi +31 -0
- data/sorbet/rbi/dsl/action_controller/rescue.rbi +24 -0
- data/sorbet/rbi/dsl/action_controller/test_case/behavior.rbi +24 -0
- data/sorbet/rbi/dsl/action_controller/url_for.rbi +24 -0
- data/sorbet/rbi/dsl/action_dispatch/routing/url_for.rbi +23 -0
- data/sorbet/rbi/dsl/action_view/helpers/form_helper.rbi +10 -0
- data/sorbet/rbi/dsl/action_view/helpers/form_tag_helper.rbi +10 -0
- data/sorbet/rbi/dsl/action_view/helpers/text_helper.rbi +9 -0
- data/sorbet/rbi/dsl/action_view/helpers.rbi +10 -0
- data/sorbet/rbi/dsl/action_view/layouts.rbi +24 -0
- data/sorbet/rbi/dsl/action_view/rendering.rbi +9 -0
- data/sorbet/rbi/dsl/active_model/attribute_methods.rbi +27 -0
- data/sorbet/rbi/dsl/active_model/attributes.rbi +34 -0
- data/sorbet/rbi/dsl/active_model/dirty.rbi +28 -0
- data/sorbet/rbi/dsl/active_model/serializers/json.rbi +22 -0
- data/sorbet/rbi/dsl/active_model/validations/callbacks.rbi +22 -0
- data/sorbet/rbi/dsl/active_model/validations.rbi +27 -0
- data/sorbet/rbi/dsl/active_record/attribute_methods/dirty.rbi +38 -0
- data/sorbet/rbi/dsl/active_record/attribute_methods/time_zone_conversion.rbi +32 -0
- data/sorbet/rbi/dsl/active_record/attribute_methods.rbi +53 -0
- data/sorbet/rbi/dsl/active_record/attributes.rbi +19 -0
- data/sorbet/rbi/dsl/active_record/callbacks.rbi +22 -0
- data/sorbet/rbi/dsl/active_record/core.rbi +55 -0
- data/sorbet/rbi/dsl/active_record/encryption/encryptable_record.rbi +23 -0
- data/sorbet/rbi/dsl/active_record/inheritance.rbi +27 -0
- data/sorbet/rbi/dsl/active_record/integration.rbi +32 -0
- data/sorbet/rbi/dsl/active_record/locking/optimistic.rbi +22 -0
- data/sorbet/rbi/dsl/active_record/model_schema.rbi +52 -0
- data/sorbet/rbi/dsl/active_record/nested_attributes.rbi +22 -0
- data/sorbet/rbi/dsl/active_record/readonly_attributes.rbi +19 -0
- data/sorbet/rbi/dsl/active_record/reflection.rbi +32 -0
- data/sorbet/rbi/dsl/active_record/scoping/default.rbi +23 -0
- data/sorbet/rbi/dsl/active_record/scoping.rbi +23 -0
- data/sorbet/rbi/dsl/active_record/serialization.rbi +22 -0
- data/sorbet/rbi/dsl/active_record/signed_id.rbi +22 -0
- data/sorbet/rbi/dsl/active_record/test_fixtures.rbi +58 -0
- data/sorbet/rbi/dsl/active_record/timestamp.rbi +23 -0
- data/sorbet/rbi/dsl/active_record/validations.rbi +28 -0
- data/sorbet/rbi/dsl/active_support/actionable_error.rbi +23 -0
- data/sorbet/rbi/dsl/active_support/callbacks.rbi +22 -0
- data/sorbet/rbi/dsl/active_support/rescuable.rbi +23 -0
- data/sorbet/rbi/dsl/active_support/testing/file_fixtures.rbi +22 -0
- data/sorbet/rbi/gems/actionpack@7.0.4.3.rbi +19265 -0
- data/sorbet/rbi/gems/actionview@7.0.4.3.rbi +15482 -0
- data/sorbet/rbi/gems/activemodel@7.0.4.3.rbi +6025 -0
- data/sorbet/rbi/gems/activerecord@7.0.4.3.rbi +37852 -0
- data/sorbet/rbi/gems/activesupport@7.0.4.3.rbi +18788 -0
- data/sorbet/rbi/gems/addressable@2.4.0.rbi +8 -0
- data/sorbet/rbi/gems/appraisal@2.4.1.rbi +584 -0
- data/sorbet/rbi/gems/ast@2.4.2.rbi +584 -0
- data/sorbet/rbi/gems/builder@3.2.4.rbi +8 -0
- data/sorbet/rbi/gems/coderay@1.1.3.rbi +3426 -0
- data/sorbet/rbi/gems/commander@4.6.0.rbi +8 -0
- data/sorbet/rbi/gems/concurrent-ruby@1.2.2.rbi +11545 -0
- data/sorbet/rbi/gems/coveralls_reborn@0.27.0.rbi +8 -0
- data/sorbet/rbi/gems/crass@1.0.6.rbi +622 -0
- data/sorbet/rbi/gems/descendants_tracker@0.0.4.rbi +8 -0
- data/sorbet/rbi/gems/diff-lcs@1.5.0.rbi +1079 -0
- data/sorbet/rbi/gems/docile@1.4.0.rbi +8 -0
- data/sorbet/rbi/gems/erubi@1.12.0.rbi +146 -0
- data/sorbet/rbi/gems/faraday@0.9.2.rbi +964 -0
- data/sorbet/rbi/gems/git@1.11.0.rbi +2700 -0
- data/sorbet/rbi/gems/github_api@0.16.0.rbi +8 -0
- data/sorbet/rbi/gems/hashie@5.0.0.rbi +8 -0
- data/sorbet/rbi/gems/highline@2.0.3.rbi +8 -0
- data/sorbet/rbi/gems/i18n@1.12.0.rbi +2296 -0
- data/sorbet/rbi/gems/jeweler@2.3.9.rbi +1591 -0
- data/sorbet/rbi/gems/json@2.6.3.rbi +1541 -0
- data/sorbet/rbi/gems/jwt@2.5.0.rbi +8 -0
- data/sorbet/rbi/gems/loofah@2.19.1.rbi +904 -0
- data/sorbet/rbi/gems/method_source@1.0.0.rbi +272 -0
- data/sorbet/rbi/gems/mime-types@2.99.3.rbi +8 -0
- data/sorbet/rbi/gems/minitest@5.18.0.rbi +1491 -0
- data/sorbet/rbi/gems/multi_json@1.15.0.rbi +8 -0
- data/sorbet/rbi/gems/multi_xml@0.6.0.rbi +8 -0
- data/sorbet/rbi/gems/multipart-post@2.2.3.rbi +8 -0
- data/sorbet/rbi/gems/netrc@0.11.0.rbi +158 -0
- data/sorbet/rbi/gems/nokogiri@1.14.2.rbi +7244 -0
- data/sorbet/rbi/gems/oauth2@1.4.8.rbi +8 -0
- data/sorbet/rbi/gems/parallel@1.22.1.rbi +277 -0
- data/sorbet/rbi/gems/pg@1.4.6.rbi +2574 -0
- data/sorbet/rbi/gems/polyfill@1.9.0.rbi +8 -0
- data/sorbet/rbi/gems/pry@0.14.2.rbi +10081 -0
- data/sorbet/rbi/gems/psych@4.0.6.rbi +1819 -0
- data/sorbet/rbi/gems/racc@1.6.2.rbi +155 -0
- data/sorbet/rbi/gems/rack-test@2.0.2.rbi +943 -0
- data/sorbet/rbi/gems/rack@2.2.6.4.rbi +5659 -0
- data/sorbet/rbi/gems/rails-dom-testing@2.0.3.rbi +455 -0
- data/sorbet/rbi/gems/rails-html-sanitizer@1.5.0.rbi +685 -0
- data/sorbet/rbi/gems/railties@7.0.4.3.rbi +4553 -0
- data/sorbet/rbi/gems/rainbow@3.1.1.rbi +8 -0
- data/sorbet/rbi/gems/rake@13.0.6.rbi +2959 -0
- data/sorbet/rbi/gems/rbi@0.0.16.rbi +3008 -0
- data/sorbet/rbi/gems/rbs@2.8.0.rbi +8 -0
- data/sorbet/rbi/gems/rchardet@1.8.0.rbi +1078 -0
- data/sorbet/rbi/gems/rdoc@6.5.0.rbi +12441 -0
- data/sorbet/rbi/gems/regexp_parser@2.7.0.rbi +8 -0
- data/sorbet/rbi/gems/rexml@3.2.5.rbi +8 -0
- data/sorbet/rbi/gems/rspec-core@3.12.0.rbi +10798 -0
- data/sorbet/rbi/gems/rspec-expectations@3.12.0.rbi +8090 -0
- data/sorbet/rbi/gems/rspec-mocks@3.12.0.rbi +5296 -0
- data/sorbet/rbi/gems/rspec-support@3.12.0.rbi +1617 -0
- data/sorbet/rbi/gems/rspec@3.12.0.rbi +88 -0
- data/sorbet/rbi/gems/ruby-progressbar@1.13.0.rbi +8 -0
- data/sorbet/rbi/gems/safe_type@1.1.1.rbi +8 -0
- data/sorbet/rbi/gems/semver2@3.4.2.rbi +8 -0
- data/sorbet/rbi/gems/simplecov-html@0.12.3.rbi +8 -0
- data/sorbet/rbi/gems/simplecov@0.22.0.rbi +8 -0
- data/sorbet/rbi/gems/simplecov_json_formatter@0.1.4.rbi +8 -0
- data/sorbet/rbi/gems/sorbet-coerce@0.7.0.rbi +8 -0
- data/sorbet/rbi/gems/stringio@3.0.2.rbi +8 -0
- data/sorbet/rbi/gems/sync@0.5.0.rbi +8 -0
- data/sorbet/rbi/gems/term-ansicolor@1.7.1.rbi +8 -0
- data/sorbet/rbi/gems/thor@1.2.1.rbi +3956 -0
- data/sorbet/rbi/gems/thread_safe@0.3.6.rbi +8 -0
- data/sorbet/rbi/gems/timecop@0.9.6.rbi +361 -0
- data/sorbet/rbi/gems/tins@1.32.1.rbi +8 -0
- data/sorbet/rbi/gems/tzinfo@2.0.6.rbi +5917 -0
- data/sorbet/rbi/gems/unicode-display_width@2.4.2.rbi +8 -0
- data/sorbet/rbi/gems/unparser@0.6.7.rbi +4515 -0
- data/sorbet/rbi/gems/webrick@1.7.0.rbi +2553 -0
- data/sorbet/rbi/gems/yard@0.9.28.rbi +17954 -0
- data/sorbet/rbi/gems/zeitwerk@2.6.7.rbi +966 -0
- data/sorbet/rbi/models/acts-as-messageable/message.rbi +668 -0
- data/sorbet/rbi/models/acts-as-messageable/user.rbi +343 -0
- data/sorbet/rbi/rails-rbi/active_record_base.rbi +119 -0
- data/sorbet/rbi/rails-rbi/active_record_relation.rbi +180 -0
- data/sorbet/rbi/shims/activerecord.rbi +4 -0
- data/sorbet/rbi/shims/model.rbi +9 -0
- data/sorbet/tapioca/config.yml +10 -0
- data/sorbet/tapioca/pre_require.rb +5 -0
- data/sorbet/tapioca/require.rb +10 -0
- data/spec/acts_as_messageable_spec.rb +7 -4
- data/spec/custom_class_spec.rb +1 -0
- data/spec/custom_required_spec.rb +8 -4
- data/spec/group_messages_spec.rb +1 -0
- data/spec/migrations_spec.rb +2 -1
- data/spec/spec_helper.rb +19 -9
- data/spec/support/admin.rb +3 -0
- data/spec/support/custom_message.rb +3 -0
- data/spec/support/custom_message_uuid.rb +1 -0
- data/spec/support/custom_search_user.rb +3 -0
- data/spec/support/men.rb +1 -0
- data/spec/support/send_message.rb +8 -1
- data/spec/support/table_schema.rb +7 -6
- data/spec/support/user.rb +3 -0
- data/spec/support/uuid_user.rb +3 -0
- data/tasks/types.rake +46 -0
- metadata +261 -11
- data/.travis.yml +0 -55
@@ -0,0 +1,966 @@
|
|
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
|
+
# source://zeitwerk//lib/zeitwerk/kernel.rb#3
|
8
|
+
module Kernel
|
9
|
+
private
|
10
|
+
|
11
|
+
# source://zeitwerk//lib/zeitwerk/kernel.rb#27
|
12
|
+
def require(path); end
|
13
|
+
|
14
|
+
class << self
|
15
|
+
# source://zeitwerk//lib/zeitwerk/kernel.rb#27
|
16
|
+
def require(path); end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
# source://zeitwerk//lib/zeitwerk.rb#3
|
21
|
+
module Zeitwerk
|
22
|
+
class << self
|
23
|
+
# This is a dangerous method.
|
24
|
+
#
|
25
|
+
# source://zeitwerk//lib/zeitwerk.rb#20
|
26
|
+
def with_loader; end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
# source://zeitwerk//lib/zeitwerk/error.rb#4
|
31
|
+
class Zeitwerk::Error < ::StandardError; end
|
32
|
+
|
33
|
+
# Centralizes the logic for the trace point used to detect the creation of
|
34
|
+
# explicit namespaces, needed to descend into matching subdirectories right
|
35
|
+
# after the constant has been defined.
|
36
|
+
#
|
37
|
+
# The implementation assumes an explicit namespace is managed by one loader.
|
38
|
+
# Loaders that reopen namespaces owned by other projects are responsible for
|
39
|
+
# loading their constant before setup. This is documented.
|
40
|
+
#
|
41
|
+
# source://zeitwerk//lib/zeitwerk/explicit_namespace.rb#11
|
42
|
+
module Zeitwerk::ExplicitNamespace
|
43
|
+
extend ::Zeitwerk::RealModName
|
44
|
+
|
45
|
+
class << self
|
46
|
+
# source://zeitwerk//lib/zeitwerk/explicit_namespace.rb#35
|
47
|
+
def __register(cpath, loader); end
|
48
|
+
|
49
|
+
# source://zeitwerk//lib/zeitwerk/explicit_namespace.rb#53
|
50
|
+
def __registered?(cpath); end
|
51
|
+
|
52
|
+
# source://zeitwerk//lib/zeitwerk/explicit_namespace.rb#45
|
53
|
+
def __unregister_loader(loader); end
|
54
|
+
|
55
|
+
private
|
56
|
+
|
57
|
+
# Maps constant paths that correspond to explicit namespaces according to
|
58
|
+
# the file system, to the loader responsible for them.
|
59
|
+
#
|
60
|
+
# source://zeitwerk//lib/zeitwerk/explicit_namespace.rb#20
|
61
|
+
def cpaths; end
|
62
|
+
|
63
|
+
# source://zeitwerk//lib/zeitwerk/explicit_namespace.rb#58
|
64
|
+
def disable_tracer_if_unneeded; end
|
65
|
+
|
66
|
+
# Returns the value of attribute mutex.
|
67
|
+
#
|
68
|
+
# source://zeitwerk//lib/zeitwerk/explicit_namespace.rb#24
|
69
|
+
def mutex; end
|
70
|
+
|
71
|
+
# source://zeitwerk//lib/zeitwerk/explicit_namespace.rb#35
|
72
|
+
def register(cpath, loader); end
|
73
|
+
|
74
|
+
# source://zeitwerk//lib/zeitwerk/explicit_namespace.rb#53
|
75
|
+
def registered?(cpath); end
|
76
|
+
|
77
|
+
# source://zeitwerk//lib/zeitwerk/explicit_namespace.rb#65
|
78
|
+
def tracepoint_class_callback(event); end
|
79
|
+
|
80
|
+
# Returns the value of attribute tracer.
|
81
|
+
#
|
82
|
+
# source://zeitwerk//lib/zeitwerk/explicit_namespace.rb#28
|
83
|
+
def tracer; end
|
84
|
+
|
85
|
+
# source://zeitwerk//lib/zeitwerk/explicit_namespace.rb#45
|
86
|
+
def unregister_loader(loader); end
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
# source://zeitwerk//lib/zeitwerk/gem_inflector.rb#4
|
91
|
+
class Zeitwerk::GemInflector < ::Zeitwerk::Inflector
|
92
|
+
# @return [GemInflector] a new instance of GemInflector
|
93
|
+
#
|
94
|
+
# source://zeitwerk//lib/zeitwerk/gem_inflector.rb#6
|
95
|
+
def initialize(root_file); end
|
96
|
+
|
97
|
+
# source://zeitwerk//lib/zeitwerk/gem_inflector.rb#13
|
98
|
+
def camelize(basename, abspath); end
|
99
|
+
end
|
100
|
+
|
101
|
+
# @private
|
102
|
+
#
|
103
|
+
# source://zeitwerk//lib/zeitwerk/gem_loader.rb#5
|
104
|
+
class Zeitwerk::GemLoader < ::Zeitwerk::Loader
|
105
|
+
# @return [GemLoader] a new instance of GemLoader
|
106
|
+
#
|
107
|
+
# source://zeitwerk//lib/zeitwerk/gem_loader.rb#17
|
108
|
+
def initialize(root_file, warn_on_extra_files:); end
|
109
|
+
|
110
|
+
# source://zeitwerk//lib/zeitwerk/gem_loader.rb#30
|
111
|
+
def setup; end
|
112
|
+
|
113
|
+
private
|
114
|
+
|
115
|
+
# source://zeitwerk//lib/zeitwerk/gem_loader.rb#38
|
116
|
+
def warn_on_extra_files; end
|
117
|
+
|
118
|
+
class << self
|
119
|
+
# @private
|
120
|
+
#
|
121
|
+
# source://zeitwerk//lib/zeitwerk/gem_loader.rb#12
|
122
|
+
def _new(root_file, warn_on_extra_files:); end
|
123
|
+
|
124
|
+
private
|
125
|
+
|
126
|
+
def new(*_arg0); end
|
127
|
+
end
|
128
|
+
end
|
129
|
+
|
130
|
+
# source://zeitwerk//lib/zeitwerk/inflector.rb#4
|
131
|
+
class Zeitwerk::Inflector
|
132
|
+
# Very basic snake case -> camel case conversion.
|
133
|
+
#
|
134
|
+
# inflector = Zeitwerk::Inflector.new
|
135
|
+
# inflector.camelize("post", ...) # => "Post"
|
136
|
+
# inflector.camelize("users_controller", ...) # => "UsersController"
|
137
|
+
# inflector.camelize("api", ...) # => "Api"
|
138
|
+
#
|
139
|
+
# Takes into account hard-coded mappings configured with `inflect`.
|
140
|
+
#
|
141
|
+
# source://zeitwerk//lib/zeitwerk/inflector.rb#15
|
142
|
+
def camelize(basename, _abspath); end
|
143
|
+
|
144
|
+
# Configures hard-coded inflections:
|
145
|
+
#
|
146
|
+
# inflector = Zeitwerk::Inflector.new
|
147
|
+
# inflector.inflect(
|
148
|
+
# "html_parser" => "HTMLParser",
|
149
|
+
# "mysql_adapter" => "MySQLAdapter"
|
150
|
+
# )
|
151
|
+
#
|
152
|
+
# inflector.camelize("html_parser", abspath) # => "HTMLParser"
|
153
|
+
# inflector.camelize("mysql_adapter", abspath) # => "MySQLAdapter"
|
154
|
+
# inflector.camelize("users_controller", abspath) # => "UsersController"
|
155
|
+
#
|
156
|
+
# source://zeitwerk//lib/zeitwerk/inflector.rb#32
|
157
|
+
def inflect(inflections); end
|
158
|
+
|
159
|
+
private
|
160
|
+
|
161
|
+
# Hard-coded basename to constant name user maps that override the default
|
162
|
+
# inflection logic.
|
163
|
+
#
|
164
|
+
# source://zeitwerk//lib/zeitwerk/inflector.rb#42
|
165
|
+
def overrides; end
|
166
|
+
end
|
167
|
+
|
168
|
+
# This is a private module.
|
169
|
+
#
|
170
|
+
# source://zeitwerk//lib/zeitwerk/internal.rb#4
|
171
|
+
module Zeitwerk::Internal
|
172
|
+
# source://zeitwerk//lib/zeitwerk/internal.rb#5
|
173
|
+
def internal(method_name); end
|
174
|
+
end
|
175
|
+
|
176
|
+
# source://zeitwerk//lib/zeitwerk/loader.rb#6
|
177
|
+
class Zeitwerk::Loader
|
178
|
+
include ::Zeitwerk::RealModName
|
179
|
+
include ::Zeitwerk::Loader::Callbacks
|
180
|
+
include ::Zeitwerk::Loader::Helpers
|
181
|
+
include ::Zeitwerk::Loader::Config
|
182
|
+
include ::Zeitwerk::Loader::EagerLoad
|
183
|
+
extend ::Zeitwerk::Internal
|
184
|
+
|
185
|
+
# @return [Loader] a new instance of Loader
|
186
|
+
#
|
187
|
+
# source://zeitwerk//lib/zeitwerk/loader.rb#98
|
188
|
+
def initialize; end
|
189
|
+
|
190
|
+
# source://zeitwerk//lib/zeitwerk/loader.rb#42
|
191
|
+
def __autoloaded_dirs; end
|
192
|
+
|
193
|
+
# source://zeitwerk//lib/zeitwerk/loader.rb#32
|
194
|
+
def __autoloads; end
|
195
|
+
|
196
|
+
# source://zeitwerk//lib/zeitwerk/loader.rb#76
|
197
|
+
def __namespace_dirs; end
|
198
|
+
|
199
|
+
# source://zeitwerk//lib/zeitwerk/loader.rb#260
|
200
|
+
def __shadowed_file?(file); end
|
201
|
+
|
202
|
+
# source://zeitwerk//lib/zeitwerk/loader.rb#87
|
203
|
+
def __shadowed_files; end
|
204
|
+
|
205
|
+
# source://zeitwerk//lib/zeitwerk/loader.rb#58
|
206
|
+
def __to_unload; end
|
207
|
+
|
208
|
+
# Unloads all loaded code, and calls setup again so that the loader is able
|
209
|
+
# to pick any changes in the file system.
|
210
|
+
#
|
211
|
+
# This method is not thread-safe, please see how this can be achieved by
|
212
|
+
# client code in the README of the project.
|
213
|
+
#
|
214
|
+
# @raise [Zeitwerk::Error]
|
215
|
+
#
|
216
|
+
# source://zeitwerk//lib/zeitwerk/loader.rb#221
|
217
|
+
def reload; end
|
218
|
+
|
219
|
+
# Sets autoloads in the root namespaces.
|
220
|
+
#
|
221
|
+
# source://zeitwerk//lib/zeitwerk/loader.rb#117
|
222
|
+
def setup; end
|
223
|
+
|
224
|
+
# Removes loaded constants and configured autoloads.
|
225
|
+
#
|
226
|
+
# The objects the constants stored are no longer reachable through them. In
|
227
|
+
# addition, since said objects are normally not referenced from anywhere
|
228
|
+
# else, they are eligible for garbage collection, which would effectively
|
229
|
+
# unload them.
|
230
|
+
#
|
231
|
+
# This method is public but undocumented. Main interface is `reload`, which
|
232
|
+
# means `unload` + `setup`. This one is available to be used together with
|
233
|
+
# `unregister`, which is undocumented too.
|
234
|
+
#
|
235
|
+
# source://zeitwerk//lib/zeitwerk/loader.rb#143
|
236
|
+
def unload; end
|
237
|
+
|
238
|
+
# Says if the given constant path would be unloaded on reload. This
|
239
|
+
# predicate returns `false` if reloading is disabled.
|
240
|
+
#
|
241
|
+
# @return [Boolean]
|
242
|
+
#
|
243
|
+
# source://zeitwerk//lib/zeitwerk/loader.rb#235
|
244
|
+
def unloadable_cpath?(cpath); end
|
245
|
+
|
246
|
+
# Returns an array with the constant paths that would be unloaded on reload.
|
247
|
+
# This predicate returns an empty array if reloading is disabled.
|
248
|
+
#
|
249
|
+
# source://zeitwerk//lib/zeitwerk/loader.rb#243
|
250
|
+
def unloadable_cpaths; end
|
251
|
+
|
252
|
+
# This is a dangerous method.
|
253
|
+
#
|
254
|
+
# source://zeitwerk//lib/zeitwerk/loader.rb#251
|
255
|
+
def unregister; end
|
256
|
+
|
257
|
+
private
|
258
|
+
|
259
|
+
# source://zeitwerk//lib/zeitwerk/loader.rb#393
|
260
|
+
def autoload_file(parent, cname, file); end
|
261
|
+
|
262
|
+
# @return [Boolean]
|
263
|
+
#
|
264
|
+
# source://zeitwerk//lib/zeitwerk/loader.rb#451
|
265
|
+
def autoload_path_set_by_me_for?(parent, cname); end
|
266
|
+
|
267
|
+
# source://zeitwerk//lib/zeitwerk/loader.rb#363
|
268
|
+
def autoload_subdir(parent, cname, subdir); end
|
269
|
+
|
270
|
+
# We keep track of autoloaded directories to remove them from the registry
|
271
|
+
# at the end of eager loading.
|
272
|
+
#
|
273
|
+
# Files are removed as they are autoloaded, but directories need to wait due
|
274
|
+
# to concurrency (see why in Zeitwerk::Loader::Callbacks#on_dir_autoloaded).
|
275
|
+
#
|
276
|
+
# source://zeitwerk//lib/zeitwerk/loader.rb#42
|
277
|
+
def autoloaded_dirs; end
|
278
|
+
|
279
|
+
# Maps absolute paths for which an autoload has been set ---and not
|
280
|
+
# executed--- to their corresponding parent class or module and constant
|
281
|
+
# name.
|
282
|
+
#
|
283
|
+
# "/Users/fxn/blog/app/models/user.rb" => [Object, :User],
|
284
|
+
# "/Users/fxn/blog/app/models/hotel/pricing.rb" => [Hotel, :Pricing]
|
285
|
+
# ...
|
286
|
+
#
|
287
|
+
# source://zeitwerk//lib/zeitwerk/loader.rb#32
|
288
|
+
def autoloads; end
|
289
|
+
|
290
|
+
# Returns the value of attribute mutex.
|
291
|
+
#
|
292
|
+
# source://zeitwerk//lib/zeitwerk/loader.rb#91
|
293
|
+
def mutex; end
|
294
|
+
|
295
|
+
# Returns the value of attribute mutex2.
|
296
|
+
#
|
297
|
+
# source://zeitwerk//lib/zeitwerk/loader.rb#95
|
298
|
+
def mutex2; end
|
299
|
+
|
300
|
+
# Maps namespace constant paths to their respective directories.
|
301
|
+
#
|
302
|
+
# For example, given this mapping:
|
303
|
+
#
|
304
|
+
# "Admin" => [
|
305
|
+
# "/Users/fxn/blog/app/controllers/admin",
|
306
|
+
# "/Users/fxn/blog/app/models/admin",
|
307
|
+
# ...
|
308
|
+
# ]
|
309
|
+
#
|
310
|
+
# when `Admin` gets defined we know that it plays the role of a namespace
|
311
|
+
# and that its children are spread over those directories. We'll visit them
|
312
|
+
# to set up the corresponding autoloads.
|
313
|
+
#
|
314
|
+
# source://zeitwerk//lib/zeitwerk/loader.rb#76
|
315
|
+
def namespace_dirs; end
|
316
|
+
|
317
|
+
# `dir` is the directory that would have autovivified a namespace. `file` is
|
318
|
+
# the file where we've found the namespace is explicitly defined.
|
319
|
+
#
|
320
|
+
# source://zeitwerk//lib/zeitwerk/loader.rb#419
|
321
|
+
def promote_namespace_from_implicit_to_explicit(dir:, file:, parent:, cname:); end
|
322
|
+
|
323
|
+
# source://zeitwerk//lib/zeitwerk/loader.rb#465
|
324
|
+
def raise_if_conflicting_directory(dir); end
|
325
|
+
|
326
|
+
# source://zeitwerk//lib/zeitwerk/loader.rb#460
|
327
|
+
def register_explicit_namespace(cpath); end
|
328
|
+
|
329
|
+
# source://zeitwerk//lib/zeitwerk/loader.rb#490
|
330
|
+
def run_on_unload_callbacks(cpath, value, abspath); end
|
331
|
+
|
332
|
+
# source://zeitwerk//lib/zeitwerk/loader.rb#430
|
333
|
+
def set_autoload(parent, cname, abspath); end
|
334
|
+
|
335
|
+
# source://zeitwerk//lib/zeitwerk/loader.rb#328
|
336
|
+
def set_autoloads_in_dir(dir, parent); end
|
337
|
+
|
338
|
+
# source://zeitwerk//lib/zeitwerk/loader.rb#260
|
339
|
+
def shadowed_file?(file); end
|
340
|
+
|
341
|
+
# A shadowed file is a file managed by this loader that is ignored when
|
342
|
+
# setting autoloads because its matching constant is already taken.
|
343
|
+
#
|
344
|
+
# This private set is populated as we descend. For example, if the loader
|
345
|
+
# has only scanned the top-level, `shadowed_files` does not have shadowed
|
346
|
+
# files that may exist deep in the project tree yet.
|
347
|
+
#
|
348
|
+
# source://zeitwerk//lib/zeitwerk/loader.rb#87
|
349
|
+
def shadowed_files; end
|
350
|
+
|
351
|
+
# Stores metadata needed for unloading. Its entries look like this:
|
352
|
+
#
|
353
|
+
# "Admin::Role" => [".../admin/role.rb", [Admin, :Role]]
|
354
|
+
#
|
355
|
+
# The cpath as key helps implementing unloadable_cpath? The file name is
|
356
|
+
# stored in order to be able to delete it from $LOADED_FEATURES, and the
|
357
|
+
# pair [Module, Symbol] is used to remove_const the constant from the class
|
358
|
+
# or module object.
|
359
|
+
#
|
360
|
+
# If reloading is enabled, this hash is filled as constants are autoloaded
|
361
|
+
# or eager loaded. Otherwise, the collection remains empty.
|
362
|
+
#
|
363
|
+
# source://zeitwerk//lib/zeitwerk/loader.rb#58
|
364
|
+
def to_unload; end
|
365
|
+
|
366
|
+
# source://zeitwerk//lib/zeitwerk/loader.rb#497
|
367
|
+
def unload_autoload(parent, cname); end
|
368
|
+
|
369
|
+
# source://zeitwerk//lib/zeitwerk/loader.rb#503
|
370
|
+
def unload_cref(parent, cname); end
|
371
|
+
|
372
|
+
class << self
|
373
|
+
# Returns an array with the absolute paths of the root directories of all
|
374
|
+
# registered loaders. This is a read-only collection.
|
375
|
+
#
|
376
|
+
# source://zeitwerk//lib/zeitwerk/loader.rb#322
|
377
|
+
def all_dirs; end
|
378
|
+
|
379
|
+
# Returns the value of attribute default_logger.
|
380
|
+
#
|
381
|
+
# source://zeitwerk//lib/zeitwerk/loader.rb#268
|
382
|
+
def default_logger; end
|
383
|
+
|
384
|
+
# Sets the attribute default_logger
|
385
|
+
#
|
386
|
+
# @param value the value to set the attribute default_logger to.
|
387
|
+
#
|
388
|
+
# source://zeitwerk//lib/zeitwerk/loader.rb#268
|
389
|
+
def default_logger=(_arg0); end
|
390
|
+
|
391
|
+
# Broadcasts `eager_load` to all loaders. Those that have not been setup
|
392
|
+
# are skipped.
|
393
|
+
#
|
394
|
+
# source://zeitwerk//lib/zeitwerk/loader.rb#294
|
395
|
+
def eager_load_all; end
|
396
|
+
|
397
|
+
# Broadcasts `eager_load_namespace` to all loaders. Those that have not
|
398
|
+
# been setup are skipped.
|
399
|
+
#
|
400
|
+
# source://zeitwerk//lib/zeitwerk/loader.rb#308
|
401
|
+
def eager_load_namespace(mod); end
|
402
|
+
|
403
|
+
# This is a shortcut for
|
404
|
+
#
|
405
|
+
# require "zeitwerk"
|
406
|
+
# loader = Zeitwerk::Loader.new
|
407
|
+
# loader.tag = File.basename(__FILE__, ".rb")
|
408
|
+
# loader.inflector = Zeitwerk::GemInflector.new(__FILE__)
|
409
|
+
# loader.push_dir(__dir__)
|
410
|
+
#
|
411
|
+
# except that this method returns the same object in subsequent calls from
|
412
|
+
# the same file, in the unlikely case the gem wants to be able to reload.
|
413
|
+
#
|
414
|
+
# This method returns a subclass of Zeitwerk::Loader, but the exact type
|
415
|
+
# is private, client code can only rely on the interface.
|
416
|
+
#
|
417
|
+
# source://zeitwerk//lib/zeitwerk/loader.rb#285
|
418
|
+
def for_gem(warn_on_extra_files: T.unsafe(nil)); end
|
419
|
+
end
|
420
|
+
end
|
421
|
+
|
422
|
+
# source://zeitwerk//lib/zeitwerk/loader/callbacks.rb#3
|
423
|
+
module Zeitwerk::Loader::Callbacks
|
424
|
+
include ::Zeitwerk::RealModName
|
425
|
+
|
426
|
+
# Invoked from our decorated Kernel#require when a managed directory is
|
427
|
+
# autoloaded.
|
428
|
+
#
|
429
|
+
# @private
|
430
|
+
#
|
431
|
+
# source://zeitwerk//lib/zeitwerk/loader/callbacks.rb#34
|
432
|
+
def on_dir_autoloaded(dir); end
|
433
|
+
|
434
|
+
# Invoked from our decorated Kernel#require when a managed file is autoloaded.
|
435
|
+
#
|
436
|
+
# @private
|
437
|
+
#
|
438
|
+
# source://zeitwerk//lib/zeitwerk/loader/callbacks.rb#10
|
439
|
+
def on_file_autoloaded(file); end
|
440
|
+
|
441
|
+
# Invoked when a class or module is created or reopened, either from the
|
442
|
+
# tracer or from module autovivification. If the namespace has matching
|
443
|
+
# subdirectories, we descend into them now.
|
444
|
+
#
|
445
|
+
# @private
|
446
|
+
#
|
447
|
+
# source://zeitwerk//lib/zeitwerk/loader/callbacks.rb#73
|
448
|
+
def on_namespace_loaded(namespace); end
|
449
|
+
|
450
|
+
private
|
451
|
+
|
452
|
+
# source://zeitwerk//lib/zeitwerk/loader/callbacks.rb#84
|
453
|
+
def run_on_load_callbacks(cpath, value, abspath); end
|
454
|
+
end
|
455
|
+
|
456
|
+
# source://zeitwerk//lib/zeitwerk/loader/config.rb#6
|
457
|
+
module Zeitwerk::Loader::Config
|
458
|
+
include ::Zeitwerk::RealModName
|
459
|
+
extend ::Zeitwerk::Internal
|
460
|
+
|
461
|
+
# source://zeitwerk//lib/zeitwerk/loader/config.rb#86
|
462
|
+
def initialize; end
|
463
|
+
|
464
|
+
# source://zeitwerk//lib/zeitwerk/loader/config.rb#297
|
465
|
+
def __ignores?(abspath); end
|
466
|
+
|
467
|
+
def __roots; end
|
468
|
+
|
469
|
+
# Configure directories or glob patterns to be collapsed.
|
470
|
+
#
|
471
|
+
# source://zeitwerk//lib/zeitwerk/loader/config.rb#217
|
472
|
+
def collapse(*glob_patterns); end
|
473
|
+
|
474
|
+
# If `namespaces` is falsey (default), returns an array with the absolute
|
475
|
+
# paths of the root directories as strings. If truthy, returns a hash table
|
476
|
+
# instead. Keys are the absolute paths of the root directories as strings,
|
477
|
+
# values are their corresponding namespaces, class or module objects.
|
478
|
+
#
|
479
|
+
# If `ignored` is falsey (default), ignored root directories are filtered out.
|
480
|
+
#
|
481
|
+
# These are read-only collections, please add to them with `push_dir`.
|
482
|
+
#
|
483
|
+
# source://zeitwerk//lib/zeitwerk/loader/config.rb#157
|
484
|
+
def dirs(namespaces: T.unsafe(nil), ignored: T.unsafe(nil)); end
|
485
|
+
|
486
|
+
# Let eager load ignore the given files or directories. The constants defined
|
487
|
+
# in those files are still autoloadable.
|
488
|
+
#
|
489
|
+
# source://zeitwerk//lib/zeitwerk/loader/config.rb#199
|
490
|
+
def do_not_eager_load(*paths); end
|
491
|
+
|
492
|
+
# You need to call this method before setup in order to be able to reload.
|
493
|
+
# There is no way to undo this, either you want to reload or you don't.
|
494
|
+
#
|
495
|
+
# @raise [Zeitwerk::Error]
|
496
|
+
#
|
497
|
+
# source://zeitwerk//lib/zeitwerk/loader/config.rb#178
|
498
|
+
def enable_reloading; end
|
499
|
+
|
500
|
+
# Configure files, directories, or glob patterns to be totally ignored.
|
501
|
+
#
|
502
|
+
# source://zeitwerk//lib/zeitwerk/loader/config.rb#206
|
503
|
+
def ignore(*glob_patterns); end
|
504
|
+
|
505
|
+
# Returns the value of attribute inflector.
|
506
|
+
#
|
507
|
+
# source://zeitwerk//lib/zeitwerk/loader/config.rb#11
|
508
|
+
def inflector; end
|
509
|
+
|
510
|
+
# Sets the attribute inflector
|
511
|
+
#
|
512
|
+
# @param value the value to set the attribute inflector to.
|
513
|
+
#
|
514
|
+
# source://zeitwerk//lib/zeitwerk/loader/config.rb#11
|
515
|
+
def inflector=(_arg0); end
|
516
|
+
|
517
|
+
# Logs to `$stdout`, handy shortcut for debugging.
|
518
|
+
#
|
519
|
+
# source://zeitwerk//lib/zeitwerk/loader/config.rb#289
|
520
|
+
def log!; end
|
521
|
+
|
522
|
+
# Returns the value of attribute logger.
|
523
|
+
#
|
524
|
+
# source://zeitwerk//lib/zeitwerk/loader/config.rb#14
|
525
|
+
def logger; end
|
526
|
+
|
527
|
+
# Sets the attribute logger
|
528
|
+
#
|
529
|
+
# @param value the value to set the attribute logger to.
|
530
|
+
#
|
531
|
+
# source://zeitwerk//lib/zeitwerk/loader/config.rb#14
|
532
|
+
def logger=(_arg0); end
|
533
|
+
|
534
|
+
# Configure a block to be invoked once a certain constant path is loaded.
|
535
|
+
# Supports multiple callbacks, and if there are many, they are executed in
|
536
|
+
# the order in which they were defined.
|
537
|
+
#
|
538
|
+
# loader.on_load("SomeApiClient") do |klass, _abspath|
|
539
|
+
# klass.endpoint = "https://api.dev"
|
540
|
+
# end
|
541
|
+
#
|
542
|
+
# Can also be configured for any constant loaded:
|
543
|
+
#
|
544
|
+
# loader.on_load do |cpath, value, abspath|
|
545
|
+
# # ...
|
546
|
+
# end
|
547
|
+
#
|
548
|
+
# @raise [TypeError]
|
549
|
+
#
|
550
|
+
# source://zeitwerk//lib/zeitwerk/loader/config.rb#253
|
551
|
+
def on_load(cpath = T.unsafe(nil), &block); end
|
552
|
+
|
553
|
+
# Configure a block to be called after setup and on each reload.
|
554
|
+
# If setup was already done, the block runs immediately.
|
555
|
+
#
|
556
|
+
# source://zeitwerk//lib/zeitwerk/loader/config.rb#229
|
557
|
+
def on_setup(&block); end
|
558
|
+
|
559
|
+
# Configure a block to be invoked right before a certain constant is removed.
|
560
|
+
# Supports multiple callbacks, and if there are many, they are executed in the
|
561
|
+
# order in which they were defined.
|
562
|
+
#
|
563
|
+
# loader.on_unload("Country") do |klass, _abspath|
|
564
|
+
# klass.clear_cache
|
565
|
+
# end
|
566
|
+
#
|
567
|
+
# Can also be configured for any removed constant:
|
568
|
+
#
|
569
|
+
# loader.on_unload do |cpath, value, abspath|
|
570
|
+
# # ...
|
571
|
+
# end
|
572
|
+
#
|
573
|
+
# @raise [TypeError]
|
574
|
+
#
|
575
|
+
# source://zeitwerk//lib/zeitwerk/loader/config.rb#278
|
576
|
+
def on_unload(cpath = T.unsafe(nil), &block); end
|
577
|
+
|
578
|
+
# Pushes `path` to the list of root directories.
|
579
|
+
#
|
580
|
+
# Raises `Zeitwerk::Error` if `path` does not exist, or if another loader in
|
581
|
+
# the same process already manages that directory or one of its ascendants or
|
582
|
+
# descendants.
|
583
|
+
#
|
584
|
+
# @raise [Zeitwerk::Error]
|
585
|
+
#
|
586
|
+
# source://zeitwerk//lib/zeitwerk/loader/config.rb#111
|
587
|
+
def push_dir(path, namespace: T.unsafe(nil)); end
|
588
|
+
|
589
|
+
# @return [Boolean]
|
590
|
+
#
|
591
|
+
# source://zeitwerk//lib/zeitwerk/loader/config.rb#191
|
592
|
+
def reloading_enabled?; end
|
593
|
+
|
594
|
+
# Returns the loader's tag.
|
595
|
+
#
|
596
|
+
# Implemented as a method instead of via attr_reader for symmetry with the
|
597
|
+
# writer below.
|
598
|
+
#
|
599
|
+
# source://zeitwerk//lib/zeitwerk/loader/config.rb#136
|
600
|
+
def tag; end
|
601
|
+
|
602
|
+
# Sets a tag for the loader, useful for logging.
|
603
|
+
#
|
604
|
+
# source://zeitwerk//lib/zeitwerk/loader/config.rb#143
|
605
|
+
def tag=(tag); end
|
606
|
+
|
607
|
+
private
|
608
|
+
|
609
|
+
# source://zeitwerk//lib/zeitwerk/loader/config.rb#315
|
610
|
+
def actual_roots; end
|
611
|
+
|
612
|
+
# @return [Boolean]
|
613
|
+
#
|
614
|
+
# source://zeitwerk//lib/zeitwerk/loader/config.rb#340
|
615
|
+
def collapse?(dir); end
|
616
|
+
|
617
|
+
# The actual collection of absolute directory names at the time the collapse
|
618
|
+
# glob patterns were expanded. Computed on setup, and recomputed on reload.
|
619
|
+
#
|
620
|
+
# source://zeitwerk//lib/zeitwerk/loader/config.rb#57
|
621
|
+
def collapse_dirs; end
|
622
|
+
|
623
|
+
# Absolute paths of directories or glob patterns to be collapsed.
|
624
|
+
#
|
625
|
+
# source://zeitwerk//lib/zeitwerk/loader/config.rb#50
|
626
|
+
def collapse_glob_patterns; end
|
627
|
+
|
628
|
+
# Absolute paths of files or directories not to be eager loaded.
|
629
|
+
#
|
630
|
+
# source://zeitwerk//lib/zeitwerk/loader/config.rb#63
|
631
|
+
def eager_load_exclusions; end
|
632
|
+
|
633
|
+
# @return [Boolean]
|
634
|
+
#
|
635
|
+
# source://zeitwerk//lib/zeitwerk/loader/config.rb#327
|
636
|
+
def excluded_from_eager_load?(abspath); end
|
637
|
+
|
638
|
+
# source://zeitwerk//lib/zeitwerk/loader/config.rb#350
|
639
|
+
def expand_glob_patterns(glob_patterns); end
|
640
|
+
|
641
|
+
# source://zeitwerk//lib/zeitwerk/loader/config.rb#345
|
642
|
+
def expand_paths(paths); end
|
643
|
+
|
644
|
+
# Absolute paths of files, directories, or glob patterns to be totally
|
645
|
+
# ignored.
|
646
|
+
#
|
647
|
+
# source://zeitwerk//lib/zeitwerk/loader/config.rb#36
|
648
|
+
def ignored_glob_patterns; end
|
649
|
+
|
650
|
+
# @return [Boolean]
|
651
|
+
#
|
652
|
+
# source://zeitwerk//lib/zeitwerk/loader/config.rb#310
|
653
|
+
def ignored_path?(abspath); end
|
654
|
+
|
655
|
+
# The actual collection of absolute file and directory names at the time the
|
656
|
+
# ignored glob patterns were expanded. Computed on setup, and recomputed on
|
657
|
+
# reload.
|
658
|
+
#
|
659
|
+
# source://zeitwerk//lib/zeitwerk/loader/config.rb#44
|
660
|
+
def ignored_paths; end
|
661
|
+
|
662
|
+
# source://zeitwerk//lib/zeitwerk/loader/config.rb#297
|
663
|
+
def ignores?(abspath); end
|
664
|
+
|
665
|
+
# User-oriented callbacks to be fired when a constant is loaded.
|
666
|
+
#
|
667
|
+
# source://zeitwerk//lib/zeitwerk/loader/config.rb#76
|
668
|
+
def on_load_callbacks; end
|
669
|
+
|
670
|
+
# User-oriented callbacks to be fired on setup and on reload.
|
671
|
+
#
|
672
|
+
# source://zeitwerk//lib/zeitwerk/loader/config.rb#69
|
673
|
+
def on_setup_callbacks; end
|
674
|
+
|
675
|
+
# User-oriented callbacks to be fired before constants are removed.
|
676
|
+
#
|
677
|
+
# source://zeitwerk//lib/zeitwerk/loader/config.rb#83
|
678
|
+
def on_unload_callbacks; end
|
679
|
+
|
680
|
+
# source://zeitwerk//lib/zeitwerk/loader/config.rb#362
|
681
|
+
def recompute_collapse_dirs; end
|
682
|
+
|
683
|
+
# source://zeitwerk//lib/zeitwerk/loader/config.rb#357
|
684
|
+
def recompute_ignored_paths; end
|
685
|
+
|
686
|
+
# @return [Boolean]
|
687
|
+
#
|
688
|
+
# source://zeitwerk//lib/zeitwerk/loader/config.rb#322
|
689
|
+
def root_dir?(dir); end
|
690
|
+
|
691
|
+
# Absolute paths of the root directories, mapped to their respective root namespaces:
|
692
|
+
#
|
693
|
+
# "/Users/fxn/blog/app/channels" => Object,
|
694
|
+
# "/Users/fxn/blog/app/adapters" => ActiveJob::QueueAdapters,
|
695
|
+
# ...
|
696
|
+
#
|
697
|
+
# Stored in a hash to preserve order, easily handle duplicates, and have a
|
698
|
+
# fast lookup by directory.
|
699
|
+
#
|
700
|
+
# This is a private collection maintained by the loader. The public
|
701
|
+
# interface for it is `push_dir` and `dirs`.
|
702
|
+
#
|
703
|
+
# source://zeitwerk//lib/zeitwerk/loader/config.rb#29
|
704
|
+
def roots; end
|
705
|
+
end
|
706
|
+
|
707
|
+
# source://zeitwerk//lib/zeitwerk/loader/eager_load.rb#1
|
708
|
+
module Zeitwerk::Loader::EagerLoad
|
709
|
+
# Eager loads all files in the root directories, recursively. Files do not
|
710
|
+
# need to be in `$LOAD_PATH`, absolute file names are used. Ignored and
|
711
|
+
# shadowed files are not eager loaded. You can opt-out specifically in
|
712
|
+
# specific files and directories with `do_not_eager_load`, and that can be
|
713
|
+
# overridden passing `force: true`.
|
714
|
+
#
|
715
|
+
# source://zeitwerk//lib/zeitwerk/loader/eager_load.rb#9
|
716
|
+
def eager_load(force: T.unsafe(nil)); end
|
717
|
+
|
718
|
+
# @raise [Zeitwerk::SetupRequired]
|
719
|
+
#
|
720
|
+
# source://zeitwerk//lib/zeitwerk/loader/eager_load.rb#32
|
721
|
+
def eager_load_dir(path); end
|
722
|
+
|
723
|
+
# @raise [Zeitwerk::SetupRequired]
|
724
|
+
#
|
725
|
+
# source://zeitwerk//lib/zeitwerk/loader/eager_load.rb#72
|
726
|
+
def eager_load_namespace(mod); end
|
727
|
+
|
728
|
+
# Loads the given Ruby file.
|
729
|
+
#
|
730
|
+
# Raises if the argument is ignored, shadowed, or not managed by the receiver.
|
731
|
+
#
|
732
|
+
# The method is implemented as `constantize` for files, in a sense, to be able
|
733
|
+
# to descend orderly and make sure the file is loadable.
|
734
|
+
#
|
735
|
+
# @raise [Zeitwerk::Error]
|
736
|
+
#
|
737
|
+
# source://zeitwerk//lib/zeitwerk/loader/eager_load.rb#114
|
738
|
+
def load_file(path); end
|
739
|
+
|
740
|
+
private
|
741
|
+
|
742
|
+
# The caller is responsible for making sure `namespace` is the namespace that
|
743
|
+
# corresponds to `dir`.
|
744
|
+
#
|
745
|
+
# source://zeitwerk//lib/zeitwerk/loader/eager_load.rb#154
|
746
|
+
def actual_eager_load_dir(dir, namespace, force: T.unsafe(nil)); end
|
747
|
+
|
748
|
+
# In order to invoke this method, the caller has to ensure `child` is a
|
749
|
+
# strict namespace descendant of `root_namespace`.
|
750
|
+
#
|
751
|
+
# source://zeitwerk//lib/zeitwerk/loader/eager_load.rb#189
|
752
|
+
def eager_load_child_namespace(child, child_name, root_dir, root_namespace); end
|
753
|
+
end
|
754
|
+
|
755
|
+
# source://zeitwerk//lib/zeitwerk/loader/helpers.rb#3
|
756
|
+
module Zeitwerk::Loader::Helpers
|
757
|
+
private
|
758
|
+
|
759
|
+
# @return [Boolean]
|
760
|
+
#
|
761
|
+
# source://zeitwerk//lib/zeitwerk/loader/helpers.rb#128
|
762
|
+
def cdef?(parent, cname); end
|
763
|
+
|
764
|
+
# @raise [NameError]
|
765
|
+
#
|
766
|
+
# source://zeitwerk//lib/zeitwerk/loader/helpers.rb#134
|
767
|
+
def cget(parent, cname); end
|
768
|
+
|
769
|
+
# Symbol#name was introduced in Ruby 3.0. It returns always the same
|
770
|
+
# frozen object, so we may save a few string allocations.
|
771
|
+
#
|
772
|
+
# source://zeitwerk//lib/zeitwerk/loader/helpers.rb#118
|
773
|
+
def cpath(parent, cname); end
|
774
|
+
|
775
|
+
# @raise [NameError]
|
776
|
+
#
|
777
|
+
# source://zeitwerk//lib/zeitwerk/loader/helpers.rb#140
|
778
|
+
def crem(parent, cname); end
|
779
|
+
|
780
|
+
# @return [Boolean]
|
781
|
+
#
|
782
|
+
# source://zeitwerk//lib/zeitwerk/loader/helpers.rb#67
|
783
|
+
def dir?(path); end
|
784
|
+
|
785
|
+
# @return [Boolean]
|
786
|
+
#
|
787
|
+
# source://zeitwerk//lib/zeitwerk/loader/helpers.rb#45
|
788
|
+
def has_at_least_one_ruby_file?(dir); end
|
789
|
+
|
790
|
+
# @return [Boolean]
|
791
|
+
#
|
792
|
+
# source://zeitwerk//lib/zeitwerk/loader/helpers.rb#72
|
793
|
+
def hidden?(basename); end
|
794
|
+
|
795
|
+
# source://zeitwerk//lib/zeitwerk/loader/helpers.rb#7
|
796
|
+
def log(message); end
|
797
|
+
|
798
|
+
# source://zeitwerk//lib/zeitwerk/loader/helpers.rb#15
|
799
|
+
def ls(dir); end
|
800
|
+
|
801
|
+
# @return [Boolean]
|
802
|
+
#
|
803
|
+
# source://zeitwerk//lib/zeitwerk/loader/helpers.rb#62
|
804
|
+
def ruby?(path); end
|
805
|
+
|
806
|
+
# source://zeitwerk//lib/zeitwerk/loader/helpers.rb#109
|
807
|
+
def strict_autoload_path(parent, cname); end
|
808
|
+
|
809
|
+
# source://zeitwerk//lib/zeitwerk/loader/helpers.rb#77
|
810
|
+
def walk_up(abspath); end
|
811
|
+
end
|
812
|
+
|
813
|
+
# source://zeitwerk//lib/zeitwerk/loader.rb#20
|
814
|
+
Zeitwerk::Loader::MUTEX = T.let(T.unsafe(nil), Thread::Mutex)
|
815
|
+
|
816
|
+
# source://zeitwerk//lib/zeitwerk/error.rb#13
|
817
|
+
class Zeitwerk::NameError < ::NameError; end
|
818
|
+
|
819
|
+
# source://zeitwerk//lib/zeitwerk/real_mod_name.rb#3
|
820
|
+
module Zeitwerk::RealModName
|
821
|
+
# source://zeitwerk//lib/zeitwerk/real_mod_name.rb#14
|
822
|
+
def real_mod_name(mod); end
|
823
|
+
end
|
824
|
+
|
825
|
+
# source://zeitwerk//lib/zeitwerk/real_mod_name.rb#4
|
826
|
+
Zeitwerk::RealModName::UNBOUND_METHOD_MODULE_NAME = T.let(T.unsafe(nil), UnboundMethod)
|
827
|
+
|
828
|
+
# source://zeitwerk//lib/zeitwerk/registry.rb#4
|
829
|
+
module Zeitwerk::Registry
|
830
|
+
class << self
|
831
|
+
# Maps absolute paths to the loaders responsible for them.
|
832
|
+
#
|
833
|
+
# This information is used by our decorated `Kernel#require` to be able to
|
834
|
+
# invoke callbacks and autovivify modules.
|
835
|
+
#
|
836
|
+
# @private
|
837
|
+
#
|
838
|
+
# source://zeitwerk//lib/zeitwerk/registry.rb#26
|
839
|
+
def autoloads; end
|
840
|
+
|
841
|
+
# Registers gem loaders to let `for_gem` be idempotent in case of reload.
|
842
|
+
#
|
843
|
+
# @private
|
844
|
+
#
|
845
|
+
# source://zeitwerk//lib/zeitwerk/registry.rb#17
|
846
|
+
def gem_loaders_by_root_file; end
|
847
|
+
|
848
|
+
# @private
|
849
|
+
# @return [Boolean]
|
850
|
+
#
|
851
|
+
# source://zeitwerk//lib/zeitwerk/registry.rb#113
|
852
|
+
def inception?(cpath); end
|
853
|
+
|
854
|
+
# This hash table addresses an edge case in which an autoload is ignored.
|
855
|
+
#
|
856
|
+
# For example, let's suppose we want to autoload in a gem like this:
|
857
|
+
#
|
858
|
+
# # lib/my_gem.rb
|
859
|
+
# loader = Zeitwerk::Loader.new
|
860
|
+
# loader.push_dir(__dir__)
|
861
|
+
# loader.setup
|
862
|
+
#
|
863
|
+
# module MyGem
|
864
|
+
# end
|
865
|
+
#
|
866
|
+
# if you require "my_gem", as Bundler would do, this happens while setting
|
867
|
+
# up autoloads:
|
868
|
+
#
|
869
|
+
# 1. Object.autoload?(:MyGem) returns `nil` because the autoload for
|
870
|
+
# the constant is issued by Zeitwerk while the same file is being
|
871
|
+
# required.
|
872
|
+
# 2. The constant `MyGem` is undefined while setup runs.
|
873
|
+
#
|
874
|
+
# Therefore, a directory `lib/my_gem` would autovivify a module according to
|
875
|
+
# the existing information. But that would be wrong.
|
876
|
+
#
|
877
|
+
# To overcome this fundamental limitation, we keep track of the constant
|
878
|
+
# paths that are in this situation ---in the example above, "MyGem"--- and
|
879
|
+
# take this collection into account for the autovivification logic.
|
880
|
+
#
|
881
|
+
# Note that you cannot generally address this by moving the setup code
|
882
|
+
# below the constant definition, because we want libraries to be able to
|
883
|
+
# use managed constants in the module body:
|
884
|
+
#
|
885
|
+
# module MyGem
|
886
|
+
# include MyConcern
|
887
|
+
# end
|
888
|
+
#
|
889
|
+
# @private
|
890
|
+
#
|
891
|
+
# source://zeitwerk//lib/zeitwerk/registry.rb#65
|
892
|
+
def inceptions; end
|
893
|
+
|
894
|
+
# @private
|
895
|
+
#
|
896
|
+
# source://zeitwerk//lib/zeitwerk/registry.rb#121
|
897
|
+
def loader_for(path); end
|
898
|
+
|
899
|
+
# This method returns always a loader, the same instance for the same root
|
900
|
+
# file. That is how Zeitwerk::Loader.for_gem is idempotent.
|
901
|
+
#
|
902
|
+
# @private
|
903
|
+
#
|
904
|
+
# source://zeitwerk//lib/zeitwerk/registry.rb#89
|
905
|
+
def loader_for_gem(root_file, warn_on_extra_files:); end
|
906
|
+
|
907
|
+
# Keeps track of all loaders. Useful to broadcast messages and to prevent
|
908
|
+
# them from being garbage collected.
|
909
|
+
#
|
910
|
+
# @private
|
911
|
+
#
|
912
|
+
# source://zeitwerk//lib/zeitwerk/registry.rb#11
|
913
|
+
def loaders; end
|
914
|
+
|
915
|
+
# @private
|
916
|
+
#
|
917
|
+
# source://zeitwerk//lib/zeitwerk/registry.rb#127
|
918
|
+
def on_unload(loader); end
|
919
|
+
|
920
|
+
# @private
|
921
|
+
#
|
922
|
+
# source://zeitwerk//lib/zeitwerk/registry.rb#95
|
923
|
+
def register_autoload(loader, abspath); end
|
924
|
+
|
925
|
+
# @private
|
926
|
+
#
|
927
|
+
# source://zeitwerk//lib/zeitwerk/registry.rb#107
|
928
|
+
def register_inception(cpath, abspath, loader); end
|
929
|
+
|
930
|
+
# Registers a loader.
|
931
|
+
#
|
932
|
+
# @private
|
933
|
+
#
|
934
|
+
# source://zeitwerk//lib/zeitwerk/registry.rb#71
|
935
|
+
def register_loader(loader); end
|
936
|
+
|
937
|
+
# @private
|
938
|
+
#
|
939
|
+
# source://zeitwerk//lib/zeitwerk/registry.rb#101
|
940
|
+
def unregister_autoload(abspath); end
|
941
|
+
|
942
|
+
# @private
|
943
|
+
#
|
944
|
+
# source://zeitwerk//lib/zeitwerk/registry.rb#77
|
945
|
+
def unregister_loader(loader); end
|
946
|
+
end
|
947
|
+
end
|
948
|
+
|
949
|
+
# source://zeitwerk//lib/zeitwerk/error.rb#7
|
950
|
+
class Zeitwerk::ReloadingDisabledError < ::Zeitwerk::Error
|
951
|
+
# @return [ReloadingDisabledError] a new instance of ReloadingDisabledError
|
952
|
+
#
|
953
|
+
# source://zeitwerk//lib/zeitwerk/error.rb#8
|
954
|
+
def initialize; end
|
955
|
+
end
|
956
|
+
|
957
|
+
# source://zeitwerk//lib/zeitwerk/error.rb#16
|
958
|
+
class Zeitwerk::SetupRequired < ::Zeitwerk::Error
|
959
|
+
# @return [SetupRequired] a new instance of SetupRequired
|
960
|
+
#
|
961
|
+
# source://zeitwerk//lib/zeitwerk/error.rb#17
|
962
|
+
def initialize; end
|
963
|
+
end
|
964
|
+
|
965
|
+
# source://zeitwerk//lib/zeitwerk/version.rb#4
|
966
|
+
Zeitwerk::VERSION = T.let(T.unsafe(nil), String)
|