Rake goes into infinite loop on Windows

D

Daniel Berger

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
 
L

Lionel Thiry

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top