Sha256: c09db5334a1b6403343b1af4640b9e8e133cfd5fbda327a13cb266e7ffef097a
Contents?: true
Size: 577 Bytes
Versions: 13
Compression:
Stored size: 577 Bytes
Contents
module Vmail module AddressQuoter def quote_addresses(input) parts = input.split /\s*,\s*/ addrs = [] savebin = "" #Group the parts together parts.each do |part| if part.include? "@" addrs << savebin + part savebin = "" else savebin = part + ", " end end #Quote the names addrs.map { |addr| # a little hackish if addr =~ /"/ addr else addr.gsub(/^(.*) (<.*)/, '"\1" \2') end }.join(', ') end end end
Version data entries
13 entries across 13 versions & 1 rubygems