diff options
author | Rick Olson <technoweenie@gmail.com> | 2008-01-11 01:55:20 +0000 |
---|---|---|
committer | Rick Olson <technoweenie@gmail.com> | 2008-01-11 01:55:20 +0000 |
commit | 2dda6391207fc7a7d36536306db36eed33f3af9d (patch) | |
tree | e7998a49416de1db0a3409cf89cdb84aec8b8816 /actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/attachments.rb | |
parent | a8eb90fcee1efdc491c9eb030827b46929ea979c (diff) | |
download | rails-2dda6391207fc7a7d36536306db36eed33f3af9d.tar.gz rails-2dda6391207fc7a7d36536306db36eed33f3af9d.tar.bz2 rails-2dda6391207fc7a7d36536306db36eed33f3af9d.zip |
Updated TMail to version 1.2.1 [raasdnil]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8620 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/attachments.rb')
-rw-r--r-- | actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/attachments.rb | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/attachments.rb b/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/attachments.rb deleted file mode 100644 index a8b8017cf9..0000000000 --- a/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/attachments.rb +++ /dev/null @@ -1,47 +0,0 @@ -=begin rdoc - -= Attachment handling class - -=end - -require 'stringio' - -module TMail - class Attachment < StringIO - attr_accessor :original_filename, :content_type - end - - class Mail - def has_attachments? - multipart? && parts.any? { |part| attachment?(part) } - end - - def attachment?(part) - (part['content-disposition'] && part['content-disposition'].disposition == "attachment") || - part.header['content-type'].main_type != "text" - end - - def attachments - if multipart? - parts.collect { |part| - if part.multipart? - part.attachments - elsif attachment?(part) - content = part.body # unquoted automatically by TMail#body - file_name = (part['content-location'] && - part['content-location'].body) || - part.sub_header("content-type", "name") || - part.sub_header("content-disposition", "filename") - - next if file_name.blank? || content.blank? - - attachment = Attachment.new(content) - attachment.original_filename = file_name.strip - attachment.content_type = part.content_type - attachment - end - }.flatten.compact - end - end - end -end |