Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Rake goes into infinite loop on Windows

Reply
Thread Tools

Rake goes into infinite loop on Windows

 
 
Daniel Berger
Guest
Posts: n/a
 
      05-01-2005
Hi all,

Windows XP
Ruby 1.8.2
Rake 0.5.4

When I tried this simple rakefile it went into an infinite loop (and
leaks like a sieve). Experiments show that it seems to be happening in
the directory task.

Am I doing something wrong?

# rakefile
require "rbconfig"
require "rake/testtask"
include Config

destdir = CONFIG["sitelibdir"] + "/html"
directory destdir # Inifinite loop here

desc "Install html-table"
task :install do |t|
FileUtils["lib/html/*.rb"].each{ |file|
cp(file, destdir)
}
end

Regards,

Dan

 
Reply With Quote
 
 
 
 
Lionel Thiry
Guest
Posts: n/a
 
      05-01-2005
Daniel Berger a écrit :
> Hi all,
>
> Windows XP
> Ruby 1.8.2
> Rake 0.5.4
>
> When I tried this simple rakefile it went into an infinite loop (and
> leaks like a sieve). Experiments show that it seems to be happening in
> the directory task.
>
> Am I doing something wrong?
>
> # rakefile
> require "rbconfig"
> require "rake/testtask"
> include Config
>
> destdir = CONFIG["sitelibdir"] + "/html"
> directory destdir # Inifinite loop here
>
> desc "Install html-table"
> task :install do |t|
> FileUtils["lib/html/*.rb"].each{ |file|
> cp(file, destdir)
> }
> end
>
> Regards,
>
> Dan
>


It's a bug.

When constructing your destdir, you obtain something like this:
c:/usr/ruby/lib/ruby/site_ruby/1.8/html
(this what I obtain on my computer)

But in rake.rb, on line 408, the code for directory is as this:
----8<----
def directory(dir)
while dir != '.' && dir != '/' # work on unix but not on windows
file dir do |t|
mkdir_p t.name if ! File.exist?(t.name)
end
dir = File.dirname(dir)
end
end
----8<----

I hope this will help

--
Lionel Thiry

Personal website: http://users.skynet.be/lthiry/
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Triple nested loop python (While loop insde of for loop inside ofwhile loop) Isaac Won Python 9 03-04-2013 10:08 AM
My loop goes infinite bhavinvyas C++ 0 01-09-2009 09:29 AM
Rake and rake aborted! Rake aborted! undefined method `gem' for main:Object peppermonkey Ruby 1 02-10-2007 04:43 AM
loop thru a STL list causes an infinite loop Allerdyce.John@gmail.com C++ 5 01-31-2006 03:21 PM
Rake 0.7.0 breaks "rake engine_migrate"? Joe Van Dyk Ruby 2 01-31-2006 12:11 AM



Advertisments