From 15d8e9ba55c8af29c467c5f52aed65a51c1a67f5 Mon Sep 17 00:00:00 2001 From: Makurin Date: Mon, 16 May 2022 17:50:45 +0300 Subject: [PATCH] Redmine 5.0 and zeitwerk compatibility --- init.rb | 2 +- lib/redmine_custom_css.rb | 2 ++ lib/{hooks.rb => redmine_custom_css/hook_listener.rb} | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 lib/redmine_custom_css.rb rename lib/{hooks.rb => redmine_custom_css/hook_listener.rb} (94%) diff --git a/init.rb b/init.rb index c016bee..0f533f2 100644 --- a/init.rb +++ b/init.rb @@ -18,7 +18,7 @@ # You should have received a copy of the GNU General Public License # along with redmine_custom_css. If not, see . # -require_dependency 'hooks' +require File.expand_path 'lib/redmine_custom_css/hook_listener', __dir__ Redmine::Plugin.register :redmine_custom_css do name 'Redmine Custom CSS plugin' diff --git a/lib/redmine_custom_css.rb b/lib/redmine_custom_css.rb new file mode 100644 index 0000000..3bacb6d --- /dev/null +++ b/lib/redmine_custom_css.rb @@ -0,0 +1,2 @@ +module RedmineCustomCss +end diff --git a/lib/hooks.rb b/lib/redmine_custom_css/hook_listener.rb similarity index 94% rename from lib/hooks.rb rename to lib/redmine_custom_css/hook_listener.rb index 1c25785..009def6 100644 --- a/lib/hooks.rb +++ b/lib/redmine_custom_css/hook_listener.rb @@ -19,7 +19,7 @@ # along with redmine_custom_css. If not, see . # module RedmineCustomCss - class RedmineCustomCssHookListener < Redmine::Hook::ViewListener + class HookListener < Redmine::Hook::ViewListener def view_layouts_base_html_head(context) css = Setting.plugin_redmine_custom_css['css'] "" unless css.nil? or css.empty?