* [sup-talk] Hook reloading
@ 2008-05-07 9:25 Tyberius Prime
2008-05-08 9:50 ` Tyberius Prime
2008-05-09 6:10 ` William Morgan
0 siblings, 2 replies; 3+ messages in thread
From: Tyberius Prime @ 2008-05-07 9:25 UTC (permalink / raw)
Hello,
can anyone elucidate me on the subject of when (or how) sup reloads
it's hooks?
I've introduced a new 'open-thread' hook (that I use to store
the message and it's attachment to a directory for my webbrowser),
and now I'm occacionaly greeted with
"[snip/.sup/hooks/open-thread.rb:21: warning: method redefined; discarding old linkHTML".
I guess that happens every time sup reloads the hook in question.
How can I get rid of the message?
And can I force sup to reload its hooks (while developing)?
Thanks
and so long,
Tyberius Prime
^ permalink raw reply [flat|nested] 3+ messages in thread
* [sup-talk] Hook reloading
2008-05-07 9:25 [sup-talk] Hook reloading Tyberius Prime
@ 2008-05-08 9:50 ` Tyberius Prime
2008-05-09 6:10 ` William Morgan
1 sibling, 0 replies; 3+ messages in thread
From: Tyberius Prime @ 2008-05-08 9:50 UTC (permalink / raw)
Excerpts from Tyberius Prime's message of Wed May 07 11:25:59 +0200 2008:
> and now I'm occacionaly greeted with
> "[snip/.sup/hooks/open-thread.rb:21: warning: method redefined; discarding old
> linkHTML".
> I guess that happens every time sup reloads the hook in question.
>
> How can I get rid of the message?
The answer is of course to wrap the function in an
if !defined? functionName
end
block.
> And can I force sup to reload its hooks (while developing)?
--
So long,
Tyberius Prime
^ permalink raw reply [flat|nested] 3+ messages in thread
* [sup-talk] Hook reloading
2008-05-07 9:25 [sup-talk] Hook reloading Tyberius Prime
2008-05-08 9:50 ` Tyberius Prime
@ 2008-05-09 6:10 ` William Morgan
1 sibling, 0 replies; 3+ messages in thread
From: William Morgan @ 2008-05-09 6:10 UTC (permalink / raw)
Reformatted excerpts from Tyberius Prime's message of 2008-05-07:
> can anyone elucidate me on the subject of when (or how) sup reloads
> it's hooks?
A hook is only read from disk the first time it's called. Every time
the hook is called, that code is evaluated, so if you have a function
definition in there, it will be give that warning.
You can ignore the warning, or you can wrap it in a "unless defined?" as
you point out.
> And can I force sup to reload its hooks (while developing)?
There's no way to do this, but I agree it would be nice and wouldn't be
too hard to add...
--
William <wmorgan-sup at masanjin.net>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-05-09 6:10 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-05-07 9:25 [sup-talk] Hook reloading Tyberius Prime
2008-05-08 9:50 ` Tyberius Prime
2008-05-09 6:10 ` William Morgan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox