Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Rake: Deleting or overwriting a task?

Reply
Thread Tools

Rake: Deleting or overwriting a task?

 
 
Michael Schuerig
Guest
Posts: n/a
 
      09-05-2005

Rails has recently (in SVN) moved to a modularized Rakefile. This causes
me some trouble as I need to change the tasks executed before
unit/functional tests are run. :test_units as well as :test_functional
depend on :clone_structure_to_test. The latter sets up the test
database as a structural copy of the development database.

Copying includes foreign key constraints present in the development
database. Unfortunately, there is no way I can order loading (and
deletion) of fixtures so that foreign key constraints are satisfied.
Therefore I grudgingly used to create the test db from a definition
file lacking these constraints.

Now, without being able to change the :clone_structure_to_test task
directly, I'm looking for a way to either remove it as a prerequisite
from the test tasks or overwrite it. So far, I've only found ways to
add prerequisites and add blocks that are processes for a task. Is
there a way to do what I need?

Michael

--
Michael Schuerig Face reality and stare it down
(E-Mail Removed) --Jethro Tull, Silver River Turning
http://www.schuerig.de/michael/

 
Reply With Quote
 
 
 
 
Jamis Buck
Guest
Posts: n/a
 
      09-05-2005
Just looking at the rake sources, it looks like you could do:

Task::TASKS["clone_structure_to_test"] = nil
task :clone_structure_to_test do
...
end

I haven't tried this, though...

- Jamis

On Sep 5, 2005, at 8:41 AM, Michael Schuerig wrote:

>
> Rails has recently (in SVN) moved to a modularized Rakefile. This
> causes
> me some trouble as I need to change the tasks executed before
> unit/functional tests are run. :test_units as well as :test_functional
> depend on :clone_structure_to_test. The latter sets up the test
> database as a structural copy of the development database.
>
> Copying includes foreign key constraints present in the development
> database. Unfortunately, there is no way I can order loading (and
> deletion) of fixtures so that foreign key constraints are satisfied.
> Therefore I grudgingly used to create the test db from a definition
> file lacking these constraints.
>
> Now, without being able to change the :clone_structure_to_test task
> directly, I'm looking for a way to either remove it as a prerequisite
> from the test tasks or overwrite it. So far, I've only found ways to
> add prerequisites and add blocks that are processes for a task. Is
> there a way to do what I need?
>
> Michael
>
> --
> Michael Schuerig Face reality and stare it down
> (E-Mail Removed) --Jethro Tull, Silver River Turning
> http://www.schuerig.de/michael/
>
>
>




 
Reply With Quote
 
 
 
 
Michael Schuerig
Guest
Posts: n/a
 
      09-05-2005
Jamis Buck wrote:

> Just looking at the rake sources, it looks like you could do:
>
> Task::TASKS["clone_structure_to_test"] = nil
> task :clone_structure_to_test do
> ...
> end
>
> I haven't tried this, though...


Thanks! It works indeed.

Michael

--
Michael Schuerig Nothing is as brilliantly adaptive
(E-Mail Removed) as selective stupidity.
http://www.schuerig.de/michael/ --A.O. Rorty, The Deceptive Self

 
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
Deleting data from the file without deleting the file first crea C++ 2 12-28-2012 11:50 PM
Deleting a File from Hardrive and Deleting a SubKey in Registry Harry Barker C++ 2 04-19-2006 09:34 AM
..HtmlControls.HtmlInputFile.Saveas(filename) not overwriting =?Utf-8?B?UmVkZHk=?= ASP .Net 5 12-28-2005 07:58 PM
Java concurrent transactions overwriting Dave Ficken Java 1 11-10-2003 08:25 PM
AXIS and Java - concurrent transactions overwriting each other Dave Ficken Java 0 11-08-2003 02:19 PM



Advertisments