mail 2.6.4 → 2.6.5.rc1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f91f133d2e44832ecef1cb4bfe9cc57391aedf84
4
- data.tar.gz: 23d0cdbc09cdbaafee76b01d7c3820a6c0dfb6d1
3
+ metadata.gz: 355466608fdb0199f2abf66e17375703660da89d
4
+ data.tar.gz: a084636cc65742d9549eaa2fc69a5f5fe90e3d39
5
5
  SHA512:
6
- metadata.gz: c788407da309561bee6a59ec746efeea7c0cc8633206eb2085f08ad6b161df92475109a988de748e554248d2ca47e6cd31c3fd0394d0eddac5950e7bb28783a8
7
- data.tar.gz: 55b70f9d539420d254373c7abfccf6bc85228f34c38696086be363a36fb4f966415238aaa8e9ec9e6eed02207af2a3940b9f85c5f3076e735cd19e095764abc2
6
+ metadata.gz: b1e02764ba8ddb7f3232f210393866eb6de53cbedef8876ae5b17e6371a385bcc9a1097b87197bf0560cb7b0acb1e62cbbe2949561aab9e70fc045909cbf78b7
7
+ data.tar.gz: 8416a9f1d38d2c3753641b1eb026c3043fe0fd353f2f5ec47f0dac83a233217c43f9f49b30be3edbd6c7eeef60dcf89980c6917140662e591ed11e156b398ee9
@@ -1,4 +1,12 @@
1
- == HEAD
1
+ == Version 2.6.5 - Unreleased
2
+
3
+ Features:
4
+ * #1053 - Ruby 2.4.0 compatibility. Fixnum+Bignum unified as Integer. (peterkovacs)
5
+
6
+ Bugs:
7
+ * #605 - Fix Mail::Address#name for nil addresses (peterkovacs)
8
+ * #1003 - Fix decoding some b encoded headers on specific rubies that don't account for lack of base64 padding (kjg)
9
+ * #1023 - Fix double-quoting in display names. (garethrees)
2
10
 
3
11
  == Version 2.6.4 - Wed Mar 23 08:16 -0700 2016 Jeremy Daer <jeremydaer@gmail.com>
4
12
 
data/Gemfile CHANGED
@@ -1,11 +1,14 @@
1
- source "https://rubygems.org"
1
+ source 'https://rubygems.org'
2
2
 
3
3
  gemspec
4
4
 
5
- gem "tlsmail", "~> 0.0.1" if RUBY_VERSION <= "1.8.6"
6
- gem "jruby-openssl", :platforms => :jruby
5
+ gem 'tlsmail', '~> 0.0.1' if RUBY_VERSION <= '1.8.6'
6
+ gem 'jruby-openssl', :platforms => :jruby
7
+ gem 'rake', '< 11.0', :platforms => :ruby_18
8
+ gem 'rdoc', '< 4.3', :platforms => [ :ruby_18, :ruby_19 ]
9
+ gem 'mime-types', '< 2.0', :platforms => [ :ruby_18, :ruby_19 ]
7
10
 
8
11
  # For gems not required to run tests
9
12
  group :local_development, :test do
10
- gem "appraisal", "~> 1.0" unless RUBY_VERSION <= "1.8.7"
13
+ gem 'appraisal', '~> 1.0' unless RUBY_VERSION < '1.9'
11
14
  end
@@ -1,4 +1,4 @@
1
- Copyright (c) 2009-2016 Mikel Lindsaar
1
+ Copyright (c) 2009-2017 Mikel Lindsaar
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/README.md CHANGED
@@ -48,9 +48,12 @@ Every Mail commit is tested by Travis on the [following platforms](https://githu
48
48
  * ruby-1.9.2 [ x86_64 ]
49
49
  * ruby-1.9.3 [ x86_64 ]
50
50
  * ruby-2.0.0 [ x86_64 ]
51
- * ruby-2.1.2 [ x86_64 ]
51
+ * ruby-2.1.10 [ x86_64 ]
52
+ * ruby-2.2.6 [ x86_64 ]
53
+ * ruby-2.3.3 [ x86_64 ]
52
54
  * ruby-head [ x86_64 ]
53
55
  * jruby [ x86_64 ]
56
+ * jruby-9.1.6.0 [ x86_64 ]
54
57
  * jruby-head [ x86_64 ]
55
58
  * rbx-2 [ x86_64 ]
56
59
 
@@ -697,7 +700,7 @@ License
697
700
 
698
701
  (The MIT License)
699
702
 
700
- Copyright (c) 2009-2016 Mikel Lindsaar
703
+ Copyright (c) 2009-2017 Mikel Lindsaar
701
704
 
702
705
  Permission is hereby granted, free of charge, to any person obtaining
703
706
  a copy of this software and associated documentation files (the
@@ -30,7 +30,7 @@ module Mail
30
30
  # mail.attachments['test.png'].filename #=> 'test.png'
31
31
  # mail.attachments[1].filename #=> 'test.jpg'
32
32
  def [](index_value)
33
- if index_value.is_a?(Fixnum)
33
+ if index_value.is_a?(Integer)
34
34
  self.fetch(index_value)
35
35
  else
36
36
  self.select { |a| a.filename == index_value }.first
@@ -93,7 +93,7 @@ module Mail
93
93
  # a.display_name = 'Mikel Lindsaar'
94
94
  # a.format #=> 'Mikel Lindsaar <mikel@test.lindsaar.net>'
95
95
  def display_name=( str )
96
- @display_name = str.dup # in case frozen
96
+ @display_name = str.nil? ? nil : str.dup # in case frozen
97
97
  end
98
98
 
99
99
  # Returns the local part (the left hand side of the @ sign in the email address) of
@@ -123,7 +123,12 @@ module Mail
123
123
  # a.comments #=> ['My email address']
124
124
  def comments
125
125
  parse unless @parsed
126
- get_comments.map { |c| c.squeeze(SPACE) } unless get_comments.empty?
126
+ comments = get_comments
127
+ if comments.nil? || comments.none?
128
+ nil
129
+ else
130
+ comments.map { |c| c.squeeze(SPACE) }
131
+ end
127
132
  end
128
133
 
129
134
  # Sometimes an address will not have a display name, but might have the name
@@ -205,9 +210,9 @@ module Mail
205
210
  end
206
211
 
207
212
  def get_display_name
208
- if @data.display_name
213
+ if @data && @data.display_name
209
214
  str = strip_all_comments(@data.display_name.to_s)
210
- elsif @data.comments && @data.domain
215
+ elsif @data && @data.comments && @data.domain
211
216
  str = strip_domain_comments(format_comments)
212
217
  end
213
218
  str unless Utilities.blank?(str)
@@ -20,7 +20,7 @@ module Mail
20
20
  # a.group_names #=> ["My Group"]
21
21
  def initialize(string)
22
22
  @addresses_grouped_by_group = nil
23
- @address_list = Parsers::AddressListsParser.new.parse(string)
23
+ @address_list = Mail::Parsers::AddressListsParser.new.parse(string)
24
24
  end
25
25
 
26
26
  # Returns a list of address objects from the parsed line
@@ -8,10 +8,10 @@ module Mail
8
8
  super(list)
9
9
  end
10
10
 
11
- def << (address)
11
+ def <<(address)
12
12
  @field << address
13
13
  end
14
14
 
15
15
  end
16
16
 
17
- end
17
+ end
@@ -269,12 +269,12 @@ module Mail #:nodoc:
269
269
  @wrapped_string[*args] = replace_by
270
270
  else
271
271
  result = Unicode.u_unpack(@wrapped_string)
272
- if args[0].is_a?(Fixnum)
272
+ if args[0].is_a?(Integer)
273
273
  raise IndexError, "index #{args[0]} out of string" if args[0] >= result.length
274
274
  min = args[0]
275
275
  max = args[1].nil? ? min : (min + args[1] - 1)
276
276
  range = Range.new(min, max)
277
- replace_by = [replace_by].pack('U') if replace_by.is_a?(Fixnum)
277
+ replace_by = [replace_by].pack('U') if replace_by.is_a?(Integer)
278
278
  elsif args.first.is_a?(Range)
279
279
  raise RangeError, "#{args[0]} out of range" if args[0].min >= result.length
280
280
  range = args[0]
@@ -25,7 +25,7 @@ module Mail
25
25
  emails_index.reverse! if options[:what] == :last
26
26
  emails_index = case count = options[:count]
27
27
  when :all then emails_index
28
- when Fixnum then emails_index[0, count]
28
+ when Integer then emails_index[0, count]
29
29
  else
30
30
  raise 'Invalid count option value: ' + count.inspect
31
31
  end
@@ -92,7 +92,7 @@ module Mail::Parsers
92
92
  # version.
93
93
  when :angle_addr_s
94
94
  if qstr
95
- address.display_name = qstr
95
+ address.display_name = Mail::Utilities.unescape(qstr)
96
96
  qstr = nil
97
97
  elsif phrase_e
98
98
  address.display_name = s[phrase_s..phrase_e].strip
@@ -72,12 +72,26 @@ module Mail
72
72
  # unqoute(string) #=> 'This is "a string"'
73
73
  def unquote( str )
74
74
  if str =~ /^"(.*?)"$/
75
- $1.gsub(/\\(.)/, '\1')
75
+ unescape($1)
76
76
  else
77
77
  str
78
78
  end
79
79
  end
80
80
 
81
+ # Removes any \-escaping.
82
+ #
83
+ # Example:
84
+ #
85
+ # string = 'This is \"a string\"'
86
+ # unescape(string) #=> 'This is "a string"'
87
+ #
88
+ # string = '"This is \"a string\""'
89
+ # unescape(string) #=> '"This is "a string""'
90
+ def unescape( str )
91
+ str.gsub(/\\(.)/, '\1')
92
+ end
93
+ module_function :unescape
94
+
81
95
  # Wraps a string in parenthesis and escapes any that are in the string itself.
82
96
  #
83
97
  # Example:
@@ -4,8 +4,8 @@ module Mail
4
4
 
5
5
  MAJOR = 2
6
6
  MINOR = 6
7
- PATCH = 4
8
- BUILD = nil
7
+ PATCH = 5
8
+ BUILD = 'rc1'
9
9
 
10
10
  STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join('.')
11
11
 
@@ -59,6 +59,9 @@ module Mail
59
59
  end
60
60
 
61
61
  def Ruby19.decode_base64(str)
62
+ if !str.end_with?("=") && str.length % 4 != 0
63
+ str = str.ljust((str.length + 3) & ~3, "=")
64
+ end
62
65
  str.unpack( 'm' ).first
63
66
  end
64
67
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mail
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.4
4
+ version: 2.6.5.rc1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mikel Lindsaar
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-23 00:00:00.000000000 Z
11
+ date: 2017-04-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mime-types
@@ -264,12 +264,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
264
264
  version: '0'
265
265
  required_rubygems_version: !ruby/object:Gem::Requirement
266
266
  requirements:
267
- - - ">="
267
+ - - ">"
268
268
  - !ruby/object:Gem::Version
269
- version: '0'
269
+ version: 1.3.1
270
270
  requirements: []
271
271
  rubyforge_project:
272
- rubygems_version: 2.5.1
272
+ rubygems_version: 2.6.10
273
273
  signing_key:
274
274
  specification_version: 4
275
275
  summary: Mail provides a nice Ruby DSL for making, sending and reading emails.