Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Problems with Rake

Reply
Thread Tools

Problems with Rake

 
 
Charles Comstock
Guest
Posts: n/a
 
      06-19-2004
How come if a project has a dependency of task clean, which kills all
the tilde files, later tasks in the dependency list will still try and
create the tilde files that are missing, mistakenly believing they are
valid tasks or files?
Charles Comstock
 
Reply With Quote
 
 
 
 
Jim Weirich
Guest
Posts: n/a
 
      06-19-2004
Charles Comstock wrote:
> How come if a project has a dependency of task clean, which kills all
> the tilde files, later tasks in the dependency list will still try and
> create the tilde files that are missing, mistakenly believing they are
> valid tasks or files?
> Charles Comstock


If you have tasks that create tilde files (i.e. file names ending in ~),
then rake will attempt to create these files when the appropriate task
is triggered. It does not matter if these files were deleted earlier by
an unrelated task (such as :clean).

Perhaps I'm misunderstanding the problem. Do you have a short Rakefile
example?

--
-- Jim Weirich http://www.velocityreviews.com/forums/(E-Mail Removed) http://onestepback.org
-----------------------------------------------------------------
"Beware of bugs in the above code; I have only proved it correct,
not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas)



 
Reply With Quote
 
 
 
 
Charles Comstock
Guest
Posts: n/a
 
      06-19-2004
Jim Weirich wrote:

> Charles Comstock wrote:
>
>> How come if a project has a dependency of task clean, which kills all
>> the tilde files, later tasks in the dependency list will still try and
>> create the tilde files that are missing, mistakenly believing they are
>> valid tasks or files?
>> Charles Comstock

>
>
> If you have tasks that create tilde files (i.e. file names ending in ~),
> then rake will attempt to create these files when the appropriate task
> is triggered. It does not matter if these files were deleted earlier by
> an unrelated task (such as :clean).
>
> Perhaps I'm misunderstanding the problem. Do you have a short Rakefile
> example?
>


No task creates ~ files in my rakefile, however, if my editor leaves ~
backup files strewn about the directory, rake attempts to make automatic
tasks to recreate or process these ~ files.

Charles Comstock
 
Reply With Quote
 
Jim Weirich
Guest
Posts: n/a
 
      06-19-2004
Charles Comstock wrote:
> No task creates ~ files in my rakefile, however, if my editor leaves ~
> backup files strewn about the directory, rake attempts to make automatic
> tasks to recreate or process these ~ files.


Can I see an example rakefile that does this?

--
-- Jim Weirich (E-Mail Removed) http://onestepback.org
-----------------------------------------------------------------
"Beware of bugs in the above code; I have only proved it correct,
not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas)



 
Reply With Quote
 
Jim Weirich
Guest
Posts: n/a
 
      06-20-2004
Jim Weirich wrote:
> Charles Comstock wrote:
>
>> No task creates ~ files in my rakefile, however, if my editor leaves ~
>> backup files strewn about the directory, rake attempts to make
>> automatic tasks to recreate or process these ~ files.

>
>
> Can I see an example rakefile that does this?


Just a quick update in case anyone is interested. Charles sent me his
Rakefile. It was using Dir.glob('**/*') to build a list of files to be
put into a package. The glob runs before the clean task executes, so
all the tilde files in the directory were included in the packaging
list. Then the clean task ran deleting all the tilde files. Finally
the package task ran, and it wanted to rebuild the tilde files (because
they were in the package list).

The solution was to exclude the tilde files from the package list. They
could be explicitly removed, or use a Rake::FileList object to build
the package list. FileLists are smart enough to deal with tilde files
and other common temporary files.

--
-- Jim Weirich (E-Mail Removed) http://onestepback.org
-----------------------------------------------------------------
"Beware of bugs in the above code; I have only proved it correct,
not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas)



 
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
multiple rake build files? large rake files thufir Ruby 3 04-12-2008 07:28 AM
rake published rdoc version and arity of Rake::Task#execute - wrongnumber of arguments (0 for 1) James Mead Ruby 0 01-15-2008 05:42 PM
Rake TestTask running its block anytime rake is invoked Adam Anderson Ruby 1 09-19-2007 08:40 AM
Rake and rake aborted! Rake aborted! undefined method `gem' for main:Object peppermonkey Ruby 1 02-10-2007 04:43 AM
Rake 0.7.0 breaks "rake engine_migrate"? Joe Van Dyk Ruby 2 01-31-2006 12:11 AM



Advertisments