Issue #14779 has been reported by MSP-Greg (Greg L).

----------------------------------------
Bug #14779: Windows - Casing issues - __FILE
https://bugs.ruby-lang.org/issues/14779

* Author: MSP-Greg (Greg L)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: trunk, 2.5.1, maybe 2.4.4
* 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: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>