Sha256: 9b5d63dd940a5d4e19cfa489533773f9082133cf4d5701e29ab600d85e0035b9

Contents?: true

Size: 455 Bytes

Versions: 3

Compression:

Stored size: 455 Bytes

Contents

require "zeitwerk"

module Forger
  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.setup
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
forger-3.0.2 lib/forger/autoloader.rb
forger-3.0.1 lib/forger/autoloader.rb
forger-3.0.0 lib/forger/autoloader.rb