Sha256: d22db75bf5bea2361c71a93365d9720514a30d2d191cacc90c1698803c627b68

Contents?: true

Size: 690 Bytes

Versions: 2

Compression:

Stored size: 690 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
        loader.push_dir(File.dirname(__dir__)) # lib
        loader.ignore("#{File.dirname(__dir__)}/jets/commands")
        loader.ignore("#{__dir__}/migration/internal/*")
        loader.ignore("#{__dir__}/migration/templates/*")
        loader.ignore("#{__dir__}/reserved_words.rb")
        loader.setup
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
dynomite-2.0.1 lib/dynomite/autoloader.rb
dynomite-2.0.0 lib/dynomite/autoloader.rb