From: shyouhei@... Date: 2018-05-21T03:35:17+00:00 Subject: [ruby-core:87206] [Ruby trunk Bug#14779] Windows - Casing issues - __FILE__, __dir__ Issue #14779 has been updated by shyouhei (Shyouhei Urabe). MSP-Greg (Greg L) wrote: > Please review my message. This has nothing to do with PATH. I noticed it when in RubyGems, `Gem::BasicSpecification#default_gem?` wasn't correct. ?? I don't get it. You claim __FILE__ and Dir.getwd are inconsistent, no? The reason for the inconsistency was described by @usa. ---------------------------------------- Bug #14779: Windows - Casing issues - __FILE__, __dir__ https://bugs.ruby-lang.org/issues/14779#change-72196 * Author: MSP-Greg (Greg L) * Status: Rejected * Priority: Normal * Assignee: * Target version: * ruby -v: ruby 2.6.0dev (2018-05-21 trunk 63473) [x64-mingw32] * Backport: 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN ---------------------------------------- For an unknown time, an informational Appveyor repo I have ([here](https://ci.appveyor.com/project/MSP-Greg/appveyor-ruby)) 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 -- https://bugs.ruby-lang.org/ Unsubscribe: