From 9c8b41f6893d4a92bb30923684bad7a1b40fdb62 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Tue, 29 Aug 2023 11:49:56 +0200 Subject: [PATCH] Redmine 5 compatibility Redmine 5 uses Zeitwerk, which can't find the require if it's not relative or uses a wrong path. Fixes: #88 --- init.rb | 4 ++-- lib/{patches => redmine_lightbox2}/attachments_patch.rb | 0 .../hooks/view_layouts_base_html_head_hook.rb | 0 3 files changed, 2 insertions(+), 2 deletions(-) rename lib/{patches => redmine_lightbox2}/attachments_patch.rb (100%) rename lib/{ => redmine_lightbox2}/hooks/view_layouts_base_html_head_hook.rb (100%) diff --git a/init.rb b/init.rb index c7cd68c..c314329 100644 --- a/init.rb +++ b/init.rb @@ -1,7 +1,7 @@ require 'redmine' -require_dependency 'patches/attachments_patch' -require_dependency 'hooks/view_layouts_base_html_head_hook' +require_relative 'lib/redmine_lightbox2/attachments_patch' +require_relative 'lib/redmine_lightbox2/hooks/view_layouts_base_html_head_hook' Redmine::Plugin.register :redmine_lightbox2 do name 'Redmine Lightbox 2' diff --git a/lib/patches/attachments_patch.rb b/lib/redmine_lightbox2/attachments_patch.rb similarity index 100% rename from lib/patches/attachments_patch.rb rename to lib/redmine_lightbox2/attachments_patch.rb diff --git a/lib/hooks/view_layouts_base_html_head_hook.rb b/lib/redmine_lightbox2/hooks/view_layouts_base_html_head_hook.rb similarity index 100% rename from lib/hooks/view_layouts_base_html_head_hook.rb rename to lib/redmine_lightbox2/hooks/view_layouts_base_html_head_hook.rb