Project

General

Profile

Actions

Patch #38093

closed

Use require_relative instead of generating the full path for a file

Added by Go MAEDA over 1 year ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Code cleanup/refactoring
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:

Description

In the code of Redmine, you can find many require methods that builds the absolute path of a file using File.expand_path and __FILE__:

require File.expand_path('../../test_helper', __FILE__)

I think using `require_relative` can make those simpler and more readable, as shown below.

require_relative '../test_helper'

Files

require_relative.patch (201 KB) require_relative.patch Go MAEDA, 2022-12-23 06:53
Actions

Also available in: Atom PDF