-
Notifications
You must be signed in to change notification settings - Fork 936
/
mail.rb
65 lines (51 loc) · 1.42 KB
/
mail.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# encoding: utf-8
# frozen_string_literal: true
module Mail # :doc:
require 'date'
require 'shellwords'
require 'uri'
require 'net/smtp'
require 'mini_mime'
require 'mail/version'
require 'mail/indifferent_hash'
require 'mail/multibyte'
require 'mail/constants'
require 'mail/utilities'
require 'mail/configuration'
@@autoloads = {}
def self.register_autoload(name, path)
@@autoloads[name] = path
autoload(name, path)
end
# This runs through the autoload list and explictly requires them for you.
# Useful when running mail in a threaded process.
#
# Usage:
#
# require 'mail'
# Mail.eager_autoload!
def self.eager_autoload!
@@autoloads.each { |_,path| require(path) }
end
# Autoload mail send and receive classes.
require 'mail/network'
require 'mail/message'
require 'mail/part'
require 'mail/header'
require 'mail/parts_list'
require 'mail/attachments_list'
require 'mail/body'
require 'mail/field'
require 'mail/field_list'
register_autoload :Envelope, 'mail/envelope'
# Autoload header field elements and transfer encodings.
require 'mail/elements'
require 'mail/encodings'
require 'mail/encodings/base64'
require 'mail/encodings/quoted_printable'
require 'mail/encodings/unix_to_unix'
require 'mail/matchers/has_sent_mail'
require 'mail/matchers/attachment_matchers'
# Finally... require all the Mail.methods
require 'mail/mail'
end