mail 1.3.4 → 1.3.5

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of mail might be problematic. Click here for more details.

data/CHANGELOG.rdoc CHANGED
@@ -1,3 +1,16 @@
1
+ == Sun Dec 27 07:30:02 UTC 2009 Mikel Lindsaar <raasdnil@gmail.com>
2
+
3
+ * Changed fields to default to :decoded on :to_s, all container objects retain :encoded as the default for :to_s
4
+
5
+ == Thu Dec 17 06:35:05 UTC 2009 Mikel Lindsaar <raasdnil@gmail.com>
6
+
7
+ * Fixed parsing error 'Subject: =?ISO-8859-1?Q?Re=3A_ol=E1?=' (has a new line embedded)
8
+
9
+ == Thu Dec 17 02:14:23 UTC 2009 Mikel Lindsaar <raasdnil@gmail.com>
10
+
11
+ * Version 1.3.4
12
+ * Vendor'd treetop
13
+
1
14
  == Thu Dec 17 01:32:00 UTC 2009 Mikel Lindsaar <raasdnil@gmail.com>
2
15
 
3
16
  * Version 1.3.3
data/README.rdoc CHANGED
@@ -110,8 +110,12 @@ I have tried to simplify it some:
110
110
  return the object's "value" only as a string. This means it will not include
111
111
  the header fields (like 'To:' or 'Subject:').
112
112
 
113
- 3. By default, calling :to_s on an object will call it's encoded method, that is, make
114
- it ready to send in an email.
113
+ 3. By default, calling :to_s on a container object will call it's encoded method, while
114
+ :to_s on a field object will call it's decoded method. So calling :to_s on a Mail
115
+ object will return the mail, all encoded ready to send, while calling :to_s on the
116
+ From field will return the decoded value of the field. The body and headers of Mail
117
+ objects are considered containers. If you are in doubt, call :encoded, or :decoded
118
+ explicitly, this is safer if you are not sure.
115
119
 
116
120
  4. Structured fields that have parameter values that can be encoded (e.g. Content-Type) will
117
121
  provide decoded parameter values when you call the parameter names as methods against
data/Rakefile CHANGED
@@ -12,7 +12,7 @@ require 'bundler'
12
12
 
13
13
  spec = Gem::Specification.new do |s|
14
14
  s.name = "mail"
15
- s.version = "1.3.4"
15
+ s.version = "1.3.5"
16
16
  s.author = "Mike Lindsaar"
17
17
  s.email = "raasdnil@gmail.com"
18
18
  s.homepage = "http://github.com/mikel/mail"
@@ -22,10 +22,6 @@ module Mail
22
22
  @parameters
23
23
  end
24
24
 
25
- def to_s(*args)
26
-
27
- end
28
-
29
25
  def cleaned(string)
30
26
  string =~ /(.+);\s*$/ ? $1 : string
31
27
  end
@@ -27,10 +27,6 @@ module Mail
27
27
  @parameters
28
28
  end
29
29
 
30
- def to_s(*args)
31
-
32
- end
33
-
34
30
  def cleaned(string)
35
31
  string =~ /(.+);\s*$/ ? $1 : string
36
32
  end
@@ -91,14 +91,14 @@ module Mail
91
91
  # String has to be of the format =?<encoding>?[QB]?<string>?=
92
92
  def Encodings.value_decode(str)
93
93
  str.gsub!(/\?=(\s*)=\?/, '?==?') # Remove whitespaces between 'encoded-word's
94
- str.gsub(/(.*?)(=\?.*?\?.\?.*?\?=)|$/) do
94
+ str.gsub(/(.*?)(=\?.*?\?.\?.*?\?=)|$/m) do
95
95
  before = $1.to_s
96
96
  text = $2.to_s
97
97
 
98
98
  case
99
- when text =~ /=\?.+\?[Bb]\?/
99
+ when text =~ /=\?.+\?[Bb]\?/m
100
100
  before + b_value_decode(text)
101
- when text =~ /=\?.+\?[Qq]\?/
101
+ when text =~ /=\?.+\?[Qq]\?/m
102
102
  before + q_value_decode(text)
103
103
  else
104
104
  before + text
@@ -181,7 +181,7 @@ module Mail
181
181
  end
182
182
 
183
183
  def Encodings.split_encoding_from_string( str )
184
- match = str.match(/\=\?(.+)?\?[QB]\?(.+)?\?\=/i)
184
+ match = str.match(/\=\?(.+)?\?[QB]\?(.+)?\?\=/mi)
185
185
  if match
186
186
  [match[1], match[2]]
187
187
  else
@@ -28,7 +28,7 @@ module Mail
28
28
  end
29
29
 
30
30
  def to_s
31
- encoded
31
+ decoded
32
32
  end
33
33
 
34
34
  def field_length
data/lib/mail/version.rb CHANGED
@@ -3,7 +3,7 @@ module Mail
3
3
  module VERSION
4
4
  MAJOR = 1
5
5
  MINOR = 3
6
- TINY = 4
6
+ TINY = 5
7
7
 
8
8
  STRING = [MAJOR, MINOR, TINY].join('.')
9
9
  end
@@ -45,7 +45,7 @@ module Mail
45
45
  end
46
46
 
47
47
  def Ruby18.b_value_decode(str)
48
- match = str.match(/\=\?(.+)?\?[Bb]\?(.+)?\?\=/)
48
+ match = str.match(/\=\?(.+)?\?[Bb]\?(.+)?\?\=/m)
49
49
  if match
50
50
  encoding = match[1]
51
51
  str = Ruby18.decode_base64(match[2])
@@ -61,7 +61,7 @@ module Mail
61
61
  end
62
62
 
63
63
  def Ruby18.q_value_decode(str)
64
- match = str.match(/\=\?(.+)?\?[Qq]\?(.+)?\?\=/)
64
+ match = str.match(/\=\?(.+)?\?[Qq]\?(.+)?\?\=/m)
65
65
  if match
66
66
  encoding = match[1]
67
67
  str = Encodings::QuotedPrintable.decode(match[2])
@@ -37,7 +37,7 @@ module Mail
37
37
  end
38
38
 
39
39
  def Ruby19.b_value_decode(str)
40
- match = str.match(/\=\?(.+)?\?[Bb]\?(.+)?\?\=/)
40
+ match = str.match(/\=\?(.+)?\?[Bb]\?(.+)?\?\=/m)
41
41
  if match
42
42
  encoding = match[1]
43
43
  str = Ruby19.decode_base64(match[2])
@@ -52,7 +52,7 @@ module Mail
52
52
  end
53
53
 
54
54
  def Ruby19.q_value_decode(str)
55
- match = str.match(/\=\?(.+)?\?[Qq]\?(.+)?\?\=/)
55
+ match = str.match(/\=\?(.+)?\?[Qq]\?(.+)?\?\=/m)
56
56
  if match
57
57
  encoding = match[1]
58
58
  str = Encodings::QuotedPrintable.decode(match[2])
@@ -11,7 +11,6 @@ require File.join(TREETOP_ROOT, "ruby_extensions")
11
11
  require File.join(TREETOP_ROOT, "runtime")
12
12
  require File.join(TREETOP_ROOT, "compiler")
13
13
 
14
- unless defined?(::TREETOP_DISABLE_POLYGLOT)
15
- require 'polyglot'
14
+ if defined?(Polyglot)
16
15
  Polyglot.register(Treetop::VALID_GRAMMAR_EXT, Treetop)
17
- end
16
+ end
@@ -1,5 +1,4 @@
1
1
  # Have to vendor treetop to avoid loading polyglot
2
2
 
3
3
  $:.unshift "#{File.dirname(__FILE__)}/treetop-1.4.3/lib"
4
- ::TREETOP_DISABLE_POLYGLOT = true
5
4
  require 'treetop'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mail
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.4
4
+ version: 1.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Lindsaar
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-12-17 00:00:00 +11:00
12
+ date: 2009-12-27 00:00:00 +11:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency