[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

autotest broken on winxp?

Jeff

12/9/2006 1:15:00 AM

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
files/ruby/lib/ruby/gems/1.8/gems/ZenTest-3.4.2/lib/autotest.rb:294
from c:/program
files/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`require'
from c:/program
files/ruby/lib/ruby/gems/1.8/gems/ZenTest-3.4.2/lib/rails_autotest.rb:1
from c:/program
files/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`require'
from c:/program
files/ruby/lib/ruby/gems/1.8/gems/ZenTest-3.4.2/bin/autotest:44
from c:/Program Files/ruby/bin/autotest:18

I think I remember having to hand-fix some code originally, but again
it was a long time ago (maybe 6 months ago).

I also tried "autotest -rails" at the top folder of one of my rails
projects, but I got the same error.

Any idea what I'm doing wrong? Or is this a known issue with autotest
perhaps?

I have zentest 3.4.2 (did a gem update zentest to make sure), and I'm
on WinXP SP2.

Thanks!
Jeff


5 Answers

Eric Hodel

12/9/2006 1:21:00 AM

0

On Dec 8, 2006, at 17:14 , 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)

Well, windows doesn't expand ~.

> I think I remember having to hand-fix some code originally, but again
> it was a long time ago (maybe 6 months ago).
>
> I also tried "autotest -rails" at the top folder of one of my rails
> projects, but I got the same error.
>
> Any idea what I'm doing wrong?

You haven't filed a bug so we can track and fix it.

--
Eric Hodel - drbrain@segment7.net - http://blog.se...

I LIT YOUR GEM ON FIRE!


Jeff

12/9/2006 2:33:00 PM

0


Eric Hodel wrote:
> You haven't filed a bug so we can track and fix it.

I know, I just thought I'd ask the community if there's something I
should investigate first, before I bother you with a ticket... I'll go
ahead and file a bug for it.

Thanks!
Jeff


David Vallner

12/9/2006 4:57:00 PM

0

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.

David Vallner

Daniel Berger

12/9/2006 5:32:00 PM

0

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...., 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

David Vallner

12/10/2006 3:26:00 PM

0

Daniel Berger wrote:
> 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...., among
> others.
>

Erght, I forgot about %USERPROFILE%. Well, that leaves the whole thing
rather fuzzy. So, bug in autotest for relying on File.expand_path with a
tilde, or Ruby for letting people rely on it? Or the usual, let's blame
Microsoft *ducks*.

David Vallner