From 3bf2f3bf75ea65718c2ca3bd2e674724bbd1f32f Mon Sep 17 00:00:00 2001 From: Nicolas Rodriguez Date: Mon, 30 Sep 2024 02:17:28 +0200 Subject: [PATCH] Coding style --- lib/health_monitor.rb | 10 +++++++--- lib/health_monitor/configuration.rb | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) 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