diff --git a/lib/health_monitor.rb b/lib/health_monitor.rb index 1cf29e8..e616965 100644 --- a/lib/health_monitor.rb +++ b/lib/health_monitor.rb @@ -1,11 +1,15 @@ # frozen_string_literal: true +# require external dependencies require 'zeitwerk' -loader = Zeitwerk::Loader.for_gem -loader.setup + +# load zeitwerk +Zeitwerk::Loader.for_gem.tap do |loader| # rubocop:disable Style/SymbolProc + loader.setup +end module HealthMonitor - require 'health_monitor/engine' if defined?(Rails) + require_relative 'health_monitor/engine' if defined?(Rails) STATUSES = { ok: 'OK', diff --git a/lib/health_monitor/configuration.rb b/lib/health_monitor/configuration.rb index d994807..45b12aa 100644 --- a/lib/health_monitor/configuration.rb +++ b/lib/health_monitor/configuration.rb @@ -22,7 +22,7 @@ def no_database class_eval <<-METHOD, __FILE__, __LINE__ + 1 # frozen_string_literal: true def #{provider_name} # def database - require "health_monitor/providers/#{provider_name}" # require "health_monitor/providers/database" + require_relative "providers/#{provider_name}" # require_relative "providers/database" add_provider("HealthMonitor::Providers::#{klass}".constantize) # add_provider("HealthMonitor::Providers::Database".constantize) end # end METHOD