From: Daniel Berger Date: 2006-12-10T02:31:40+09:00 Subject: Re: autotest broken on winxp? David Vallner wrote: > Jeff wrote: >> I haven't tried autotest on windows for a long time, but I thought it >> worked back then. Now, I get this error: >> >> C:\dev\row>autotest >> c:/program >> files/ruby/lib/ruby/gems/1.8/gems/ZenTest-3.4.2/lib/autotest.rb:294:in >> `expand_path': couldn't find HOME environment -- expanding >> `~/.autotest' (ArgumentError) >> from c:/program > > Do you have the HOME environment variable set? > > From ri File.expand_path: > > The given pathname may start with a ``+~+'', which expands to the > process owner's home directory (the environment variable +HOME+ must be > set correctly). ``+~+_user_'' expands to the named user's home directory. > > This is arguably a bug in File.expand_path rather than ZenTest. (On > Windows systems, a fallback to ENV['HOME'] should be ENV['HOMEDRIVE'] + > ENV['HOMEPATH']. Wonder where you report those. This has been discussed before. See http://tinyurl.com/y52hs3, among others. The fundamental issue is that "~" is a shell thing, not an OS thing. To me, the bug is that File.expand_path accepts '~' at all. But, things are what they are. Come to think of it, I could add support for this in win32-file. :) In practice I never use '~'. I mostly use ENV['HOME'] || ENV['USERPROFILE']. Regards, Dan