Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
* [sup-talk] mailcap for os x
@ 2007-11-29 16:22 Grant Hollingworth
  2007-12-27 18:50 ` William Morgan
  0 siblings, 1 reply; 6+ messages in thread
From: Grant Hollingworth @ 2007-11-29 16:22 UTC (permalink / raw)


run-mailcap(1), which sup uses to view attachments, doesn't exist on OS X.

I used the mime-decode hook to monkey patch Attachment.view! to also use the mime-decode hook. A case statement works as a pretty good replacement for my simple .mailcap.

view_attachment[1] uses file(1) to figure out what an attachment's extension should be, before passing it to open(1). For quicklook I went another way, converting from the MIME type to the OS X UTI[2] using mime2uti, an ugly little program I made.

It's messy, but seems to work for my attachements.

[1] http://filibusta.crema.unimi.it/~gufo/files/view_attachment.sh
[2] http://en.wikipedia.org/wiki/Uniform_Type_Identifier
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mime-decode.rb
Type: application/octet-stream
Size: 957 bytes
Desc: not available
Url : http://rubyforge.org/pipermail/sup-talk/attachments/20071129/ab231270/attachment.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mime2uti.m
Type: application/octet-stream
Size: 763 bytes
Desc: not available
Url : http://rubyforge.org/pipermail/sup-talk/attachments/20071129/ab231270/attachment-0001.obj 


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

end of thread, other threads:[~2008-01-16  4:06 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-29 16:22 [sup-talk] mailcap for os x Grant Hollingworth
2007-12-27 18:50 ` William Morgan
2008-01-15 16:34   ` Grant Hollingworth
2008-01-16  3:20     ` William Morgan
2008-01-16  3:39       ` William Morgan
2008-01-16  4:06       ` William Morgan

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