Ruby

Ruby

Made by DeepSource

Use __dir__ to get an absolute path to the current file's directory RB-ST1030

Style
Major
Autofix

#__dir__ method can replace more complex constructs to retrieve a canonicalized absolute path to the current file.

Bad practice

path = File.expand_path(File.dirname(__FILE__))

path = File.dirname(File.realpath(__FILE__))

Recommended

path = __dir__