email_reply_parser 0.5.1 → 0.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -13,8 +13,8 @@ Gem::Specification.new do |s|
13
13
  ## If your rubyforge_project name is different, then edit it and comment out
14
14
  ## the sub! line in the Rakefile
15
15
  s.name = 'email_reply_parser'
16
- s.version = '0.5.1'
17
- s.date = '2012-05-01'
16
+ s.version = '0.5.2'
17
+ s.date = '2012-09-27'
18
18
  s.rubyforge_project = 'email_reply_parser'
19
19
 
20
20
  ## Make sure your summary is short. The description may be as long
@@ -79,6 +79,9 @@ class EmailReplyParser
79
79
  # in 1.9 we want to operate on the raw bytes
80
80
  text = text.dup.force_encoding('binary') if text.respond_to?(:force_encoding)
81
81
 
82
+ # Normalize line endings.
83
+ text.gsub!("\r\n", "\n")
84
+
82
85
  # Check for multi-line reply headers. Some clients break up
83
86
  # the "On DATE, NAME <EMAIL> wrote:" line into multiple lines.
84
87
  if text =~ /^(On(.+)wrote:)$/nm
@@ -95,6 +95,14 @@ I am currently using the Java HTTP API.\n", reply.fragments[0].to_s
95
95
  assert_match /Was this/, reply.fragments[1].to_s
96
96
  end
97
97
 
98
+ def test_deals_with_windows_line_endings
99
+ reply = email :email_1_7
100
+
101
+ assert_match /:\+1:/, reply.fragments[0].to_s
102
+ assert_match /^On/, reply.fragments[1].to_s
103
+ assert_match /Steps 0-2/, reply.fragments[1].to_s
104
+ end
105
+
98
106
  def test_does_not_modify_input_string
99
107
  original = "The Quick Brown Fox Jumps Over The Lazy Dog"
100
108
  EmailReplyParser.read original
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: email_reply_parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-05-01 00:00:00.000000000 Z
12
+ date: 2012-09-27 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: Long description. Maybe copied from the README.
15
15
  email: technoweenie@gmail.com
@@ -59,10 +59,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
59
59
  version: '0'
60
60
  requirements: []
61
61
  rubyforge_project: email_reply_parser
62
- rubygems_version: 1.8.10
62
+ rubygems_version: 1.8.23
63
63
  signing_key:
64
64
  specification_version: 2
65
65
  summary: Short description used in Gem listings.
66
66
  test_files:
67
67
  - test/email_reply_parser_test.rb
68
- has_rdoc: