runger_email_reply_trimmer 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGELOG.md +7 -0
- data/Gemfile +17 -0
- data/Gemfile.lock +72 -0
- data/LICENSE +9 -0
- data/README.md +21 -0
- data/Rakefile +17 -0
- data/bin/release +27 -0
- data/lib/runger_email_reply_trimmer/delimiter_matcher.rb +12 -0
- data/lib/runger_email_reply_trimmer/email_header_matcher.rb +72 -0
- data/lib/runger_email_reply_trimmer/embedded_email_matcher.rb +158 -0
- data/lib/runger_email_reply_trimmer/empty_line_matcher.rb +9 -0
- data/lib/runger_email_reply_trimmer/quote_matcher.rb +9 -0
- data/lib/runger_email_reply_trimmer/signature_matcher.rb +52 -0
- data/lib/runger_email_reply_trimmer/version.rb +5 -0
- data/lib/runger_email_reply_trimmer.rb +226 -0
- data/runger_email_reply_trimmer.gemspec +21 -0
- data/test/before/email_headers_1.txt +1 -0
- data/test/before/email_headers_2.txt +1 -0
- data/test/before/email_headers_3.txt +1 -0
- data/test/before/email_headers_4.txt +1 -0
- data/test/before/embedded_email_10.txt +25 -0
- data/test/before/embedded_email_german_3.txt +1 -0
- data/test/before/embedded_email_spanish_2.txt +1 -0
- data/test/before/forwarded_apple.txt +1 -0
- data/test/before/forwarded_gmail.txt +1 -0
- data/test/before/forwarded_message.txt +0 -0
- data/test/elided/delimiters.txt +10 -0
- data/test/elided/dual_embedded.txt +10 -0
- data/test/elided/email_headers_1.txt +14 -0
- data/test/elided/email_headers_2.txt +9 -0
- data/test/elided/email_headers_3.txt +16 -0
- data/test/elided/email_headers_4.txt +15 -0
- data/test/elided/email_headers_5.txt +23 -0
- data/test/elided/embedded_ception.txt +38 -0
- data/test/elided/embedded_email_1.txt +6 -0
- data/test/elided/embedded_email_10.txt +40 -0
- data/test/elided/embedded_email_11.txt +3 -0
- data/test/elided/embedded_email_12.txt +8 -0
- data/test/elided/embedded_email_13.txt +9 -0
- data/test/elided/embedded_email_14.txt +11 -0
- data/test/elided/embedded_email_15.txt +4 -0
- data/test/elided/embedded_email_16.txt +4 -0
- data/test/elided/embedded_email_17.txt +2 -0
- data/test/elided/embedded_email_18.txt +1 -0
- data/test/elided/embedded_email_19.txt +0 -0
- data/test/elided/embedded_email_2.txt +9 -0
- data/test/elided/embedded_email_3.txt +14 -0
- data/test/elided/embedded_email_4.txt +15 -0
- data/test/elided/embedded_email_5.txt +3 -0
- data/test/elided/embedded_email_6.txt +3 -0
- data/test/elided/embedded_email_7.txt +10 -0
- data/test/elided/embedded_email_8.txt +3 -0
- data/test/elided/embedded_email_9.txt +3 -0
- data/test/elided/embedded_email_chinese.txt +4 -0
- data/test/elided/embedded_email_dutch_1.txt +10 -0
- data/test/elided/embedded_email_dutch_2.txt +59 -0
- data/test/elided/embedded_email_french_1.txt +9 -0
- data/test/elided/embedded_email_french_2.txt +19 -0
- data/test/elided/embedded_email_german_1.txt +22 -0
- data/test/elided/embedded_email_german_2.txt +3 -0
- data/test/elided/embedded_email_german_3.txt +7 -0
- data/test/elided/embedded_email_german_4.txt +15 -0
- data/test/elided/embedded_email_german_5.txt +20 -0
- data/test/elided/embedded_email_german_6.txt +8 -0
- data/test/elided/embedded_email_italian.txt +28 -0
- data/test/elided/embedded_email_norwegian.txt +9 -0
- data/test/elided/embedded_email_polish_1.txt +32 -0
- data/test/elided/embedded_email_polish_2.txt +7 -0
- data/test/elided/embedded_email_portuguese.txt +14 -0
- data/test/elided/embedded_email_quote_text.txt +6 -0
- data/test/elided/embedded_email_russian_1.txt +25 -0
- data/test/elided/embedded_email_russian_2.txt +23 -0
- data/test/elided/embedded_email_spanish_1.txt +32 -0
- data/test/elided/embedded_email_spanish_2.txt +10 -0
- data/test/elided/embedded_email_swedish.txt +8 -0
- data/test/elided/embedded_email_ukrainian.txt +17 -0
- data/test/elided/forwarded_apple.txt +15 -0
- data/test/elided/forwarded_gmail.txt +15 -0
- data/test/elided/forwarded_message.txt +6 -0
- data/test/elided/normalize_line_endings.txt +0 -0
- data/test/elided/quote_and_text.txt +0 -0
- data/test/elided/quote_only.txt +0 -0
- data/test/elided/retains_spaces_and_formatting.txt +0 -0
- data/test/elided/signatures.txt +31 -0
- data/test/elided/spam_1.txt +75 -0
- data/test/elided/spam_2.txt +152 -0
- data/test/elided/strip.txt +0 -0
- data/test/elided/text_only.txt +0 -0
- data/test/elided/usenet.txt +7 -0
- data/test/emails/delimiters.txt +14 -0
- data/test/emails/dual_embedded.txt +13 -0
- data/test/emails/email_headers_1.txt +17 -0
- data/test/emails/email_headers_2.txt +10 -0
- data/test/emails/email_headers_3.txt +18 -0
- data/test/emails/email_headers_4.txt +17 -0
- data/test/emails/email_headers_5.txt +37 -0
- data/test/emails/embedded_ception.txt +47 -0
- data/test/emails/embedded_email_1.txt +8 -0
- data/test/emails/embedded_email_10.txt +42 -0
- data/test/emails/embedded_email_11.txt +5 -0
- data/test/emails/embedded_email_12.txt +18 -0
- data/test/emails/embedded_email_13.txt +14 -0
- data/test/emails/embedded_email_14.txt +16 -0
- data/test/emails/embedded_email_15.txt +9 -0
- data/test/emails/embedded_email_16.txt +16 -0
- data/test/emails/embedded_email_17.txt +38 -0
- data/test/emails/embedded_email_18.txt +7 -0
- data/test/emails/embedded_email_19.txt +13 -0
- data/test/emails/embedded_email_2.txt +16 -0
- data/test/emails/embedded_email_3.txt +24 -0
- data/test/emails/embedded_email_4.txt +19 -0
- data/test/emails/embedded_email_5.txt +5 -0
- data/test/emails/embedded_email_6.txt +11 -0
- data/test/emails/embedded_email_7.txt +20 -0
- data/test/emails/embedded_email_8.txt +5 -0
- data/test/emails/embedded_email_9.txt +5 -0
- data/test/emails/embedded_email_chinese.txt +7 -0
- data/test/emails/embedded_email_dutch_1.txt +13 -0
- data/test/emails/embedded_email_dutch_2.txt +62 -0
- data/test/emails/embedded_email_french_1.txt +12 -0
- data/test/emails/embedded_email_french_2.txt +21 -0
- data/test/emails/embedded_email_german_1.txt +26 -0
- data/test/emails/embedded_email_german_2.txt +6 -0
- data/test/emails/embedded_email_german_3.txt +10 -0
- data/test/emails/embedded_email_german_4.txt +18 -0
- data/test/emails/embedded_email_german_5.txt +23 -0
- data/test/emails/embedded_email_german_6.txt +14 -0
- data/test/emails/embedded_email_italian.txt +31 -0
- data/test/emails/embedded_email_norwegian.txt +11 -0
- data/test/emails/embedded_email_polish_1.txt +34 -0
- data/test/emails/embedded_email_polish_2.txt +11 -0
- data/test/emails/embedded_email_portuguese.txt +18 -0
- data/test/emails/embedded_email_quote_text.txt +10 -0
- data/test/emails/embedded_email_russian_1.txt +27 -0
- data/test/emails/embedded_email_russian_2.txt +26 -0
- data/test/emails/embedded_email_spanish_1.txt +41 -0
- data/test/emails/embedded_email_spanish_2.txt +12 -0
- data/test/emails/embedded_email_swedish.txt +20 -0
- data/test/emails/embedded_email_ukrainian.txt +19 -0
- data/test/emails/forwarded_apple.txt +17 -0
- data/test/emails/forwarded_gmail.txt +17 -0
- data/test/emails/forwarded_message.txt +9 -0
- data/test/emails/normalize_line_endings.txt +4 -0
- data/test/emails/quote_and_text.txt +3 -0
- data/test/emails/quote_only.txt +1 -0
- data/test/emails/retains_spaces_and_formatting.txt +14 -0
- data/test/emails/signatures.txt +33 -0
- data/test/emails/spam_1.txt +75 -0
- data/test/emails/spam_2.txt +174 -0
- data/test/emails/strip.txt +10 -0
- data/test/emails/text_only.txt +1 -0
- data/test/emails/usenet.txt +9 -0
- data/test/embedded/email_headers_1.txt +12 -0
- data/test/embedded/email_headers_2.txt +8 -0
- data/test/embedded/email_headers_3.txt +16 -0
- data/test/embedded/email_headers_4.txt +15 -0
- data/test/embedded/embedded_email_10.txt +15 -0
- data/test/embedded/embedded_email_german_3.txt +6 -0
- data/test/embedded/embedded_email_spanish_2.txt +9 -0
- data/test/embedded/forwarded_apple.txt +13 -0
- data/test/embedded/forwarded_gmail.txt +14 -0
- data/test/embedded/forwarded_message.txt +8 -0
- data/test/matchers/does_not_contain_embedded_email.txt +5 -0
- data/test/test_email_matcher.rb +17 -0
- data/test/test_email_reply_trimmer.rb +87 -0
- data/test/trimmed/delimiters.txt +3 -0
- data/test/trimmed/dual_embedded.txt +1 -0
- data/test/trimmed/email_headers_1.txt +1 -0
- data/test/trimmed/email_headers_2.txt +1 -0
- data/test/trimmed/email_headers_3.txt +1 -0
- data/test/trimmed/email_headers_4.txt +1 -0
- data/test/trimmed/email_headers_5.txt +11 -0
- data/test/trimmed/embedded_ception.txt +4 -0
- data/test/trimmed/embedded_email_1.txt +1 -0
- data/test/trimmed/embedded_email_10.txt +1 -0
- data/test/trimmed/embedded_email_11.txt +1 -0
- data/test/trimmed/embedded_email_12.txt +1 -0
- data/test/trimmed/embedded_email_13.txt +3 -0
- data/test/trimmed/embedded_email_14.txt +3 -0
- data/test/trimmed/embedded_email_15.txt +3 -0
- data/test/trimmed/embedded_email_16.txt +11 -0
- data/test/trimmed/embedded_email_17.txt +35 -0
- data/test/trimmed/embedded_email_18.txt +5 -0
- data/test/trimmed/embedded_email_19.txt +13 -0
- data/test/trimmed/embedded_email_2.txt +3 -0
- data/test/trimmed/embedded_email_3.txt +7 -0
- data/test/trimmed/embedded_email_4.txt +2 -0
- data/test/trimmed/embedded_email_5.txt +1 -0
- data/test/trimmed/embedded_email_6.txt +7 -0
- data/test/trimmed/embedded_email_7.txt +10 -0
- data/test/trimmed/embedded_email_8.txt +1 -0
- data/test/trimmed/embedded_email_9.txt +1 -0
- data/test/trimmed/embedded_email_chinese.txt +2 -0
- data/test/trimmed/embedded_email_dutch_1.txt +1 -0
- data/test/trimmed/embedded_email_dutch_2.txt +2 -0
- data/test/trimmed/embedded_email_french_1.txt +1 -0
- data/test/trimmed/embedded_email_french_2.txt +1 -0
- data/test/trimmed/embedded_email_german_1.txt +1 -0
- data/test/trimmed/embedded_email_german_2.txt +1 -0
- data/test/trimmed/embedded_email_german_3.txt +1 -0
- data/test/trimmed/embedded_email_german_4.txt +1 -0
- data/test/trimmed/embedded_email_german_5.txt +1 -0
- data/test/trimmed/embedded_email_german_6.txt +4 -0
- data/test/trimmed/embedded_email_italian.txt +1 -0
- data/test/trimmed/embedded_email_norwegian.txt +1 -0
- data/test/trimmed/embedded_email_polish_1.txt +1 -0
- data/test/trimmed/embedded_email_polish_2.txt +2 -0
- data/test/trimmed/embedded_email_portuguese.txt +2 -0
- data/test/trimmed/embedded_email_quote_text.txt +2 -0
- data/test/trimmed/embedded_email_russian_1.txt +1 -0
- data/test/trimmed/embedded_email_russian_2.txt +1 -0
- data/test/trimmed/embedded_email_spanish_1.txt +6 -0
- data/test/trimmed/embedded_email_spanish_2.txt +1 -0
- data/test/trimmed/embedded_email_swedish.txt +9 -0
- data/test/trimmed/embedded_email_ukrainian.txt +1 -0
- data/test/trimmed/forwarded_apple.txt +1 -0
- data/test/trimmed/forwarded_gmail.txt +1 -0
- data/test/trimmed/forwarded_message.txt +1 -0
- data/test/trimmed/normalize_line_endings.txt +4 -0
- data/test/trimmed/quote_and_text.txt +3 -0
- data/test/trimmed/quote_only.txt +1 -0
- data/test/trimmed/retains_spaces_and_formatting.txt +14 -0
- data/test/trimmed/signatures.txt +1 -0
- data/test/trimmed/spam_1.txt +0 -0
- data/test/trimmed/spam_2.txt +21 -0
- data/test/trimmed/strip.txt +1 -0
- data/test/trimmed/text_only.txt +1 -0
- data/test/trimmed/usenet.txt +1 -0
- metadata +275 -0
@@ -0,0 +1,75 @@
|
|
1
|
+
> On Thu, Apr 30, 2020 at 10:07 AM, "someone" <someone@example.com> wrote:
|
2
|
+
>
|
3
|
+
>> On Thu, Apr 30, 2020 at 10:07 AM, "someone" <someone@example.com> wrote:
|
4
|
+
>>
|
5
|
+
>>> On Thu, Apr 30, 2020 at 10:07 AM, "someone" <someone@example.com> wrote:
|
6
|
+
>>>
|
7
|
+
>>>> On Thu, Apr 30, 2020 at 10:06 AM, "someone" <someone@example.com> wrote:
|
8
|
+
>>>>
|
9
|
+
>>>>> On Thu, Apr 30, 2020 at 10:06 AM, "someone" <someone@example.com> wrote:
|
10
|
+
>>>>>
|
11
|
+
>>>>>> On Thu, Apr 30, 2020 at 10:06 AM, "someone" <someone@example.com> wrote:
|
12
|
+
>>>>>>
|
13
|
+
>>>>>>> On Thu, Apr 30, 2020 at 10:06 AM, "someone" <someone@example.com> wrote:
|
14
|
+
>>>>>>>
|
15
|
+
>>>>>>>> On Thu, Apr 30, 2020 at 10:06 AM, "someone" <someone@example.com> wrote:
|
16
|
+
>>>>>>>>
|
17
|
+
>>>>>>>>> On Thu, Apr 30, 2020 at 10:06 AM, "someone" <someone@example.com> wrote:
|
18
|
+
>>>>>>>>>
|
19
|
+
>>>>>>>>>> On Thu, Apr 30, 2020 at 10:06 AM, "someone" <someone@example.com> wrote:
|
20
|
+
>>>>>>>>>>
|
21
|
+
>>>>>>>>>>> On Thu, Apr 30, 2020 at 10:06 AM, "someone" <someone@example.com> wrote:
|
22
|
+
>>>>>>>>>>>
|
23
|
+
>>>>>>>>>>>> On Thu, Apr 30, 2020 at 10:06 AM, "someone" <someone@example.com> wrote:
|
24
|
+
>>>>>>>>>>>>
|
25
|
+
>>>>>>>>>>>>> On Thu, Apr 30, 2020 at 10:06 AM, "someone" <someone@example.com> wrote:
|
26
|
+
>>>>>>>>>>>>>
|
27
|
+
>>>>>>>>>>>>>> On Thu, Apr 30, 2020 at 10:06 AM, "someone" <someone@example.com> wrote:
|
28
|
+
>>>>>>>>>>>>>>
|
29
|
+
>>>>>>>>>>>>>>> On Thu, Apr 30, 2020 at 10:06 AM, "someone" <someone@example.com> wrote:
|
30
|
+
>>>>>>>>>>>>>>>
|
31
|
+
>>>>>>>>>>>>>>>> On Thu, Apr 30, 2020 at 10:06 AM, "someone" <someone@example.com> wrote:
|
32
|
+
>>>>>>>>>>>>>>>>
|
33
|
+
>>>>>>>>>>>>>>>>> On Thu, Apr 30, 2020 at 10:06 AM, "someone" <someone@example.com> wrote:
|
34
|
+
>>>>>>>>>>>>>>>>>
|
35
|
+
>>>>>>>>>>>>>>>>>> On Thu, Apr 30, 2020 at 10:06 AM, "someone" <someone@example.com> wrote:
|
36
|
+
>>>>>>>>>>>>>>>>>>
|
37
|
+
>>>>>>>>>>>>>>>>>>> On Thu, Apr 30, 2020 at 10:06 AM, "someone" <someone@example.com> wrote:
|
38
|
+
>>>>>>>>>>>>>>>>>>>
|
39
|
+
>>>>>>>>>>>>>>>>>>>> On Thu, Apr 30, 2020 at 10:06 AM, "someone" <someone@example.com> wrote:
|
40
|
+
>>>>>>>>>>>>>>>>>>>>
|
41
|
+
>>>>>>>>>>>>>>>>>>>>> On Thu, Apr 30, 2020 at 10:06 AM, "someone" <someone@example.com> wrote:
|
42
|
+
>>>>>>>>>>>>>>>>>>>>>
|
43
|
+
>>>>>>>>>>>>>>>>>>>>>> On Thu, Apr 30, 2020 at 10:06 AM, "someone" <someone@example.com> wrote:
|
44
|
+
>>>>>>>>>>>>>>>>>>>>>>
|
45
|
+
>>>>>>>>>>>>>>>>>>>>>>> On Thu, Apr 30, 2020 at 10:06 AM, "someone" <someone@example.com> wrote:
|
46
|
+
>>>>>>>>>>>>>>>>>>>>>>>
|
47
|
+
>>>>>>>>>>>>>>>>>>>>>>>> On Thu, Apr 30, 2020 at 10:06 AM, "someone" <someone@example.com> wrote:
|
48
|
+
>>>>>>>>>>>>>>>>>>>>>>>>
|
49
|
+
>>>>>>>>>>>>>>>>>>>>>>>>> On Thu, Apr 30, 2020 at 10:06 AM, "someone" <someone@example.com> wrote:
|
50
|
+
>>>>>>>>>>>>>>>>>>>>>>>>>
|
51
|
+
>>>>>>>>>>>>>>>>>>>>>>>>>> On Thu, Apr 30, 2020 at 10:06 AM, "someone" <someone@example.com> wrote:
|
52
|
+
>>>>>>>>>>>>>>>>>>>>>>>>>>
|
53
|
+
>>>>>>>>>>>>>>>>>>>>>>>>>>> On Thu, Apr 30, 2020 at 10:06 AM, "someone" <someone@example.com> wrote:
|
54
|
+
>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
55
|
+
>>>>>>>>>>>>>>>>>>>>>>>>>>>> On Thu, Apr 30, 2020 at 10:06 AM, "someone" <someone@example.com> wrote:
|
56
|
+
>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
57
|
+
>>>>>>>>>>>>>>>>>>>>>>>>>>>>> On Thu, Apr 30, 2020 at 10:06 AM, "someone" <someone@example.com> wrote:
|
58
|
+
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
59
|
+
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> On Thu, Apr 30, 2020 at 10:06 AM, "someone" <someone@example.com> wrote:
|
60
|
+
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
61
|
+
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> On Thu, Apr 30, 2020 at 10:06 AM, "someone" <someone@example.com> wrote:
|
62
|
+
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
63
|
+
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> On Thu, Apr 30, 2020 at 10:06 AM, "someone" <someone@example.com> wrote:
|
64
|
+
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
65
|
+
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> On Thu, Apr 30, 2020 at 10:06 AM, "someone" <someone@example.com> wrote:
|
66
|
+
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
67
|
+
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> On Thu, Apr 30, 2020 at 10:06 AM, "someone" <someone@example.com> wrote:
|
68
|
+
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
69
|
+
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> On Thu, Apr 30, 2020 at 10:06 AM, "someone" <someone@example.com> wrote:
|
70
|
+
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
71
|
+
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> On Thu, Apr 30, 2020 at 10:06 AM, "someone" <someone@example.com> wrote:
|
72
|
+
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
73
|
+
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> On Thu, Apr 30, 2020 at 10:06 AM, "someone" <someone@example.com> wrote:
|
74
|
+
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
75
|
+
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> On Thu, Apr 30, 2020 at 10:06 AM, "someone" <someone@example.com> wrote:
|
@@ -0,0 +1,174 @@
|
|
1
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec sit amet dictum
|
2
|
+
lectus, at efficitur neque. Class aptent taciti sociosqu ad litora torquent per
|
3
|
+
conubia nostra, per inceptos himenaeos. Aenean dictum pulvinar tortor non
|
4
|
+
ultricies. Maecenas cursus lobortis dolor quis feugiat. Integer efficitur,
|
5
|
+
mauris sit amet lobortis consectetur, urna augue feugiat mi, et tempor dui
|
6
|
+
sapien vehicula dolor. Aenean sit amet ultrices tortor. Praesent vel porttitor
|
7
|
+
risus, eu fringilla nibh. Phasellus sollicitudin elit id tortor dapibus, at
|
8
|
+
euismod odio sodales. Ut est ex, pharetra malesuada dui maximus, ullamcorper
|
9
|
+
fringilla turpis. Nullam gravida, elit blandit commodo blandit, velit sem
|
10
|
+
ornare odio, eu ultricies arcu ex sit amet libero. Vestibulum eu fringilla
|
11
|
+
ante, nec blandit nunc.
|
12
|
+
|
13
|
+
Nullam nec viverra ipsum. Nullam semper eu urna id facilisis. Nam blandit
|
14
|
+
dictum eros, sit amet auctor dui fermentum a. Quisque finibus magna nisi, ac
|
15
|
+
hendrerit purus lacinia ut. Donec maximus, enim id tincidunt vulputate, libero
|
16
|
+
ex tempor elit, vitae sagittis libero leo sed leo. Quisque non gravida ex,
|
17
|
+
efficitur interdum neque. Interdum et malesuada fames ac ante ipsum primis in
|
18
|
+
faucibus. Phasellus rhoncus nisi vitae turpis bibendum luctus. Duis placerat
|
19
|
+
aliquam lectus, pellentesque commodo dolor hendrerit quis. Suspendisse ipsum
|
20
|
+
sapien, interdum ac felis ac, mattis varius neque. Maecenas nec risus sit amet
|
21
|
+
ex aliquam vestibulum. Maecenas a turpis et turpis volutpat congue.
|
22
|
+
|
23
|
+
> On Thu, Apr 30, 2020 at 10:07 AM, "someone" <someone@example.com> wrote:
|
24
|
+
>
|
25
|
+
>> Hello world!
|
26
|
+
>>
|
27
|
+
>> On Thu, Apr 30, 2020 at 10:07 AM, "someone" <someone@example.com> wrote:
|
28
|
+
>>
|
29
|
+
>>> Hello world!
|
30
|
+
>>>
|
31
|
+
>>> On Thu, Apr 30, 2020 at 10:07 AM, "someone" <someone@example.com> wrote:
|
32
|
+
>>>
|
33
|
+
>>>> Hello world!
|
34
|
+
>>>>
|
35
|
+
>>>> On Thu, Apr 30, 2020 at 10:06 AM, "someone" <someone@example.com> wrote:
|
36
|
+
>>>>
|
37
|
+
>>>>> Hello world!
|
38
|
+
>>>>>
|
39
|
+
>>>>> On Thu, Apr 30, 2020 at 10:06 AM, "someone" <someone@example.com> wrote:
|
40
|
+
>>>>>
|
41
|
+
>>>>>> Hello world!
|
42
|
+
>>>>>>
|
43
|
+
>>>>>> On Thu, Apr 30, 2020 at 10:06 AM, "someone" <someone@example.com> wrote:
|
44
|
+
>>>>>>
|
45
|
+
>>>>>>> Hello world!
|
46
|
+
>>>>>>>
|
47
|
+
>>>>>>> On Thu, Apr 30, 2020 at 10:06 AM, "someone" <someone@example.com> wrote:
|
48
|
+
>>>>>>>
|
49
|
+
>>>>>>>> Hello world!
|
50
|
+
>>>>>>>>
|
51
|
+
>>>>>>>> On Thu, Apr 30, 2020 at 10:06 AM, "someone" <someone@example.com> wrote:
|
52
|
+
>>>>>>>>
|
53
|
+
>>>>>>>>> Hello world!
|
54
|
+
>>>>>>>>>
|
55
|
+
>>>>>>>>> On Thu, Apr 30, 2020 at 10:06 AM, "someone" <someone@example.com> wrote:
|
56
|
+
>>>>>>>>>
|
57
|
+
>>>>>>>>>> Hello world!
|
58
|
+
>>>>>>>>>>
|
59
|
+
>>>>>>>>>> On Thu, Apr 30, 2020 at 10:06 AM, "someone" <someone@example.com> wrote:
|
60
|
+
>>>>>>>>>>
|
61
|
+
>>>>>>>>>>> Hello world!
|
62
|
+
>>>>>>>>>>>
|
63
|
+
>>>>>>>>>>> On Thu, Apr 30, 2020 at 10:06 AM, "someone" <someone@example.com> wrote:
|
64
|
+
>>>>>>>>>>>
|
65
|
+
>>>>>>>>>>>> Hello world!
|
66
|
+
>>>>>>>>>>>>
|
67
|
+
>>>>>>>>>>>> On Thu, Apr 30, 2020 at 10:06 AM, "someone" <someone@example.com> wrote:
|
68
|
+
>>>>>>>>>>>>
|
69
|
+
>>>>>>>>>>>>> Hello world!
|
70
|
+
>>>>>>>>>>>>>
|
71
|
+
>>>>>>>>>>>>> On Thu, Apr 30, 2020 at 10:06 AM, "someone" <someone@example.com> wrote:
|
72
|
+
>>>>>>>>>>>>>
|
73
|
+
>>>>>>>>>>>>>> Hello world!
|
74
|
+
>>>>>>>>>>>>>>
|
75
|
+
>>>>>>>>>>>>>> On Thu, Apr 30, 2020 at 10:06 AM, "someone" <someone@example.com> wrote:
|
76
|
+
>>>>>>>>>>>>>>
|
77
|
+
>>>>>>>>>>>>>>> Hello world!
|
78
|
+
>>>>>>>>>>>>>>>
|
79
|
+
>>>>>>>>>>>>>>> On Thu, Apr 30, 2020 at 10:06 AM, "someone" <someone@example.com> wrote:
|
80
|
+
>>>>>>>>>>>>>>>
|
81
|
+
>>>>>>>>>>>>>>>> Hello world!
|
82
|
+
>>>>>>>>>>>>>>>>
|
83
|
+
>>>>>>>>>>>>>>>> On Thu, Apr 30, 2020 at 10:06 AM, "someone" <someone@example.com> wrote:
|
84
|
+
>>>>>>>>>>>>>>>>
|
85
|
+
>>>>>>>>>>>>>>>>> Hello world!
|
86
|
+
>>>>>>>>>>>>>>>>>
|
87
|
+
>>>>>>>>>>>>>>>>> On Thu, Apr 30, 2020 at 10:06 AM, "someone" <someone@example.com> wrote:
|
88
|
+
>>>>>>>>>>>>>>>>>
|
89
|
+
>>>>>>>>>>>>>>>>>> Hello world!
|
90
|
+
>>>>>>>>>>>>>>>>>>
|
91
|
+
>>>>>>>>>>>>>>>>>> On Thu, Apr 30, 2020 at 10:06 AM, "someone" <someone@example.com> wrote:
|
92
|
+
>>>>>>>>>>>>>>>>>>
|
93
|
+
>>>>>>>>>>>>>>>>>>> Hello world!
|
94
|
+
>>>>>>>>>>>>>>>>>>>
|
95
|
+
>>>>>>>>>>>>>>>>>>> On Thu, Apr 30, 2020 at 10:06 AM, "someone" <someone@example.com> wrote:
|
96
|
+
>>>>>>>>>>>>>>>>>>>
|
97
|
+
>>>>>>>>>>>>>>>>>>>> Hello world!
|
98
|
+
>>>>>>>>>>>>>>>>>>>>
|
99
|
+
>>>>>>>>>>>>>>>>>>>> On Thu, Apr 30, 2020 at 10:06 AM, "someone" <someone@example.com> wrote:
|
100
|
+
>>>>>>>>>>>>>>>>>>>>
|
101
|
+
>>>>>>>>>>>>>>>>>>>>> Hello world!
|
102
|
+
>>>>>>>>>>>>>>>>>>>>>
|
103
|
+
>>>>>>>>>>>>>>>>>>>>> On Thu, Apr 30, 2020 at 10:06 AM, "someone" <someone@example.com> wrote:
|
104
|
+
>>>>>>>>>>>>>>>>>>>>>
|
105
|
+
>>>>>>>>>>>>>>>>>>>>>> Hello world!
|
106
|
+
>>>>>>>>>>>>>>>>>>>>>>
|
107
|
+
>>>>>>>>>>>>>>>>>>>>>> On Thu, Apr 30, 2020 at 10:06 AM, "someone" <someone@example.com> wrote:
|
108
|
+
>>>>>>>>>>>>>>>>>>>>>>
|
109
|
+
>>>>>>>>>>>>>>>>>>>>>>> Hello world!
|
110
|
+
>>>>>>>>>>>>>>>>>>>>>>>
|
111
|
+
>>>>>>>>>>>>>>>>>>>>>>> On Thu, Apr 30, 2020 at 10:06 AM, "someone" <someone@example.com> wrote:
|
112
|
+
>>>>>>>>>>>>>>>>>>>>>>>
|
113
|
+
>>>>>>>>>>>>>>>>>>>>>>>> Hello world!
|
114
|
+
>>>>>>>>>>>>>>>>>>>>>>>>
|
115
|
+
>>>>>>>>>>>>>>>>>>>>>>>> On Thu, Apr 30, 2020 at 10:06 AM, "someone" <someone@example.com> wrote:
|
116
|
+
>>>>>>>>>>>>>>>>>>>>>>>>
|
117
|
+
>>>>>>>>>>>>>>>>>>>>>>>>> Hello world!
|
118
|
+
>>>>>>>>>>>>>>>>>>>>>>>>>
|
119
|
+
>>>>>>>>>>>>>>>>>>>>>>>>> On Thu, Apr 30, 2020 at 10:06 AM, "someone" <someone@example.com> wrote:
|
120
|
+
>>>>>>>>>>>>>>>>>>>>>>>>>
|
121
|
+
>>>>>>>>>>>>>>>>>>>>>>>>>> Hello world!
|
122
|
+
>>>>>>>>>>>>>>>>>>>>>>>>>>
|
123
|
+
>>>>>>>>>>>>>>>>>>>>>>>>>> On Thu, Apr 30, 2020 at 10:06 AM, "someone" <someone@example.com> wrote:
|
124
|
+
>>>>>>>>>>>>>>>>>>>>>>>>>>
|
125
|
+
>>>>>>>>>>>>>>>>>>>>>>>>>>> Hello world!
|
126
|
+
>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
127
|
+
>>>>>>>>>>>>>>>>>>>>>>>>>>> On Thu, Apr 30, 2020 at 10:06 AM, "someone" <someone@example.com> wrote:
|
128
|
+
>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
129
|
+
>>>>>>>>>>>>>>>>>>>>>>>>>>>> Hello world!
|
130
|
+
>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
131
|
+
>>>>>>>>>>>>>>>>>>>>>>>>>>>> On Thu, Apr 30, 2020 at 10:06 AM, "someone" <someone@example.com> wrote:
|
132
|
+
>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
133
|
+
>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Hello world!
|
134
|
+
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
135
|
+
>>>>>>>>>>>>>>>>>>>>>>>>>>>>> On Thu, Apr 30, 2020 at 10:06 AM, "someone" <someone@example.com> wrote:
|
136
|
+
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
137
|
+
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Hello world!
|
138
|
+
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
139
|
+
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> On Thu, Apr 30, 2020 at 10:06 AM, "someone" <someone@example.com> wrote:
|
140
|
+
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
141
|
+
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Hello world!
|
142
|
+
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
143
|
+
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> On Thu, Apr 30, 2020 at 10:06 AM, "someone" <someone@example.com> wrote:
|
144
|
+
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
145
|
+
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Hello world!
|
146
|
+
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
147
|
+
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> On Thu, Apr 30, 2020 at 10:06 AM, "someone" <someone@example.com> wrote:
|
148
|
+
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
149
|
+
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Hello world!
|
150
|
+
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
151
|
+
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> On Thu, Apr 30, 2020 at 10:06 AM, "someone" <someone@example.com> wrote:
|
152
|
+
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
153
|
+
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Hello world!
|
154
|
+
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
155
|
+
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> On Thu, Apr 30, 2020 at 10:06 AM, "someone" <someone@example.com> wrote:
|
156
|
+
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
157
|
+
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Hello world!
|
158
|
+
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
159
|
+
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> On Thu, Apr 30, 2020 at 10:06 AM, "someone" <someone@example.com> wrote:
|
160
|
+
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
161
|
+
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Hello world!
|
162
|
+
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
163
|
+
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> On Thu, Apr 30, 2020 at 10:06 AM, "someone" <someone@example.com> wrote:
|
164
|
+
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
165
|
+
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Hello world!
|
166
|
+
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
167
|
+
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> On Thu, Apr 30, 2020 at 10:06 AM, "someone" <someone@example.com> wrote:
|
168
|
+
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
169
|
+
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Hello world!
|
170
|
+
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
171
|
+
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> On Thu, Apr 30, 2020 at 10:06 AM, "someone" <someone@example.com> wrote:
|
172
|
+
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
173
|
+
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Hello world!
|
174
|
+
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
@@ -0,0 +1 @@
|
|
1
|
+
Email with only text.
|
@@ -0,0 +1,16 @@
|
|
1
|
+
From: Some One <discuss@foo.bar<mailto:discuss@foo.bar>>
|
2
|
+
Reply-To: "For.bar" <reply+275e18486b01289e3250bebe85ef6496@members.foo.bar<mailto:reply+275e18486b01289e3250bebe85ef6496@members.foo.bar>>
|
3
|
+
Date: Monday, February 8, 2016 11:44 AM
|
4
|
+
To: Discourse <discourse@discourse.org<mailto:discourse@discourse.org>>
|
5
|
+
Subject: VIS
|
6
|
+
|
7
|
+
|
8
|
+
Here's an email with some very important stuff.
|
9
|
+
|
10
|
+
|
11
|
+
________________________________
|
12
|
+
Reply here<http://foo.bar> or hit reply from your inbox to help members by sharing your ideas.
|
13
|
+
Mute this topic<http://42.wat> to stop getting updates, we'll send you the next one.
|
14
|
+
|
15
|
+
|
16
|
+
DO NOT FORWARD THIS EMAIL!
|
@@ -0,0 +1,15 @@
|
|
1
|
+
Da: Sally54721
|
2
|
+
Risposta: Testy McTesterson / Test
|
3
|
+
Data: giovedì 8 ottobre 2015 15:26
|
4
|
+
A: Testy McTesterson
|
5
|
+
Oggetto: Test | Issue (#3)
|
6
|
+
|
7
|
+
[@example](http://example.com/u/example)
|
8
|
+
|
9
|
+
—
|
10
|
+
Reply to this email directly or [view it on GitLab](http://git.example.com/example/Test/issues/3). {"@context":"[http://schema.org","@type":"EmailMessage","action":{"@type":"ViewAction","name":"View](http://schema.org%22,%22@type%22:%22EmailMessage%22,%22action%22:%7B%22@type%22:%22ViewAction%22,%22name%22:%22View) Issue","url":"[http://git.example.com/example/Test/issues/3"}](http://git.example.com/example/Test/issues/3%22%7D)} You're receiving this notification because you are a member of the Testy McTesterson / Test project team.
|
11
|
+
|
12
|
+
--
|
13
|
+
Questo messaggio e' stato analizzato con Libra ESVA ed e' risultato non infetto.
|
14
|
+
[Clicca qui per segnalarlo come spam.](http://esva.example.com/cgi-bin/learn-msg.cgi?id=1234567890.ABCDEF)
|
15
|
+
[Clicca qui per metterlo in blacklist](http://esva.example.com/cgi-bin/learn-msg.cgi?blacklist=1&id=1234567890.ABCDEF)
|
@@ -0,0 +1,15 @@
|
|
1
|
+
From: Arpit Jalan <arpit.jalan@discourse.org<mailto:arpit.jalan@discourse.org>>
|
2
|
+
Sent: Thursday, February 4, 2016 10:05 AM
|
3
|
+
Subject: Meta Discourse update
|
4
|
+
To: Some One <foo@bar.com<mailto:foo@bar.com>>, Discourse Team <team@discourse.org<mailto:team@discourse.org>>
|
5
|
+
|
6
|
+
|
7
|
+
|
8
|
+
Hi Some One,
|
9
|
+
|
10
|
+
Time to update meta to the latest Discourse version!
|
11
|
+
|
12
|
+
Do you want me to take care of it?
|
13
|
+
|
14
|
+
Regards,
|
15
|
+
Arpit
|
@@ -0,0 +1,9 @@
|
|
1
|
+
De: "Miguel" <foo@bar.es>
|
2
|
+
Enviado: =E2=80=8E16/=E2=80=8E02/=E2=80=8E2016 14:53
|
3
|
+
Para: "discourse" <discourse@discourse.org>
|
4
|
+
Asunto: [MP]Parser del email
|
5
|
+
|
6
|
+
Visita el tema o responde a este email para publicar.
|
7
|
+
Para no recibir m=C3=A1s notificaciones de este tema en particular, haz cli=
|
8
|
+
c aqu=C3=AD. Para darte de baja de estos emails, cambia tus preferencias
|
9
|
+
=
|
@@ -0,0 +1,13 @@
|
|
1
|
+
From: Foo Discourse <foo@discourse.org>
|
2
|
+
Subject: This email is going to be forwarded
|
3
|
+
Date: 01 January 2019 at 12:00:00 EET
|
4
|
+
To: bar@discourse.org
|
5
|
+
|
6
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi auctor
|
7
|
+
lacus in metus vehicula, non dictum mi consequat. Nunc eget quam sit
|
8
|
+
amet dolor scelerisque cursus. Etiam laoreet lectus a rutrum
|
9
|
+
sollicitudin. Nullam sit amet lorem id ante lobortis fringilla. Duis
|
10
|
+
dictum tempus sem et ultrices. Sed ac lectus ante. Vivamus interdum,
|
11
|
+
risus non tincidunt accumsan, purus mi accumsan dolor, vitae euismod
|
12
|
+
turpis orci ut est. Integer ut ante eu velit dignissim ullamcorper non
|
13
|
+
id nibh. Nulla auctor magna erat, et posuere sapien gravida convallis.
|
@@ -0,0 +1,14 @@
|
|
1
|
+
From: Foo Discourse <foo@discourse.org>
|
2
|
+
Date: Tue, Jan 01, 2019 at 12:00 PM
|
3
|
+
Subject: This email is going to be forwarded
|
4
|
+
To: <bar@discourse.org>
|
5
|
+
|
6
|
+
|
7
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi auctor
|
8
|
+
lacus in metus vehicula, non dictum mi consequat. Nunc eget quam sit
|
9
|
+
amet dolor scelerisque cursus. Etiam laoreet lectus a rutrum
|
10
|
+
sollicitudin. Nullam sit amet lorem id ante lobortis fringilla. Duis
|
11
|
+
dictum tempus sem et ultrices. Sed ac lectus ante. Vivamus interdum,
|
12
|
+
risus non tincidunt accumsan, purus mi accumsan dolor, vitae euismod
|
13
|
+
turpis orci ut est. Integer ut ante eu velit dignissim ullamcorper non
|
14
|
+
id nibh. Nulla auctor magna erat, et posuere sapien gravida convallis.
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'minitest/autorun'
|
4
|
+
require 'runger_email_reply_trimmer'
|
5
|
+
require 'timeout'
|
6
|
+
|
7
|
+
class TestRungerEmailReplyTrimmer < Minitest::Test
|
8
|
+
def test_does_not_hang_when_no_embedded_email_is_found
|
9
|
+
Timeout.timeout(5) do
|
10
|
+
EmbeddedEmailMatcher.match?(example('does_not_contain_embedded_email.txt'))
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
def example(filename)
|
15
|
+
File.read("test/matchers/#{filename}").strip
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,87 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'minitest/autorun'
|
4
|
+
require 'runger_email_reply_trimmer'
|
5
|
+
|
6
|
+
class TestRungerEmailReplyTrimmer < Minitest::Test
|
7
|
+
EMAILS = Dir['test/emails/*.txt'].map { |path| File.basename(path) }
|
8
|
+
TRIMMED = Dir['test/trimmed/*.txt'].map { |path| File.basename(path) }
|
9
|
+
ELIDED = Dir['test/elided/*.txt'].map { |path| File.basename(path) }
|
10
|
+
|
11
|
+
EMBEDDED_EMAILS = %w[
|
12
|
+
email_headers_1
|
13
|
+
email_headers_2
|
14
|
+
email_headers_3
|
15
|
+
email_headers_4
|
16
|
+
embedded_email_10
|
17
|
+
embedded_email_german_3
|
18
|
+
embedded_email_spanish_2
|
19
|
+
forwarded_message
|
20
|
+
forwarded_gmail
|
21
|
+
forwarded_apple
|
22
|
+
].freeze
|
23
|
+
def test_all_emails_have_a_matching_reply
|
24
|
+
assert_equal(EMAILS, TRIMMED, 'Files in /emails and /trimmed folders should match 1-to-1.')
|
25
|
+
end
|
26
|
+
|
27
|
+
def test_all_emails_have_a_matching_elided
|
28
|
+
assert_equal(EMAILS, ELIDED, 'Files in /emails and /elided folders should match 1-to-1.')
|
29
|
+
end
|
30
|
+
|
31
|
+
def test_normalize_line_endings_email_has_windows_line_endings
|
32
|
+
assert_match(/\r\n/, File.read('test/emails/normalize_line_endings.txt'))
|
33
|
+
end
|
34
|
+
|
35
|
+
def test_is_reply_at_end?
|
36
|
+
Timeout.timeout(1) { assert_nil(RungerEmailReplyTrimmer.send(:is_reply_at_end?, 'bq' * 100)) }
|
37
|
+
end
|
38
|
+
|
39
|
+
EMAILS.each do |filename|
|
40
|
+
name = File.basename(filename, '.txt')
|
41
|
+
define_method("test_#{name}") do
|
42
|
+
assert_equal(trimmed(filename), trim(filename), "[TRIMMED] EMAIL: #{filename}")
|
43
|
+
assert_equal(elided(filename), elide(filename), "[ELIDED] EMAIL: #{filename}")
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
EMBEDDED_EMAILS.each do |name|
|
48
|
+
filename = "#{name}.txt"
|
49
|
+
define_method("test_embedded_extraction_for_#{name}") do
|
50
|
+
e, b = extract_embedded_email(filename)
|
51
|
+
assert_equal(e, embedded(filename), "[EMBEDDED] EMAIL: #{filename}")
|
52
|
+
assert_equal(b, before(filename), "[BEFORE] EMAIL: #{filename}")
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
def trim(filename)
|
57
|
+
RungerEmailReplyTrimmer.trim(email(filename))
|
58
|
+
end
|
59
|
+
|
60
|
+
def elide(filename)
|
61
|
+
RungerEmailReplyTrimmer.trim(email(filename), true)[1]
|
62
|
+
end
|
63
|
+
|
64
|
+
def extract_embedded_email(filename)
|
65
|
+
RungerEmailReplyTrimmer.extract_embedded_email(email(filename))
|
66
|
+
end
|
67
|
+
|
68
|
+
def email(filename)
|
69
|
+
File.read("test/emails/#{filename}").strip
|
70
|
+
end
|
71
|
+
|
72
|
+
def trimmed(filename)
|
73
|
+
File.read("test/trimmed/#{filename}").strip
|
74
|
+
end
|
75
|
+
|
76
|
+
def elided(filename)
|
77
|
+
File.read("test/elided/#{filename}").strip
|
78
|
+
end
|
79
|
+
|
80
|
+
def embedded(filename)
|
81
|
+
File.read("test/embedded/#{filename}").strip
|
82
|
+
end
|
83
|
+
|
84
|
+
def before(filename)
|
85
|
+
File.read("test/before/#{filename}").strip
|
86
|
+
end
|
87
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
This is the 3rd email.
|
@@ -0,0 +1 @@
|
|
1
|
+
This is a reply from Outlook!
|
@@ -0,0 +1 @@
|
|
1
|
+
This is a reply from Outlook!
|
@@ -0,0 +1 @@
|
|
1
|
+
This is the actual reply.
|
@@ -0,0 +1 @@
|
|
1
|
+
test
|
@@ -0,0 +1,11 @@
|
|
1
|
+
Hi Erlend,
|
2
|
+
|
3
|
+
I don’t know what a “legally recognised educational institution” means for you.
|
4
|
+
|
5
|
+
We’re based in Sweden and we provide education to our people across the globe.
|
6
|
+
|
7
|
+
We want to try Discourse in small scale first to see it will add value to our communities.
|
8
|
+
|
9
|
+
Best regards,
|
10
|
+
|
11
|
+
//Jef
|
@@ -0,0 +1 @@
|
|
1
|
+
This is before the embedded email.
|
@@ -0,0 +1 @@
|
|
1
|
+
Thank you.
|
@@ -0,0 +1 @@
|
|
1
|
+
Before
|
@@ -0,0 +1 @@
|
|
1
|
+
One 1
|
@@ -0,0 +1,11 @@
|
|
1
|
+
> From: "Albert Wagner" <alwagner@tcac.net>
|
2
|
+
>
|
3
|
+
> > Some guy at ibraheem@localhost(?) needs to be unsubscribed. I
|
4
|
+
> > keep getting bounces from his ISP everytime I post. Surely,
|
5
|
+
> > everyone else is getting the same?
|
6
|
+
>
|
7
|
+
> Surely it doesn't need to be said anymore, but I *still* am.
|
8
|
+
> What's happening with this?
|
9
|
+
|
10
|
+
Yep, me too, although I bet due to RubyConf/OOPSLA, it may be a little
|
11
|
+
longer yet...
|