Bug #3629: expand_path doesn't expand "~a"
http://redmine.ruby-lang.org/issues/show/3629

Author: Tomas Matousek
Status: Open, Priority: Normal
ruby -v: ruby 1.9.1p378 (2010-01-10 revision 26273) [i386-mingw32]

ENV["HOME"] = 'C:/xxx'
Dir.chdir 'C:/temp' do
  p File.expand_path("a")
  p File.expand_path("~/a")
  p File.expand_path("~a")
end

Prints:

"C:/temp/a"
"C:/xxx/a"
"~a"

I'd expect it to print:
"C:/temp/a"
"C:/xxx/a"
"c:/temp/~a"

"~a" should be considered a regular file name and as such should be prefixed with the current directory path like any other file name.


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