Skip to content

Commit

Permalink
Merge pull request #10 from sul-dlss/zeitwerk-inflector-eager-load-fix
Browse files Browse the repository at this point in the history
Fix zeitwerk eager-loading
  • Loading branch information
jcoyne authored May 7, 2024
2 parents 24b2fe7 + 47c3cd0 commit fe7ee15
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions lib/ocfl.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# frozen_string_literal: true

require_relative "ocfl/version"
require "zeitwerk"
require "json"
require "dry/monads"
Expand All @@ -9,17 +8,8 @@
require "active_support"
require "active_support/core_ext/module/delegation"

# Custom zeitwerk inflector for OCFL
class OCFLInflector < Zeitwerk::Inflector
def camelize(basename, _abspath)
return "OCFL" if basename == "ocfl"

super
end
end

loader = Zeitwerk::Loader.for_gem
loader.inflector = OCFLInflector.new
loader.inflector.inflect("ocfl" => "OCFL")
loader.setup

module OCFL
Expand Down

0 comments on commit fe7ee15

Please sign in to comment.