Actions
Patch #38093
closedUse require_relative instead of generating the full path for a file
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
Updated by Go MAEDA almost 2 years ago
- Target version set to 5.1.0
Setting the target version to 5.1.0.
Updated by Go MAEDA almost 2 years ago
- Status changed from New to Closed
- Assignee set to Go MAEDA
Committed the patch.
Updated by Go MAEDA almost 2 years ago
- Subject changed from Use `require_relative` instead of `require File.expand_path(..., __FILE__)` to Use require_relative instead of generating the full path for a file
Actions