Sha256: 0b4b996f0fc96a68a49b559f5ffc5c4317acba65310c04362d25d20c70b83c40

Contents?: true

Size: 753 Bytes

Versions: 1

Compression:

Stored size: 753 Bytes

Contents

require "zeitwerk"

module Dynomite
  class Autoloader
    class Inflector < Zeitwerk::Inflector
      def camelize(basename, _abspath)
        map = { cli: "CLI", version: "VERSION" }
        map[basename.to_sym] || super
      end
    end

    class << self
      def setup
        loader = Zeitwerk::Loader.new
        loader.inflector = Inflector.new
        lib = File.dirname(__dir__)
        loader.push_dir(lib)
        loader.ignore("#{lib}/jets/commands")
        loader.ignore("#{lib}/dynomite/migration/internal/*")
        loader.ignore("#{lib}/dynomite/migration/templates/*")
        loader.ignore("#{lib}/dynomite/reserved_words.rb")
        loader.do_not_eager_load("#{lib}/generators")
        loader.setup
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
dynomite-2.0.2 lib/dynomite/autoloader.rb