Sha256: b4da606042ede9168d17c524ac337682e62bfc3e11a57f6a40ae4215a63da3fd

Contents?: true

Size: 523 Bytes

Versions: 1

Compression:

Stored size: 523 Bytes

Contents

require "zeitwerk"

module Cody
  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__) # lib
        loader.push_dir(lib)
        loader.do_not_eager_load("#{lib}/template")
        loader.setup
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cody-1.2.1 lib/cody/autoloader.rb