Upgraded Rails and RSpec
[monkeycharger.git] / vendor / rails / actionmailer / lib / action_mailer / vendor / tmail-1.1.0 / tmail / obsolete.rb
blobb871510b829a3fab7665ecc9d5cd4e01ec3d2910
1 =begin rdoc
3 = Obsolete methods that are depriciated
5 =end
6 #--
7 # Copyright (c) 1998-2003 Minero Aoki <aamine@loveruby.net>
9 # Permission is hereby granted, free of charge, to any person obtaining
10 # a copy of this software and associated documentation files (the
11 # "Software"), to deal in the Software without restriction, including
12 # without limitation the rights to use, copy, modify, merge, publish,
13 # distribute, sublicense, and/or sell copies of the Software, and to
14 # permit persons to whom the Software is furnished to do so, subject to
15 # the following conditions:
17 # The above copyright notice and this permission notice shall be
18 # included in all copies or substantial portions of the Software.
20 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
21 # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22 # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
23 # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
24 # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
25 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
26 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28 # Note: Originally licensed under LGPL v2+. Using MIT license for Rails
29 # with permission of Minero Aoki.
30 #++
32 module TMail
34   # mail.rb
35   class Mail
36     alias include? key?
37     alias has_key? key?
39     def values
40       ret = []
41       each_field {|v| ret.push v }
42       ret
43     end
45     def value?( val )
46       HeaderField === val or return false
48       [ @header[val.name.downcase] ].flatten.include? val
49     end
51     alias has_value? value?
52   end
55   # facade.rb
56   class Mail
57     def from_addr( default = nil )
58       addr, = from_addrs(nil)
59       addr || default
60     end
62     def from_address( default = nil )
63       if a = from_addr(nil)
64         a.spec
65       else
66         default
67       end
68     end
70     alias from_address= from_addrs=
72     def from_phrase( default = nil )
73       if a = from_addr(nil)
74         a.phrase
75       else
76         default
77       end
78     end
80     alias msgid  message_id
81     alias msgid= message_id=
83     alias each_dest each_destination
84   end
87   # address.rb
88   class Address
89     alias route routes
90     alias addr spec
92     def spec=( str )
93       @local, @domain = str.split(/@/,2).map {|s| s.split(/\./) }
94     end
96     alias addr= spec=
97     alias address= spec=
98   end
101   # mbox.rb
102   class MhMailbox
103     alias new_mail new_port
104     alias each_mail each_port
105     alias each_newmail each_new_port
106   end
107   class UNIXMbox
108     alias new_mail new_port
109     alias each_mail each_port
110     alias each_newmail each_new_port
111   end
112   class Maildir
113     alias new_mail new_port
114     alias each_mail each_port
115     alias each_newmail each_new_port
116   end
119   # utils.rb
120   extend TextUtils
122   class << self
123     alias msgid?    message_id?
124     alias boundary  new_boundary
125     alias msgid     new_message_id
126     alias new_msgid new_message_id
127   end
129   def Mail.boundary
130     ::TMail.new_boundary
131   end
133   def Mail.msgid
134     ::TMail.new_message_id
135   end
137 end   # module TMail