Rake goes into infinite loop on Windows

Discussion in 'Ruby' started by Daniel Berger, May 1, 2005.

  1. 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
     
    Daniel Berger, May 1, 2005
    #1
    1. Advertising

  2. Daniel Berger

    Lionel Thiry Guest

    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/
     
    Lionel Thiry, May 1, 2005
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    5
    Views:
    625
    benben
    Jan 31, 2006
  2. bhavinvyas

    My loop goes infinite

    bhavinvyas, Jan 9, 2009, in forum: C Programming
    Replies:
    0
    Views:
    348
    bhavinvyas
    Jan 9, 2009
  3. S. Robert James

    When Rake goes "Ache!"

    S. Robert James, Nov 17, 2006, in forum: Ruby
    Replies:
    3
    Views:
    92
    Jim Weirich
    Nov 17, 2006
  4. peppermonkey
    Replies:
    1
    Views:
    268
    Gregory Brown
    Feb 10, 2007
  5. Isaac Won
    Replies:
    9
    Views:
    449
    Ulrich Eckhardt
    Mar 4, 2013
Loading...

Share This Page