[PATCH] change opening attachements on darwin to use open instead of run-mailcap

View: New views
3 Messages — Rating Filter:   Alert me  

[PATCH] change opening attachements on darwin to use open instead of run-mailcap

by Jonah-17 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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@...
http://rubyforge.org/mailman/listinfo/sup-talk

Re: [PATCH] change opening attachements on darwin to use open instead of run-mailcap

by William Morgan-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Reformatted excerpts from Jonah's message of 2009-10-28:
> 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.

Branch no-mailcap-on-darwin, merged into next. Thanks!

> I still haven't gotten sup to send mail yet,.. so more patches for
> MacOSX will probably be forthcoming.  :)

Great, glad to have them.
--
William <wmorgan-sup@...>
_______________________________________________
sup-talk mailing list
sup-talk@...
http://rubyforge.org/mailman/listinfo/sup-talk

Re: [PATCH] change opening attachements on darwin to use open instead of run-mailcap

by Jon Dugan :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Excerpts from Jonah's message of Wed Oct 28 17:06:43 -0500 2009:
> I still haven't gotten sup to send mail yet,.. so more patches for MacOSX will
> probably be forthcoming.  :)

I use msmtp via MacPorts to send mail from OS X.  The sup wiki has some
information on how to use msmtp in the "how mail leaves" section:

http://sup.rubyforge.org/wiki/wiki.pl

And the MacPorts homepage is at:

http://macports.org/

Jon
--
Jon M. Dugan <jdugan@...>
ESnet Network Engineering Group
Lawrence Berkeley National Laboratory
_______________________________________________
sup-talk mailing list
sup-talk@...
http://rubyforge.org/mailman/listinfo/sup-talk