email_reply_trimmer 0.0.6 → 0.0.7
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3580bb67f3fef9014b7efecbfe07a87b7f17eb5d
|
4
|
+
data.tar.gz: d2d2800bc7a41ba50a81cb5674d11b0af82d9e95
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0fffbfcca55fb58a800ee29414bd154fb360bead10ee89209c843a6ae9ba7a5a9160d7c24d9914a24b061c51f6ab48cd3ae6ad9716258ad405df2590747e170e
|
7
|
+
data.tar.gz: ec708ed09eaba586fe72bb014551d05038f34d5c1d0109fc5b9b499a7e72f4507800283dadf5aa7c476621aa56f3b5b6eb7cc630dcea1f6e4b3e504a8dc72c9d
|
@@ -60,7 +60,7 @@ class EmbeddedEmailMatcher
|
|
60
60
|
# 2013/10/2 camilohollanda <info@discourse.org>
|
61
61
|
# вт, 5 янв. 2016 г. в 23:39, Erlend Sogge Heggen <info@discourse.org>:
|
62
62
|
# ср, 1 апр. 2015, 18:29, Denis Didkovsky <info@discourse.org>:
|
63
|
-
DATE_SOMEONE_EMAIL_REGEX = /^[[:space:]]*.*\d
|
63
|
+
DATE_SOMEONE_EMAIL_REGEX = /^[[:space:]]*.*\d{4}.+<[^@<>]+@[^@<>.]+\.[^@<>]+>:?$/
|
64
64
|
|
65
65
|
# codinghorror via Discourse Meta wrote:
|
66
66
|
# codinghorror via Discourse Meta <info@discourse.org> schrieb:
|
data/lib/email_reply_trimmer.rb
CHANGED
@@ -6,7 +6,7 @@ require_relative "email_reply_trimmer/email_header_matcher"
|
|
6
6
|
require_relative "email_reply_trimmer/quote_matcher"
|
7
7
|
|
8
8
|
class EmailReplyTrimmer
|
9
|
-
VERSION = "0.0.
|
9
|
+
VERSION = "0.0.7"
|
10
10
|
|
11
11
|
DELIMITER = "d"
|
12
12
|
EMBEDDED = "b"
|
@@ -75,9 +75,9 @@ class EmailReplyTrimmer
|
|
75
75
|
end
|
76
76
|
|
77
77
|
# fix email headers when they span over multiple lines
|
78
|
-
if pattern =~ /
|
79
|
-
index = pattern =~ /
|
80
|
-
size = pattern[/
|
78
|
+
if pattern =~ /h+[hte]+h+e/
|
79
|
+
index = pattern =~ /h+[hte]+h+e/
|
80
|
+
size = pattern[/h+[hte]+h+e/].size
|
81
81
|
size.times.each { |s| pattern[index + s] = EMAIL_HEADER }
|
82
82
|
end
|
83
83
|
|
@@ -0,0 +1,18 @@
|
|
1
|
+
This is the actual reply.
|
2
|
+
|
3
|
+
From: Some One <discuss@foo.bar<mailto:discuss@foo.bar>>
|
4
|
+
Reply-To: "For.bar" <reply+275e18486b01289e3250bebe85ef6496@members.foo.bar<mailto:reply+275e18486b01289e3250bebe85ef6496@members.foo.bar>>
|
5
|
+
Date: Monday, February 8, 2016 11:44 AM
|
6
|
+
To: Discourse <discourse@discourse.org<mailto:discourse@discourse.org>>
|
7
|
+
Subject: VIS
|
8
|
+
|
9
|
+
|
10
|
+
Here's an email with some very important stuff.
|
11
|
+
|
12
|
+
|
13
|
+
________________________________
|
14
|
+
Reply here<http://foo.bar> or hit reply from your inbox to help members by sharing your ideas.
|
15
|
+
Mute this topic<http://42.wat> to stop getting updates, we'll send you the next one.
|
16
|
+
|
17
|
+
|
18
|
+
DO NOT FORWARD THIS EMAIL!
|
@@ -0,0 +1 @@
|
|
1
|
+
This is the actual reply.
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: email_reply_trimmer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Régis Hanol
|
@@ -33,6 +33,7 @@ files:
|
|
33
33
|
- test/emails/dual_embedded.txt
|
34
34
|
- test/emails/email_headers_1.txt
|
35
35
|
- test/emails/email_headers_2.txt
|
36
|
+
- test/emails/email_headers_3.txt
|
36
37
|
- test/emails/embedded_ception.txt
|
37
38
|
- test/emails/embedded_email_1.txt
|
38
39
|
- test/emails/embedded_email_10.txt
|
@@ -66,6 +67,7 @@ files:
|
|
66
67
|
- test/replies/dual_embedded.txt
|
67
68
|
- test/replies/email_headers_1.txt
|
68
69
|
- test/replies/email_headers_2.txt
|
70
|
+
- test/replies/email_headers_3.txt
|
69
71
|
- test/replies/embedded_ception.txt
|
70
72
|
- test/replies/embedded_email_1.txt
|
71
73
|
- test/replies/embedded_email_10.txt
|