summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2023-01-01 07:13:39 +0000
committerGo MAEDA <maeda@farend.jp>2023-01-01 07:13:39 +0000
commit1481c721a222ccf05a43ae98d1cf7730314a13d5 (patch)
tree7ffacec036458fd198e7cbf6f5ae72d7cc7eca3e /lib
parent92bd67c279516f339866e95c702b39cee325ef05 (diff)
downloadredmine-1481c721a222ccf05a43ae98d1cf7730314a13d5.tar.gz
redmine-1481c721a222ccf05a43ae98d1cf7730314a13d5.zip
Use `require_relative` instead of `require File.expand_path(..., __FILE__)` (#38093).
Patch by Go MAEDA. git-svn-id: https://svn.redmine.org/redmine/trunk@22016 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib')
-rw-r--r--lib/generators/redmine_plugin/templates/test_helper.rb.erb2
-rw-r--r--lib/generators/redmine_plugin_controller/templates/functional_test.rb.erb2
-rw-r--r--lib/generators/redmine_plugin_model/templates/unit_test.rb.erb2
-rw-r--r--lib/redmine/wiki_formatting.rb2
4 files changed, 4 insertions, 4 deletions
diff --git a/lib/generators/redmine_plugin/templates/test_helper.rb.erb b/lib/generators/redmine_plugin/templates/test_helper.rb.erb
index 54685d33c..55b016f6c 100644
--- a/lib/generators/redmine_plugin/templates/test_helper.rb.erb
+++ b/lib/generators/redmine_plugin/templates/test_helper.rb.erb
@@ -1,2 +1,2 @@
# Load the Redmine helper
-require File.expand_path(File.dirname(__FILE__) + '/../../../test/test_helper')
+require_relative '../../../test/test_helper'
diff --git a/lib/generators/redmine_plugin_controller/templates/functional_test.rb.erb b/lib/generators/redmine_plugin_controller/templates/functional_test.rb.erb
index 0499b6970..89cd961ae 100644
--- a/lib/generators/redmine_plugin_controller/templates/functional_test.rb.erb
+++ b/lib/generators/redmine_plugin_controller/templates/functional_test.rb.erb
@@ -1,4 +1,4 @@
-require File.expand_path('../../test_helper', __FILE__)
+require_relative '../test_helper'
class <%= @controller_class %>ControllerTest < ActionController::TestCase
# Replace this with your real tests.
diff --git a/lib/generators/redmine_plugin_model/templates/unit_test.rb.erb b/lib/generators/redmine_plugin_model/templates/unit_test.rb.erb
index ad15149fa..304516a35 100644
--- a/lib/generators/redmine_plugin_model/templates/unit_test.rb.erb
+++ b/lib/generators/redmine_plugin_model/templates/unit_test.rb.erb
@@ -1,4 +1,4 @@
-require File.expand_path('../../test_helper', __FILE__)
+require_relative '../test_helper'
class <%= @model_class %>Test < ActiveSupport::TestCase
diff --git a/lib/redmine/wiki_formatting.rb b/lib/redmine/wiki_formatting.rb
index f27327a4a..28b1ea130 100644
--- a/lib/redmine/wiki_formatting.rb
+++ b/lib/redmine/wiki_formatting.rb
@@ -17,7 +17,7 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-require File.expand_path('../wiki_formatting/textile/redcloth3', __FILE__)
+require_relative 'wiki_formatting/textile/redcloth3'
require 'digest/md5'
module Redmine