Sha256: b7dbb79db837deb39063fb889e4f8c0e64c40e6dc5e9d7fd84006879a29de6d5

Contents?: true

Size: 1 KB

Versions: 90

Compression:

Stored size: 1 KB

Contents

# frozen_string_literal: true

module ActiveSupport::Dependencies::RequireDependency
  # <b>Warning:</b> This method is obsolete. The semantics of the autoloader
  # match Ruby's and you do not need to be defensive with load order anymore.
  # Just refer to classes and modules normally.
  #
  # Engines that do not control the mode in which their parent application runs
  # should call +require_dependency+ where needed in case the runtime mode is
  # +:classic+.
  def require_dependency(filename)
    filename = filename.to_path if filename.respond_to?(:to_path)

    unless filename.is_a?(String)
      raise ArgumentError, "the file name must be either a String or implement #to_path -- you passed #{filename.inspect}"
    end

    if abspath = ActiveSupport::Dependencies.search_for_file(filename)
      require abspath
    else
      require filename
    end
  end

  # We could define require_dependency in Object directly, but a module makes
  # the extension apparent if you list ancestors.
  Object.prepend(self)
end

Version data entries

90 entries across 86 versions & 12 rubygems

Version Path
omg-activesupport-8.0.0.alpha7 lib/active_support/dependencies/require_dependency.rb
omg-activesupport-8.0.0.alpha4 lib/active_support/dependencies/require_dependency.rb
omg-activesupport-8.0.0.alpha3 lib/active_support/dependencies/require_dependency.rb
omg-activesupport-8.0.0.alpha2 lib/active_support/dependencies/require_dependency.rb
omg-activesupport-8.0.0.alpha1 lib/active_support/dependencies/require_dependency.rb
activesupport-7.1.4 lib/active_support/dependencies/require_dependency.rb
activesupport-7.2.1 lib/active_support/dependencies/require_dependency.rb
activesupport-7.2.0 lib/active_support/dependencies/require_dependency.rb
activesupport-7.2.0.rc1 lib/active_support/dependencies/require_dependency.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/activesupport-7.1.3.4/lib/active_support/dependencies/require_dependency.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/activesupport-7.0.8.4/lib/active_support/dependencies/require_dependency.rb
activesupport-7.2.0.beta3 lib/active_support/dependencies/require_dependency.rb
cm-admin-1.5.22 vendor/bundle/ruby/3.3.0/gems/activesupport-7.0.5.1/lib/active_support/dependencies/require_dependency.rb
cm-admin-1.5.21 vendor/bundle/ruby/3.3.0/gems/activesupport-7.0.5.1/lib/active_support/dependencies/require_dependency.rb
cm-admin-1.5.20 vendor/bundle/ruby/3.3.0/gems/activesupport-7.0.5.1/lib/active_support/dependencies/require_dependency.rb
katalyst-govuk-formbuilder-1.9.2 vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.3.4/lib/active_support/dependencies/require_dependency.rb
tinymce-rails-7.1.2 vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.3.4/lib/active_support/dependencies/require_dependency.rb
activesupport-7.2.0.beta2 lib/active_support/dependencies/require_dependency.rb
activesupport-7.1.3.4 lib/active_support/dependencies/require_dependency.rb
activesupport-7.0.8.4 lib/active_support/dependencies/require_dependency.rb