Problems with Rake

C

Charles Comstock

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
 
J

Jim Weirich

Charles said:
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?
 
C

Charles Comstock

Jim said:
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
 
J

Jim Weirich

Charles said:
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?
 
J

Jim Weirich

Jim said:
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.
 

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,768
Messages
2,569,574
Members
45,049
Latest member
Allen00Reed

Latest Threads

Top