redmica / redmica_ui_extension

This plugin adds useful UI improvements to RedMica.
GNU General Public License v2.0
42 stars 12 forks source link

Use `require_relative` to avoid building an absolute path for `require` #42

Closed vividtone closed 1 year ago

vividtone commented 1 year ago

This change removes File.expand_path and __FILE__ from the parameter of require.

The following is an example.

diff --git a/init.rb b/init.rb
index 942a97a..acf43d1 100644
--- a/init.rb
+++ b/init.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true

-require File.expand_path('../init_redmica_ui_extension', __FILE__)
+require_relative 'init_redmica_ui_extension'

 Redmine::Plugin.register :redmica_ui_extension do
   requires_redmine version_or_higher: '4.1'