Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
From: grant@antiflux.org (Grant Hollingworth)
Subject: [sup-talk] mailcap for os x
Date: Thu, 29 Nov 2007 11:22:10 -0500	[thread overview]
Message-ID: <1196351498-sup-4803@spooky.local> (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 


             reply	other threads:[~2007-11-29 16:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-29 16:22 Grant Hollingworth [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1196351498-sup-4803@spooky.local \
    --to=grant@antiflux.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox