Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
* [sup-talk] [PATCH] change opening attachements on darwin to use open instead of run-mailcap
@ 2009-10-28 22:06 Jonah
  2009-10-30 22:07 ` William Morgan
  2009-10-30 23:13 ` Jon Dugan
  0 siblings, 2 replies; 3+ messages in thread
From: Jonah @ 2009-10-28 22:06 UTC (permalink / raw)
  To: sup-talk

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


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

end of thread, other threads:[~2009-10-30 23:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-28 22:06 [sup-talk] [PATCH] change opening attachements on darwin to use open instead of run-mailcap Jonah
2009-10-30 22:07 ` William Morgan
2009-10-30 23:13 ` Jon Dugan

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