From 775f5751a6a5807fc28a5647eebc98d100cff327 Mon Sep 17 00:00:00 2001 From: Joachim Mathes Date: Fri, 17 Nov 2023 18:02:49 +0100 Subject: [PATCH] Make plugin Redmine 5 compatible --- Gemfile | 2 +- lib/redmine_oidc.rb | 16 ++++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/Gemfile b/Gemfile index 06aeb43..0c07ef7 100644 --- a/Gemfile +++ b/Gemfile @@ -1,3 +1,3 @@ gem 'openid_connect', '~> 2.2' -gem 'redis', '~> 4.2' +gem 'redis', '~> 5.0' gem 'hiredis', '~> 0.6.3' diff --git a/lib/redmine_oidc.rb b/lib/redmine_oidc.rb index 7da5f1f..0e2a9aa 100644 --- a/lib/redmine_oidc.rb +++ b/lib/redmine_oidc.rb @@ -15,12 +15,16 @@ # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -Rails.configuration.to_prepare do - require_dependency 'redmine_oidc/account_controller_patch' - require_dependency 'redmine_oidc/application_controller_patch' - require_dependency 'redmine_oidc/avatars_helper_patch' - require_dependency 'redmine_oidc/hooks' -end +REDMINE_OIDC_REQUIRED_FILES = [ + 'redmine_oidc/account_controller_patch', + 'redmine_oidc/application_controller_patch', + 'redmine_oidc/avatars_helper_patch', + 'redmine_oidc/hooks' +] + +base_url = File.dirname(__FILE__) +REDMINE_OIDC_REQUIRED_FILES.each { |file| require(base_url + '/' + file) } + module RedmineOidc def self.settings