Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
* [sup-talk] Setting reply to -- hook or config?
@ 2008-04-05  5:48 Jeff Balogh
  2008-04-24  5:23 ` [sup-talk] [PATCH] add a reply-to hook, for setting the Reply To field Jeff Balogh
  0 siblings, 1 reply; 6+ messages in thread
From: Jeff Balogh @ 2008-04-05  5:48 UTC (permalink / raw)


I'm terrible at remembering to reply to all, and today I realized that sup can
help!

I started off making a reply-to hook that takes the array of types sup is
planning to offer in the Reply To field.  I thought the hook would do some fancy
logic and return the right type.  Then I realized I could just list the order of
my reply-to preferences, and pick the first element of the intersection.

  ([:list, :all] & types)[0]

The return value is only used if it's in the types array, so no worries about
nil.

A hook seems like overkill for this one-liner, so maybe it would be more
appropriate for config.yaml?  It makes sense as something in config, but I
hesitate because it would be the first code object (well, the first that _looks_
like code), and because less config variables is good.

-- jeff


^ permalink raw reply	[flat|nested] 6+ messages in thread
* [sup-talk] [PATCH] add a reply-to hook, for setting the Reply To field.
@ 2008-04-27  6:49 William Morgan
  0 siblings, 0 replies; 6+ messages in thread
From: William Morgan @ 2008-04-27  6:49 UTC (permalink / raw)


Reformatted excerpts from its.jeff.balogh's message of 2008-04-23:
>   $ cat .sup/hooks/reply-to.rb
>   ([:list, :all] & types)[0]

I'd be happy to put this in, but agree that it needs slightly better
documntation. Maybe add the list of allowable return values. And saying
it sets the "Reply To field" isn't quite accurate--more like it sets the
default reply-to "mode". Minor nitpicks, but I can see someone being
confused by the output of sup --list-hooks.

-- 
William <wmorgan-sup at masanjin.net>


^ permalink raw reply	[flat|nested] 6+ messages in thread
* [sup-talk] [PATCH] add a reply-to hook, for setting the Reply To field.
@ 2008-04-27  6:50 William Morgan
  0 siblings, 0 replies; 6+ messages in thread
From: William Morgan @ 2008-04-27  6:50 UTC (permalink / raw)


Reformatted excerpts from William Morgan's message of 2008-04-26:
> Maybe add the list of allowable return values.

Heck, you could generate this automatically. Self-documenting code,
literally!

-- 
William <wmorgan-sup at masanjin.net>


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-04-27  6:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-05  5:48 [sup-talk] Setting reply to -- hook or config? Jeff Balogh
2008-04-24  5:23 ` [sup-talk] [PATCH] add a reply-to hook, for setting the Reply To field Jeff Balogh
2008-04-24  5:56   ` Marc Hartstein
2008-04-24 14:38     ` Jeff Balogh
2008-04-27  6:49 William Morgan
2008-04-27  6:50 William Morgan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox