Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/mail.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def self.register_autoload(name, path)
autoload(name, path)
end

# This runs through the autoload list and explictly requires them for you.
# This runs through the autoload list and explicitly requires them for you.
# Useful when running mail in a threaded process.
#
# Usage:
Expand Down
2 changes: 1 addition & 1 deletion lib/mail/body.rb
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def negotiate_best_encoding(message_encoding, allowed_encodings = nil)
end

# Returns a body encoded using transfer_encoding. Multipart always uses an
# identiy encoding (i.e. no encoding).
# identify encoding (i.e. no encoding).
# Calling this directly is not a good idea, but supported for compatibility
# TODO: Validate that preamble and epilogue are valid for requested encoding
def encoded(transfer_encoding = nil)
Expand Down
2 changes: 1 addition & 1 deletion lib/mail/fields/bcc_field.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module Mail
#
# Sending bcc to a mail message will instantiate a Mail::Field object that
# has a BccField as its field type. This includes all Mail::CommonAddress
# module instance metods.
# module instance methods.
#
# Only one Bcc field can appear in a header, though it can have multiple
# addresses and groups of addresses.
Expand Down
2 changes: 1 addition & 1 deletion lib/mail/fields/cc_field.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module Mail
#
# Sending cc to a mail message will instantiate a Mail::Field object that
# has a CcField as its field type. This includes all Mail::CommonAddress
# module instance metods.
# module instance methods.
#
# Only one Cc field can appear in a header, though it can have multiple
# addresses and groups of addresses.
Expand Down
2 changes: 1 addition & 1 deletion lib/mail/fields/date_field.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module Mail
# has a DateField as its field type. This includes all Mail::CommonAddress
# module instance methods.
#
# There must be excatly one Date field in an RFC2822 email.
# There must be exactly one Date field in an RFC2822 email.
#
# == Examples:
#
Expand Down
2 changes: 1 addition & 1 deletion lib/mail/fields/from_field.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module Mail
#
# Sending from to a mail message will instantiate a Mail::Field object that
# has a FromField as its field type. This includes all Mail::CommonAddress
# module instance metods.
# module instance methods.
#
# Only one From field can appear in a header, though it can have multiple
# addresses and groups of addresses.
Expand Down
2 changes: 1 addition & 1 deletion lib/mail/fields/in_reply_to_field.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module Mail
#
# Sending in_reply_to to a mail message will instantiate a Mail::Field object that
# has a InReplyToField as its field type. This includes all Mail::CommonMessageId
# module instance metods.
# module instance methods.
#
# Note that, the #message_ids method will return an array of message IDs without the
# enclosing angle brackets which per RFC are not syntactically part of the message id.
Expand Down
2 changes: 1 addition & 1 deletion lib/mail/fields/parameter_hash.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

module Mail
# ParameterHash is an intelligent Hash that allows you to add
# parameter values including the MIME extension paramaters that
# parameter values including the MIME extension parameters that
# have the name*0="blah", name*1="bleh" keys, and will just return
# a single key called name="blahbleh" and do any required un-encoding
# to make that happen
Expand Down
2 changes: 1 addition & 1 deletion lib/mail/fields/references_field.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module Mail
#
# Sending references to a mail message will instantiate a Mail::Field object that
# has a ReferencesField as its field type. This includes all Mail::CommonAddress
# module instance metods.
# module instance methods.
#
# Note that, the #message_ids method will return an array of message IDs without the
# enclosing angle brackets which per RFC are not syntactically part of the message id.
Expand Down
2 changes: 1 addition & 1 deletion lib/mail/fields/reply_to_field.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module Mail
#
# Sending reply_to to a mail message will instantiate a Mail::Field object that
# has a ReplyToField as its field type. This includes all Mail::CommonAddress
# module instance metods.
# module instance methods.
#
# Only one Reply-To field can appear in a header, though it can have multiple
# addresses and groups of addresses.
Expand Down
2 changes: 1 addition & 1 deletion lib/mail/fields/resent_bcc_field.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module Mail
#
# Sending resent_bcc to a mail message will instantiate a Mail::Field object that
# has a ResentBccField as its field type. This includes all Mail::CommonAddress
# module instance metods.
# module instance methods.
#
# Only one Resent-Bcc field can appear in a header, though it can have multiple
# addresses and groups of addresses.
Expand Down
2 changes: 1 addition & 1 deletion lib/mail/fields/resent_cc_field.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module Mail
#
# Sending resent_cc to a mail message will instantiate a Mail::Field object that
# has a ResentCcField as its field type. This includes all Mail::CommonAddress
# module instance metods.
# module instance methods.
#
# Only one Resent-Cc field can appear in a header, though it can have multiple
# addresses and groups of addresses.
Expand Down
2 changes: 1 addition & 1 deletion lib/mail/fields/resent_from_field.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module Mail
#
# Sending resent_from to a mail message will instantiate a Mail::Field object that
# has a ResentFromField as its field type. This includes all Mail::CommonAddress
# module instance metods.
# module instance methods.
#
# Only one Resent-From field can appear in a header, though it can have multiple
# addresses and groups of addresses.
Expand Down
2 changes: 1 addition & 1 deletion lib/mail/fields/resent_sender_field.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module Mail
#
# Sending resent_sender to a mail message will instantiate a Mail::Field object that
# has a ResentSenderField as its field type. This includes all Mail::CommonAddress
# module instance metods.
# module instance methods.
#
# Only one Resent-Sender field can appear in a header, though it can have multiple
# addresses and groups of addresses.
Expand Down
2 changes: 1 addition & 1 deletion lib/mail/fields/resent_to_field.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module Mail
#
# Sending resent_to to a mail message will instantiate a Mail::Field object that
# has a ResentToField as its field type. This includes all Mail::CommonAddress
# module instance metods.
# module instance methods.
#
# Only one Resent-To field can appear in a header, though it can have multiple
# addresses and groups of addresses.
Expand Down
2 changes: 1 addition & 1 deletion lib/mail/fields/sender_field.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module Mail
#
# Sending sender to a mail message will instantiate a Mail::Field object that
# has a SenderField as its field type. This includes all Mail::CommonAddress
# module instance metods.
# module instance methods.
#
# Only one Sender field can appear in a header, though it can have multiple
# addresses and groups of addresses.
Expand Down
2 changes: 1 addition & 1 deletion lib/mail/fields/to_field.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module Mail
#
# Sending to to a mail message will instantiate a Mail::Field object that
# has a ToField as its field type. This includes all Mail::CommonAddress
# module instance metods.
# module instance methods.
#
# Only one To field can appear in a header, though it can have multiple
# addresses and groups of addresses.
Expand Down
8 changes: 4 additions & 4 deletions lib/mail/multibyte/unicode.rb
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def decompose_codepoints(type, codepoints)
ncp << (HANGUL_TBASE + tindex) unless tindex == 0
decomposed.concat ncp
# if the codepoint is decomposable in with the current decomposition type
elsif (ncp = database.codepoints[cp].decomp_mapping) and (!database.codepoints[cp].decomp_type || type == :compatability)
elsif (ncp = database.codepoints[cp].decomp_mapping) and (!database.codepoints[cp].decomp_type || type == :compatibility)
decomposed.concat decompose_codepoints(type, ncp.dup)
else
decomposed << cp
Expand Down Expand Up @@ -265,7 +265,7 @@ def tidy_bytes(string, force = false)
if is_unused || is_restricted
bytes[i] = tidy_byte(byte)
elsif is_cont
# Not expecting contination byte? Clean up. Otherwise, now expect one less.
# Not expecting continuation byte? Clean up. Otherwise, now expect one less.
conts_expected == 0 ? bytes[i] = tidy_byte(byte) : conts_expected -= 1
else
if conts_expected > 0
Expand Down Expand Up @@ -307,9 +307,9 @@ def normalize(string, form=nil)
when :c
compose_codepoints(reorder_characters(decompose_codepoints(:canonical, codepoints)))
when :kd
reorder_characters(decompose_codepoints(:compatability, codepoints))
reorder_characters(decompose_codepoints(:compatibility, codepoints))
when :kc
compose_codepoints(reorder_characters(decompose_codepoints(:compatability, codepoints)))
compose_codepoints(reorder_characters(decompose_codepoints(:compatibility, codepoints)))
else
raise ArgumentError, "#{form} is not a valid normalization variant", caller
end.pack('U*')
Expand Down
2 changes: 1 addition & 1 deletion lib/mail/network/retriever_methods/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def all(options = nil, &block)
# order: order of emails returned. Possible values are :asc or :desc. Default value is :asc.
# count: number of emails to retrieve. The default value is 10. A value of 1 returns an
# instance of Message, not an array of Message instances.
# delete_after_find: flag for whether to delete each retreived email after find. Default
# delete_after_find: flag for whether to delete each retrieved email after find. Default
# is true. Call #find if you would like this to default to false.
#
def find_and_delete(options = nil, &block)
Expand Down
2 changes: 1 addition & 1 deletion lib/mail/network/retriever_methods/imap.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def initialize(values)
# set to true, the code will use the EXAMINE command to retrieve the mail. If set to false, which
# is the default, a SELECT command will be used to retrieve the mail
# This is helpful when you don't want your messages to be set to read automatically. Default is false.
# delete_after_find: flag for whether to delete each retreived email after find. Default
# delete_after_find: flag for whether to delete each retrieved email after find. Default
# is false. Use #find_and_delete if you would like this to default to true.
# keys: are passed as criteria to the SEARCH command. They can either be a string holding the entire search string,
# or a single-dimension array of search keywords and arguments. Refer to [IMAP] section 6.4.4 for a full list
Expand Down
2 changes: 1 addition & 1 deletion lib/mail/network/retriever_methods/pop3.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def initialize(values)
# order: order of emails returned. Possible values are :asc or :desc. Default value is :asc.
# count: number of emails to retrieve. The default value is 10. A value of 1 returns an
# instance of Message, not an array of Message instances.
# delete_after_find: flag for whether to delete each retreived email after find. Default
# delete_after_find: flag for whether to delete each retrieved email after find. Default
# is false. Use #find_and_delete if you would like this to default to true.
#
def find(options = nil, &block)
Expand Down
2 changes: 1 addition & 1 deletion lib/mail/utilities.rb
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def unbracket( str )
end
end

# Escape parenthesies in a string
# Escape parentheses in a string
#
# Example:
#
Expand Down
2 changes: 1 addition & 1 deletion rakelib/generate_tables
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# under MIT license
# Usage:
# ruby tasks/generate_tables
# The Unicode version downloaded is determined by the UNICODE_VERSION lib/mail/multibye/unicode.rb
# The Unicode version downloaded is determined by the UNICODE_VERSION lib/mail/multibyte/unicode.rb
require_relative '../lib/mail/multibyte/unicode'

require 'open-uri'
Expand Down
2 changes: 1 addition & 1 deletion spec/mail/body_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def assert_split_into(body, pre, epi, parts)
expect(body.boundary).to eq '----=_Part_2192_32400445'
end

it "should split at the boundry string given returning two message bodies" do
it "should split at the boundary string given returning two message bodies" do
multipart_body = "this is some text\r\n\r\n------=_Part_2192_32400445\r\nContent-Type: text/plain; charset=ISO-8859-1\r\n\r\nThis is a plain text\r\n\r\n------=_Part_2192_32400445\r\nContent-Type: text/html\r\n\r\n<p>This is HTML</p>\r\n------=_Part_2192_32400445--\r\n"
body = Mail::Body.new(multipart_body)
expect(body.split!('----=_Part_2192_32400445').parts.length).to eq 2
Expand Down
2 changes: 1 addition & 1 deletion spec/mail/elements/address_list_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
expect(a.addresses.map {|addr| addr.to_s }).to eq result
end

it "should extract comments in addreses which are part of a group" do
it "should extract comments in addresses which are part of a group" do
parse_text = "group: jimmy <jimmy@(comment)example.com>;";
result = ["comment"]
a = Mail::AddressList.new(parse_text)
Expand Down
2 changes: 1 addition & 1 deletion spec/mail/elements/address_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
expect(a.domain).to eq result
end

it "should give back the formated address" do
it "should give back the formatted address" do
parse_text = 'Mikel Lindsaar <test@lindsaar.net>'
result = 'Mikel Lindsaar <test@lindsaar.net>'
a = Mail::Address.new(parse_text)
Expand Down
2 changes: 1 addition & 1 deletion spec/mail/encodings_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@
expect(Mail::Encodings.value_decode(string)).to eq(result)
end

it "should collapse adjacent words with multiple encodings on one line seperated by non-spaces" do
it "should collapse adjacent words with multiple encodings on one line separated by non-spaces" do
string = "Re:[=?iso-2022-jp?B?GyRCJTAlayE8JV0lcyEmJTglYyVRJXMzdDwwMnEbKEI=?=\n =?iso-2022-jp?B?GyRCPFIbKEI=?=] =?iso-2022-jp?B?GyRCSlY/LiEnGyhC?=\n =?iso-2022-jp?B?GyRCIVolMCVrITwlXSVzIVskKkxkJCQ5ZyRvJDsbKEI=?=\n =?iso-2022-jp?B?GyRCJE43byRLJEQkJCRGIUolaiUvJSglOSVIGyhC?=#1056273\n =?iso-2022-jp?B?GyRCIUsbKEI=?="
result = "Re:[グルーポン・ジャパン株式会社] 返信:【グルーポン】お問い合わせの件について(リクエスト#1056273\n )"
expect(Mail::Encodings.value_decode(string)).to eq(result)
Expand Down
4 changes: 2 additions & 2 deletions spec/mail/fields/content_type_field_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@
expect(c.parameters).to eql({"charset" => 'US-ASCII', "format" => 'flowed'})
end

it "should return boundry parameters" do
it "should return boundary parameters" do
c = Mail::ContentTypeField.new('multipart/mixed; boundary=Apple-Mail-13-196941151')
expect(c.parameters).to eql({"boundary" => 'Apple-Mail-13-196941151'})
end
Expand Down Expand Up @@ -663,7 +663,7 @@

end

describe "handling badly formated content-type fields" do
describe "handling badly formatted content-type fields" do

it "should handle missing sub-type on a text content type" do
c = Mail::ContentTypeField.new('text')
Expand Down
4 changes: 2 additions & 2 deletions spec/mail/fields/unstructured_field_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,13 @@
expect(encoded.length).to eq 80 # including CRLF
end

it "should fold itself if it is 79 chracters long" do
it "should fold itself if it is 79 characters long" do
@field = Mail::UnstructuredField.new("Subject", "This is a subject header message that is absolutely 79 characters long")
result = "Subject: This is a subject header message that is absolutely 79 characters\r\n\slong\r\n"
expect(@field.encoded).to eq result
end

it "should fold itself if it is 997 chracters long" do
it "should fold itself if it is 997 characters long" do
@field = Mail::UnstructuredField.new("Subject", "This is a subject header message that is going to be 997 characters long. This is a subject header message that is going to be 997 characters long. This is a subject header message that is going to be 997 characters long. This is a subject header message that is going to be 997 characters long. This is a subject header message that is going to be 997 characters long. This is a subject header message that is going to be 997 characters long. This is a subject header message that is going to be 997 characters long. This is a subject header message that is going to be 997 characters long. This is a subject header message that is going to be 997 characters long. This is a subject header message that is going to be 997 characters long. This is a subject header message that is going to be 997 characters long. This is a subject header message that is going to be 997 characters long. This is a subject header message that is going to be 997 characters long. And this makes it 997....")
lines = @field.encoded.split("\r\n\s")
lines.each { |line| expect(line.length).to be < 78 }
Expand Down
2 changes: 1 addition & 1 deletion spec/mail/mime_messages_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@
expect(mail.attachments.first.class).to eq Mail::Part
end

it "should be return an aray of attachments" do
it "should be return an array of attachments" do
mail = Mail::Message.new do
from 'mikel@from.lindsaar.net'
subject 'Hello there Mikel'
Expand Down
2 changes: 1 addition & 1 deletion spec/mail/network/delivery_methods/exim_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
mail.deliver!
end

it "should escape evil haxxor attemptes" do
it "should escape evil haxxor attempts" do
evil = '"foo\";touch /tmp/PWNED;\""@blah.com'

expect(mail.delivery_method).to receive(:popen).with(
Expand Down
2 changes: 1 addition & 1 deletion spec/mail/network/retriever_methods/pop3_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@
end

describe "delete_all" do
it "should delete all mesages" do
it "should delete all messages" do
Mail.all
Mail.delete_all

Expand Down
2 changes: 1 addition & 1 deletion spec/mail/utilities_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
end
end

describe "escaping parenthesies" do
describe "escaping parentheses" do
it "should escape parens" do
test = 'This is not (escaped)'
result = 'This is not \(escaped\)'
Expand Down