Skip to content

Commit ca76e1e

Browse files
committed
Removed long-deprecated features
* Message#register_for_delivery_notification, * #has_transfer_encoding?, * #add_transfer_encoding, * #transfer_encoding, * #message_content_type, * #mime_parameters, * #encode!, and * Part#inline_content_id.
1 parent 7ef5694 commit ca76e1e

File tree

4 files changed

+1
-48
lines changed

4 files changed

+1
-48
lines changed

CHANGELOG.rdoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
Breaking changes:
44
* Passing unparsed headers to Mail::Field.new is no longer supported. Use Mail::Field.parse. (jeremy)
5+
* Removed long-deprecated features: Message#register_for_delivery_notification, #has_transfer_encoding?, #add_transfer_encoding, #transfer_encoding, #message_content_type, #mime_parameters, #encode!, and Part#inline_content_id. (jeremy)
56

67

78
== Version 2.7.0 (2017-10-31)

lib/mail/message.rb

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -233,11 +233,6 @@ def self.default_charset; @@default_charset; end
233233
def self.default_charset=(charset); @@default_charset = charset; end
234234
self.default_charset = 'UTF-8'
235235

236-
def register_for_delivery_notification(observer)
237-
warn("Message#register_for_delivery_notification is deprecated, please call Mail.register_observer instead")
238-
Mail.register_observer(observer)
239-
end
240-
241236
def inform_observers
242237
Mail.inform_observers(self)
243238
end
@@ -1434,11 +1429,6 @@ def has_content_transfer_encoding?
14341429
header[:content_transfer_encoding] && Utilities.blank?(header[:content_transfer_encoding].errors)
14351430
end
14361431

1437-
def has_transfer_encoding? # :nodoc:
1438-
warn(":has_transfer_encoding? is deprecated in Mail 1.4.3. Please use has_content_transfer_encoding?\n#{caller}")
1439-
has_content_transfer_encoding?
1440-
end
1441-
14421432
# Creates a new empty Message-ID field and inserts it in the correct order
14431433
# into the Header. The MessageIdField object will automatically generate
14441434
# a unique message ID if you try and encode it or output it to_s without
@@ -1496,26 +1486,11 @@ def add_content_transfer_encoding
14961486
header[:content_transfer_encoding] ||= body.default_encoding
14971487
end
14981488

1499-
def add_transfer_encoding # :nodoc:
1500-
warn(":add_transfer_encoding is deprecated in Mail 1.4.3. Please use add_content_transfer_encoding\n#{caller}")
1501-
add_content_transfer_encoding
1502-
end
1503-
1504-
def transfer_encoding # :nodoc:
1505-
warn(":transfer_encoding is deprecated in Mail 1.4.3. Please use content_transfer_encoding\n#{caller}")
1506-
content_transfer_encoding
1507-
end
1508-
15091489
# Returns the MIME media type of part we are on, this is taken from the content-type header
15101490
def mime_type
15111491
has_content_type? ? header[:content_type].string : nil rescue nil
15121492
end
15131493

1514-
def message_content_type
1515-
warn(":message_content_type is deprecated in Mail 1.4.3. Please use mime_type\n#{caller}")
1516-
mime_type
1517-
end
1518-
15191494
# Returns the character set defined in the content type field
15201495
def charset
15211496
if @header
@@ -1542,12 +1517,6 @@ def sub_type
15421517
has_content_type? ? header[:content_type].sub_type : nil rescue nil
15431518
end
15441519

1545-
# Returns the content type parameters
1546-
def mime_parameters
1547-
warn(':mime_parameters is deprecated in Mail 1.4.3, please use :content_type_parameters instead')
1548-
content_type_parameters
1549-
end
1550-
15511520
# Returns the content type parameters
15521521
def content_type_parameters
15531522
has_content_type? ? header[:content_type].parameters : nil rescue nil
@@ -1816,11 +1785,6 @@ def ready_to_send!
18161785
add_required_fields
18171786
end
18181787

1819-
def encode!
1820-
warn("Deprecated in 1.1.0 in favour of :ready_to_send! as it is less confusing with encoding and decoding.")
1821-
ready_to_send!
1822-
end
1823-
18241788
# Outputs an encoded string representation of the mail message including
18251789
# all headers, attachments, etc. This is an encoded email in US-ASCII,
18261790
# so it is able to be directly sent to an email server.

lib/mail/part.rb

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,6 @@ def has_content_id?
2121
header.has_content_id?
2222
end
2323

24-
def inline_content_id
25-
# TODO: Deprecated in 2.2.2 - Remove in 2.3
26-
warn("Part#inline_content_id is deprecated, please call Part#cid instead")
27-
cid
28-
end
29-
3024
def cid
3125
add_content_id unless has_content_id?
3226
Utilities.uri_escape(Utilities.unbracket(content_id))

spec/mail/part_spec.rb

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@
4343
body "This is Text"
4444
end
4545
expect(part.cid).to eq "thisis@acontentid"
46-
expect($stderr).to receive(:puts).with("Part#inline_content_id is deprecated, please call Part#cid instead")
47-
expect(part.inline_content_id).to eq "thisis@acontentid"
4846
end
4947

5048

@@ -54,15 +52,11 @@
5452
body "This is Text"
5553
end
5654
expect(part.cid).to eq "thi%25%25sis@acontentid"
57-
expect($stderr).to receive(:puts).with("Part#inline_content_id is deprecated, please call Part#cid instead")
58-
expect(part.inline_content_id).to eq "thi%25%25sis@acontentid"
5955
end
6056

6157
it "should add a content_id if there is none and is asked for an inline_content_id" do
6258
part = Mail::Part.new
6359
expect(part.cid).not_to be_nil
64-
expect($stderr).to receive(:puts).with("Part#inline_content_id is deprecated, please call Part#cid instead")
65-
expect(part.inline_content_id).not_to be_nil
6660
end
6761

6862
it "should respond correctly to inline?" do

0 commit comments

Comments
 (0)