instance method read_multipart

Ruby on Rails 2.3.18

Since v2.2.3 Last seen in v2.3.18 Private

Available in: v2.2.3 v2.3.18

Signature

read_multipart( src )

No documentation comment.

Parameters

src req
Source
# File actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/mail.rb, line 549
    def read_multipart( src )
      bound = @header['content-type'].params['boundary'] || ::TMail.new_boundary
      is_sep = /\A--#{Regexp.quote bound}(?:--)?[ \t]*(?:\n|\r\n|\r)/
      lastbound = "--#{bound}--"

      ports = [ @config.new_preamble_port(self) ]
      begin
        f = ports.last.wopen
        while line = src.gets
          if is_sep === line
            f.close
            break if line.strip == lastbound
            ports.push @config.new_part_port(self)
            f = ports.last.wopen
          else
            f << line
          end
        end
        @epilogue = (src.read || '')
      ensure
        f.close if f and not f.closed?
      end

      @body_port = ports.shift
      @parts = ports.map {|p| self.class.new(p, @config) }
    end

Defined in actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/mail.rb line 549 · View on GitHub · Improve this page · Find usages on GitHub

Defined in TMail::Mail

Type at least 2 characters to search.

↑↓ navigate · open · esc close