Subject: [sup-talk] Hook reloading

From: [email-masked] (Tyberius Prime)
Date: Wed, 07 May 2008 11:25:59 +0200

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

---

From: [email-masked] (Tyberius Prime)
Date: Thu, 08 May 2008 11:50:05 +0200

> How can I get rid of the message?

The answer is of course to wrap the function in an
if !defined? functionName
end
block.

--
So long,
Tyberius Prime

---

From: [email-masked] (William Morgan)
Date: Thu, 08 May 2008 23:10:12 -0700

> can anyone elucidate me on the subject of when (or how) sup reloads

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>