Sha256: 0212fa9dd0ae3d56b134ae685948ffbd3010c745f07ba085e7a15424794a7ce7
Contents?: true
Size: 1.04 KB
Versions: 79
Compression:
Stored size: 1.04 KB
Contents
# frozen_string_literal: true require "active_support/dependencies/zeitwerk_integration" module Rails module Autoloaders # :nodoc: class << self include Enumerable def main if zeitwerk_enabled? @main ||= Zeitwerk::Loader.new.tap do |loader| loader.tag = "rails.main" loader.inflector = ActiveSupport::Dependencies::ZeitwerkIntegration::Inflector end end end def once if zeitwerk_enabled? @once ||= Zeitwerk::Loader.new.tap do |loader| loader.tag = "rails.once" loader.inflector = ActiveSupport::Dependencies::ZeitwerkIntegration::Inflector end end end def each if zeitwerk_enabled? yield main yield once end end def logger=(logger) each { |loader| loader.logger = logger } end def log! each(&:log!) end def zeitwerk_enabled? Rails.configuration.autoloader == :zeitwerk end end end end
Version data entries
79 entries across 77 versions & 8 rubygems