From d7d9edb22484131ed1d37ea1a34dbb992f8168c7 Mon Sep 17 00:00:00 2001 From: yzzy Date: Fri, 1 Apr 2022 16:14:05 +0500 Subject: [PATCH] Zeitwerk-style plugin loading --- init.rb | 2 +- lib/redmine_webhook.rb | 6 +++--- lib/redmine_webhook/author_wrapper.rb | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/init.rb b/init.rb index 22550ab..8dea838 100644 --- a/init.rb +++ b/init.rb @@ -1,4 +1,4 @@ -require 'redmine_webhook' +require_dependency File.dirname(__FILE__) + '/lib/redmine_webhook' Redmine::Plugin.register :redmine_webhook do name 'Redmine Webhook plugin' diff --git a/lib/redmine_webhook.rb b/lib/redmine_webhook.rb index c2e7b50..ca81b3d 100644 --- a/lib/redmine_webhook.rb +++ b/lib/redmine_webhook.rb @@ -1,6 +1,6 @@ -require 'redmine_webhook/projects_helper_patch' -require 'redmine_webhook/issue_wrapper' -require 'redmine_webhook/webhook_listener' +require File.dirname(__FILE__) + '/redmine_webhook/projects_helper_patch' +require File.dirname(__FILE__) + '/redmine_webhook/issue_wrapper' +require File.dirname(__FILE__) + '/redmine_webhook/webhook_listener' module RedmineWebhook end diff --git a/lib/redmine_webhook/author_wrapper.rb b/lib/redmine_webhook/author_wrapper.rb index 33a0869..418ee76 100644 --- a/lib/redmine_webhook/author_wrapper.rb +++ b/lib/redmine_webhook/author_wrapper.rb @@ -15,7 +15,7 @@ module RedmineWebhook :mail => @author.mail, :firstname => @author.firstname, :lastname => @author.lastname, - :identity_url => @author.identity_url, + :identity_url => @author.try(:identity_url), :icon_url => icon_url } end