From: Jonah <Jonah@GoodCoffee.ca>
To: sup-talk@rubyforge.org
Subject: [sup-talk] [PATCH] change opening attachements on darwin to use open instead of run-mailcap
Date: Wed, 28 Oct 2009 18:06:43 -0400 [thread overview]
Message-ID: <4AE8C073.404@GoodCoffee.ca> (raw)
Hey everyone,
I've been working on getting sup to work in MacOSX (darwin). MacOSX has a special command (open) for opening files - there is no support for mailcap. This patch uses case to run the appropriate command depending on the architecture used.
I still haven't gotten sup to send mail yet,.. so more patches for MacOSX will probably be forthcoming. :)
I'm loving sup so far, keep up the great work!
Cheers,
Jonah
---
lib/sup/message-chunks.rb | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/lib/sup/message-chunks.rb b/lib/sup/message-chunks.rb
index edc40c4..581b707 100644
--- a/lib/sup/message-chunks.rb
+++ b/lib/sup/message-chunks.rb
@@ -132,7 +132,12 @@ EOS
def initial_state; :open end
def viewable?; @lines.nil? end
def view_default! path
- cmd = "/usr/bin/run-mailcap --action=view '#{@content_type}:#{path}'"
+ case Config::CONFIG['arch']
+ when /darwin/
+ cmd = "open '#{path}'"
+ else
+ cmd = "/usr/bin/run-mailcap --action=view '#{@content_type}:#{path}'"
+ end
debug "running: #{cmd.inspect}"
BufferManager.shell_out(cmd)
$? == 0
--
1.6.3.3
_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk
next reply other threads:[~2009-10-28 22:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-28 22:06 Jonah [this message]
2009-10-30 22:07 ` William Morgan
2009-10-30 23:13 ` Jon Dugan
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=4AE8C073.404@GoodCoffee.ca \
--to=jonah@goodcoffee.ca \
--cc=sup-talk@rubyforge.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