mail_extract 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/mail_extract/line.rb +1 -1
- data/lib/mail_extract/version.rb +1 -1
- data/spec/fixtures/reply_with_quotes.txt +11 -0
- data/spec/parser_spec.rb +5 -0
- metadata +28 -43
data/lib/mail_extract/line.rb
CHANGED
@@ -37,7 +37,7 @@ module MailExtract
|
|
37
37
|
|
38
38
|
def detect_type(line)
|
39
39
|
# Detects the start line of quote text
|
40
|
-
if line.strip =~ /^On/ && line =~ /at [\d:]+/
|
40
|
+
if line.strip =~ /^On\s/i && line =~ /at [\d:]+/ || line.strip =~ />? wrote:\z/
|
41
41
|
@type = :quote
|
42
42
|
return
|
43
43
|
end
|
data/lib/mail_extract/version.rb
CHANGED
data/spec/parser_spec.rb
CHANGED
@@ -10,4 +10,9 @@ describe 'MailExtract::Parser' do
|
|
10
10
|
body = MailExtract.new(fixture('simple_with_quotes.txt')).body
|
11
11
|
body.should == result_fixture('simple_with_quotes.txt')
|
12
12
|
end
|
13
|
+
|
14
|
+
it 'parses a reply email with broken authored line' do
|
15
|
+
body = MailExtract.new(fixture('reply_with_quotes.txt')).body
|
16
|
+
body.should == 'This is a first line of the message'
|
17
|
+
end
|
13
18
|
end
|
metadata
CHANGED
@@ -1,38 +1,33 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: mail_extract
|
3
|
-
version: !ruby/object:Gem::Version
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.2
|
4
5
|
prerelease:
|
5
|
-
version: 0.1.1
|
6
6
|
platform: ruby
|
7
|
-
authors:
|
7
|
+
authors:
|
8
8
|
- Dan Sosedoff
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
dependencies:
|
16
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2011-08-11 00:00:00.000000000Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
17
15
|
name: rspec
|
18
|
-
|
19
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
16
|
+
requirement: &72663040 !ruby/object:Gem::Requirement
|
20
17
|
none: false
|
21
|
-
requirements:
|
18
|
+
requirements:
|
22
19
|
- - ~>
|
23
|
-
- !ruby/object:Gem::Version
|
24
|
-
version:
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '2.6'
|
25
22
|
type: :development
|
26
|
-
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *72663040
|
27
25
|
description: Email body parser that strips out all quotes and signatures.
|
28
26
|
email: dan.sosedoff@gmail.com
|
29
27
|
executables: []
|
30
|
-
|
31
28
|
extensions: []
|
32
|
-
|
33
29
|
extra_rdoc_files: []
|
34
|
-
|
35
|
-
files:
|
30
|
+
files:
|
36
31
|
- .gitignore
|
37
32
|
- .rspec
|
38
33
|
- README.md
|
@@ -42,6 +37,7 @@ files:
|
|
42
37
|
- lib/mail_extract/parser.rb
|
43
38
|
- lib/mail_extract/version.rb
|
44
39
|
- mail_extract.gemspec
|
40
|
+
- spec/fixtures/reply_with_quotes.txt
|
45
41
|
- spec/fixtures/result_simple.txt
|
46
42
|
- spec/fixtures/result_simple_with_quotes.txt
|
47
43
|
- spec/fixtures/simple.txt
|
@@ -49,39 +45,28 @@ files:
|
|
49
45
|
- spec/line_spec.rb
|
50
46
|
- spec/parser_spec.rb
|
51
47
|
- spec/spec_helper.rb
|
52
|
-
has_rdoc: true
|
53
48
|
homepage: https://github.com/sosedoff/mail_extract
|
54
49
|
licenses: []
|
55
|
-
|
56
50
|
post_install_message:
|
57
51
|
rdoc_options: []
|
58
|
-
|
59
|
-
require_paths:
|
52
|
+
require_paths:
|
60
53
|
- lib
|
61
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
54
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
62
55
|
none: false
|
63
|
-
requirements:
|
64
|
-
- -
|
65
|
-
- !ruby/object:Gem::Version
|
66
|
-
version:
|
67
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
56
|
+
requirements:
|
57
|
+
- - ! '>='
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
version: '0'
|
60
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
68
61
|
none: false
|
69
|
-
requirements:
|
70
|
-
- -
|
71
|
-
- !ruby/object:Gem::Version
|
72
|
-
version:
|
62
|
+
requirements:
|
63
|
+
- - ! '>='
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: '0'
|
73
66
|
requirements: []
|
74
|
-
|
75
67
|
rubyforge_project:
|
76
|
-
rubygems_version: 1.
|
68
|
+
rubygems_version: 1.8.5
|
77
69
|
signing_key:
|
78
70
|
specification_version: 3
|
79
71
|
summary: Extracts email message body
|
80
|
-
test_files:
|
81
|
-
- spec/fixtures/result_simple.txt
|
82
|
-
- spec/fixtures/result_simple_with_quotes.txt
|
83
|
-
- spec/fixtures/simple.txt
|
84
|
-
- spec/fixtures/simple_with_quotes.txt
|
85
|
-
- spec/line_spec.rb
|
86
|
-
- spec/parser_spec.rb
|
87
|
-
- spec/spec_helper.rb
|
72
|
+
test_files: []
|