module Anyway::Rails

Attributes

disable_postponed_load_warning[RW]
name_method[R]
tracer[R]

Private Class Methods

tracepoint_class_callback(event) click to toggle source
# File lib/anyway/rails/autoload.rb, line 15
def tracepoint_class_callback(event)
  # Ignore singletons
  return if event.self.singleton_class?

  # We wait till `rails/application/configuration.rb` has been loaded, since we rely on it
  # See https://github.com/palkan/anyway_config/issues/134
  return unless name_method.bind_call(event.self) == "Rails::Application::Configuration"

  tracer.disable

  unless disable_postponed_load_warning
    warn "Anyway Config was loaded before Rails. Activating Anyway Config Rails plugins now.\n" \
          "NOTE: Already loaded configs were provisioned without Rails-specific sources."
  end

  require "anyway/rails"
end