Issue #8034 has been updated by luislavena (Luis Lavena).

Assignee changed from luislavena (Luis Lavena) to h.shirosaki (Hiroshi Shirosaki)

Following patch solves the issue:

https://gist.github.com/luislavena/5130078

However there is lot of duplication between wpath and wdir checks, which is crying for a refactoring.

Shirosaki-san, what do you think?
----------------------------------------
Bug #8034: File.expand_path('something', '~') do not include home path
https://bugs.ruby-lang.org/issues/8034#change-37474

Author: rap-kasta (Pavel Manylov)
Status: Assigned
Priority: Normal
Assignee: h.shirosaki (Hiroshi Shirosaki)
Category: platform/windows
Target version: 
ruby -v: 1.9.3p362


=begin
Next code works correctly only on ruby <= 1.9.3p362.
Tested on Windows XP, Windows 2008 with ruby 1.9.3p194 (works properly), ruby 1.9.3p362 (bug), ruby 2.0.0p0 (bug).

(({File.expand_path('something', '~') #=> "C:/path/to/current/dir/~/something"}))
                    
However, next code works as it should in all tested rubies:

(({File.expand_path '~' # => "C:/Documents and Settings/Jack"
Dir.home # => "C:/Documents and Settings/Jack"}))
=end



-- 
http://bugs.ruby-lang.org/