Actions
Bug #14779
closedWindows - Casing issues - __FILE__, __dir__
Status:
Rejected
Assignee:
-
Target version:
-
ruby -v:
ruby 2.6.0dev (2018-05-21 trunk 63473) [x64-mingw32]
Description
For an unknown time, an informational Appveyor repo I have (here) has shown default gems inconsistently. While doing some work in RubyGems, I came across the issue again. The issue went back to RbConfig, and the TOPDIR constant.
I added the following lines to RbConfig.rb
puts "__dir__ #{__dir__}"
puts "File.dirname(__FILE__) #{File.dirname(__FILE__)}"
puts "Dir.pwd #{Dir.pwd}"
Testing with 2.4.4, 2.5.1, and trunk (ruby 2.6.0dev (2018-05-21 trunk 63473) [x64-mingw32]
), in all instances, Dir.pwd
returned the correct casing, but __dir__
and File.dirname(__FILE__)
did not.
Below is console from the three versions:
C:\Greg\ruby24-x64>ruby -e "puts RUBY_DESCRIPTION"
__dir__ C:/Greg/ruby26-x64/lib/ruby/2.6.0/x64-mingw32
File.dirname(__FILE__) C:/Greg/ruby26-x64/lib/ruby/2.6.0/x64-mingw32
Dir.pwd C:/Greg/ruby24-x64
ruby 2.6.0dev (2018-05-18 trunk 63464) [x64-mingw32]
C:\Greg\ruby25-x64>ruby -e "puts RUBY_DESCRIPTION"
__dir__ C:/Greg/Ruby25-x64/lib/ruby/2.5.0/x64-mingw32
File.dirname(__FILE__) C:/Greg/Ruby25-x64/lib/ruby/2.5.0/x64-mingw32
Dir.pwd C:/Greg/ruby25-x64
ruby 2.5.1p57 (2018-03-29 revision 63029) [x64-mingw32]
C:\Greg\ruby26-x64>ruby -e "puts RUBY_DESCRIPTION"
__dir__ C:/Greg/ruby26-x64/lib/ruby/2.6.0/x64-mingw32
File.dirname(__FILE__) C:/Greg/ruby26-x64/lib/ruby/2.6.0/x64-mingw32
Dir.pwd C:/Greg/ruby26-x64
ruby 2.6.0dev (2018-05-21 trunk 63473) [x64-mingw32]
From the above, I thought the issue was just with 2.5.1, but I then renamed the trunk folder, and had the following:
C:\Greg\ruby26-x64>cd ..
C:\Greg>ren ruby26-x64 Ruby26-x64
C:\Greg>cd Ruby26-x64
C:\Greg\Ruby26-x64>ruby -e "puts RUBY_DESCRIPTION"
__dir__ C:/Greg/ruby26-x64/lib/ruby/2.6.0/x64-mingw32
File.dirname(__FILE__) C:/Greg/ruby26-x64/lib/ruby/2.6.0/x64-mingw32
Dir.pwd C:/Greg/Ruby26-x64
ruby 2.6.0dev (2018-05-21 trunk 63473) [x64-mingw32]
So, the issue seems to also affect trunk.
Thanks, Greg
Actions
Like0
Like0Like0Like0Like0Like0Like0Like0Like0