Skip to content

Commit

Permalink
Revert using zeitwerk
Browse files Browse the repository at this point in the history
Currently jruby does not support zeitwerk when loading a singleton (such as LocationMap)
See jruby/jruby#6781
  • Loading branch information
jcoyne committed Jun 26, 2023
1 parent 7b9e9a3 commit bc642e6
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 9 deletions.
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ gem 'ruby-kafka'
gem 'stanford-mods', '~> 3.0'
gem 'statsd-ruby'
gem 'whenever'
gem 'zeitwerk'

group :deployment do
gem 'capistrano', '~> 3.0'
Expand Down
1 change: 0 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,6 @@ DEPENDENCIES
traject_plus
webmock
whenever
zeitwerk

BUNDLED WITH
2.3.20
43 changes: 36 additions & 7 deletions config/boot.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,39 @@

Config.load_and_set_settings(Config.setting_files(__dir__, ENV.fetch('TRAJECT_ENV', nil)))

loader = Zeitwerk::Loader.new
loader.inflector.inflect(
'lc' => 'LC'
)
loader.collapse("#{__dir__}/../lib/traject/*")
loader.push_dir("#{__dir__}/../lib")
loader.setup
# jRuby 9.4.1.0 does not yet support zeitwerk
# See: https://github.com/jruby/jruby/issues/6781
# loader = Zeitwerk::Loader.new
# loader.inflector.inflect(
# 'lc' => 'LC'
# )
# loader.collapse("#{__dir__}/../lib/traject/*")
# loader.push_dir("#{__dir__}/../lib")
# loader.setup

$LOAD_PATH.unshift("#{__dir__}/../lib")
require 'call_numbers/call_number_base'
require 'call_numbers/shelfkey_base'
require 'call_numbers/shelfkey'
require 'call_numbers/other'
require 'call_numbers/lc'
require 'call_numbers/dewey'
require 'call_numbers/dewey_shelfkey'

require 'constants'
require 'folio_client'
require 'folio_record'
require 'folio/eresource_holdings_builder'
require 'folio/mhld_builder'
require 'locations_map'
require 'marc_links'
require 'mhld_field'
require 'public_xml_record'
require 'sirsi_holding'
require 'utils'
require 'traject/readers/druid_reader'
require 'traject/readers/kafka_purl_fetcher_reader'
require 'traject/readers/kafka_marc_reader'
require 'traject/readers/marc_combining_reader'
require 'traject/writers/solr_better_json_writer'
require 'traject/common/marc_utils'

0 comments on commit bc642e6

Please sign in to comment.