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:
parent
fae0f2486d
commit
645acf5771
7 changed files with 11 additions and 11 deletions
|
@ -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 ----
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue