1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[ruby/racc] Prefer __dir__ over File.dirname(__FILE__)

https://github.com/ruby/racc/commit/c49df40658
This commit is contained in:
Olle Jonsson 2021-09-14 14:38:11 +02:00 committed by git
parent fae0f2486d
commit 645acf5771
7 changed files with 11 additions and 11 deletions

View file

@ -563,9 +563,9 @@ end # class Parser
require 'strscan'
require 'rubygems'
require 'cim'
require File.join(File.dirname(__FILE__), 'result')
require File.join(File.dirname(__FILE__), 'scanner')
require File.join(File.dirname(__FILE__), 'case')
require File.join(__dir__, 'result')
require File.join(__dir__, 'scanner')
require File.join(__dir__, 'case')
---- inner ----

View file

@ -10,7 +10,7 @@ require 'timeout'
module Racc
class TestCase < Test::Unit::TestCase
PROJECT_DIR = File.expand_path(File.join(File.dirname(__FILE__), '..'))
PROJECT_DIR = File.expand_path(File.join(__dir__, '..'))
test_dir = File.join(PROJECT_DIR, 'test')
test_dir = File.join(PROJECT_DIR, 'racc') unless File.exist?(test_dir)

View file

@ -12,9 +12,9 @@ require 'racc/parser.rb'
require 'strscan'
require 'rubygems'
require 'cim'
require File.join(File.dirname(__FILE__), 'result')
require File.join(File.dirname(__FILE__), 'scanner')
require File.join(File.dirname(__FILE__), 'case')
require File.join(__dir__, 'result')
require File.join(__dir__, 'scanner')
require File.join(__dir__, 'case')
module MOF
class Parser < Racc::Parser

View file

@ -1,4 +1,4 @@
require File.expand_path(File.join(File.dirname(__FILE__), 'case'))
require File.expand_path(File.join(__dir__, 'case'))
module Racc
class TestChkY < TestCase

View file

@ -1,4 +1,4 @@
require File.expand_path(File.join(File.dirname(__FILE__), 'case'))
require File.expand_path(File.join(__dir__, 'case'))
module Racc
class TestGrammarFileParser < TestCase

View file

@ -1,4 +1,4 @@
require File.expand_path(File.join(File.dirname(__FILE__), 'case'))
require File.expand_path(File.join(__dir__, 'case'))
module Racc
class TestRaccCommand < TestCase

View file

@ -1,4 +1,4 @@
require File.expand_path(File.join(File.dirname(__FILE__), 'case'))
require File.expand_path(File.join(__dir__, 'case'))
module Racc
class TestScanY < TestCase