Sha256: f473831802031bc64aa6a6b054050742d2ad106b02d7b4aa7e41e8a228c9c17a

Contents?: true

Size: 999 Bytes

Versions: 1

Compression:

Stored size: 999 Bytes

Contents

# frozen_string_literal: true

require "zeitwerk"

require "dry/core/extensions"
require "dry/core/constants"
require "dry/monitor/version"

module Dry
  module Monitor
    extend Dry::Core::Extensions
    include Dry::Core::Constants

    register_extension(:rack) do
      require "rack/utils"
      require "dry/monitor/rack/logger"
    end

    register_extension(:sql) do
      require "dry/monitor/sql/logger"
    end

    def self.loader
      @loader ||= Zeitwerk::Loader.new.tap do |loader|
        root = File.expand_path("..", __dir__)
        loader.tag = "dry-monitor"
        loader.inflector = Zeitwerk::GemInflector.new("#{root}/dry-monitor.rb")
        loader.push_dir(root)
        loader.ignore(
          "#{root}/dry-monitor.rb",
          "#{root}/dry/monitor/version.rb",
          "#{root}/dry/monitor/rack/**/*.rb",
          "#{root}/dry/monitor/sql/**/*.rb",
        )
        loader.inflector.inflect "sql" => "SQL"
      end
    end
  end
end

Dry::Monitor.loader.setup

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
dry-monitor-0.6.3 lib/dry/monitor.rb