lib/sup/message-chunks.rb in sup-0.4 vs lib/sup/message-chunks.rb in sup-0.5

- old
+ new

@@ -114,18 +114,20 @@ def inlineable?; false end def expandable?; !viewable? end def initial_state; :open end def viewable?; @lines.nil? end def view_default! path - system "/usr/bin/run-mailcap --action=view #{@content_type}:#{path} > /dev/null 2> /dev/null" + cmd = "/usr/bin/run-mailcap --action=view '#{@content_type}:#{path}' > /dev/null 2> /dev/null" + Redwood::log "running: #{cmd.inspect}" + system cmd $? == 0 end def view! path = write_to_disk ret = HookManager.run "mime-view", :content_type => @content_type, :filename => path - view_default! path unless ret + ret || view_default!(path) end def write_to_disk file = Tempfile.new(@filename || "sup-attachment") file.print @raw_content