Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.ruby
Rake Task (or rule) dependency check tweaking
Peter Pk
1/15/2009 4:39:00 PM
Given there may be a complex task -
ie: spawns a shell process running "make", "vcbuild", "ant" or
whatever
or invokes a large ruby subroutine
Given that the module is opaque to ruby and needs to be invoked to
determine whether it does or does not need to rebuild it's (file)
target. How might one have the dependent task invoke this check in this
ancestor during the traversing of the dependencies, and if the ancestor
task decides it is "up to date" *not* execute it's block, triggering all
it's dependents to rebuild.
Something like overriding an "is_up_to_date" method on a file task which
is invoked during checking the graph of dependencies?
ie: inside ancestor
def is_up_to_date
sh "checkAndMaybeBuildIt ..." # may or may not build it's targets
return(no_targets_updated)
end
and if this task may or may not update multiple target files?
(should I get the Rake source code? How to get it? via Gems?)
???
--
Posted via
http://www.ruby-...
.
1 Answer
Peter Pk
1/15/2009 11:48:00 PM
0
I got the source to Rake. Pardon the prior post :)
It seems what one does is to subclass a FileTask and overide the
needed? and timestamp methods
Source code is often the best doc :)
Peter Pk wrote:
>
> Given there may be a complex task -
> ie: spawns a shell process running "make", "vcbuild", "ant" or
> whatever
> or invokes a large ruby subroutine
>
> Given that the module is opaque to ruby and needs to be invoked to
> determine whether it does or does not need to rebuild it's (file)
> target. How might one have the dependent task invoke this check in this
> ancestor during the traversing of the dependencies, and if the ancestor
> task decides it is "up to date" *not* execute it's block, triggering all
> it's dependents to rebuild.
>
> Something like overriding an "is_up_to_date" method on a file task which
> is invoked during checking the graph of dependencies?
>
> ie: inside ancestor
>
> def is_up_to_date
> sh "checkAndMaybeBuildIt ..." # may or may not build it's targets
> return(no_targets_updated)
> end
>
> and if this task may or may not update multiple target files?
>
> (should I get the Rake source code? How to get it? via Gems?)
> ???
--
Posted via
http://www.ruby-...
.
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
Rake Task (or rule) dependency check tweaking
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password