email_reply_trimmer 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/email_reply_trimmer/delimiter_matcher.rb +1 -1
- data/lib/email_reply_trimmer.rb +8 -1
- data/test/elided/{embedded_email_french.txt → embedded_email_french_1.txt} +0 -0
- data/test/elided/embedded_email_french_2.txt +19 -0
- data/test/emails/{embedded_email_french.txt → embedded_email_french_1.txt} +0 -0
- data/test/emails/embedded_email_french_2.txt +21 -0
- data/test/trimmed/{embedded_email_french.txt → embedded_email_french_1.txt} +0 -0
- data/test/trimmed/embedded_email_french_2.txt +1 -0
- metadata +8 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c6eabb8ce3f3327f3abe63f3ee2fe147fb161d96
|
4
|
+
data.tar.gz: 7a07c2267ef47f4607a2ae2f05feac8c0a2584c1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dba90e1fdc0b0a4f7032f9c2d1e9aabf575a390ee4cf39618037b9a820de8d7abad6338623b203211ef349dc3568b2e55440721dc89fa8ac144eda878cf0e463
|
7
|
+
data.tar.gz: 19be9d9b0496d31e81f7f7adb296d273aeea84130a8243d669857de751748a4e923584a14d4c8f0a90f338428e7dd219fa4212fddce38575b44ec58a598c5455
|
@@ -1,7 +1,7 @@
|
|
1
1
|
class DelimiterMatcher
|
2
2
|
|
3
3
|
DELIMITER_CHARACTERS ||= "-_,=+~#*ᐧ"
|
4
|
-
DELIMITER_REGEX ||= /^[[:blank:]
|
4
|
+
DELIMITER_REGEX ||= /^[[:blank:]]*[#{Regexp.escape(DELIMITER_CHARACTERS)}]+[[:blank:]]*$/
|
5
5
|
|
6
6
|
def self.match?(line)
|
7
7
|
line =~ DELIMITER_REGEX
|
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.1.
|
9
|
+
VERSION = "0.1.6"
|
10
10
|
|
11
11
|
DELIMITER = "d"
|
12
12
|
EMBEDDED = "b"
|
@@ -58,6 +58,13 @@ class EmailReplyTrimmer
|
|
58
58
|
lines.slice!(index)
|
59
59
|
end
|
60
60
|
|
61
|
+
# when the reply is at the end of the email
|
62
|
+
if pattern =~ /^b+q+[eq]*t[te]*$/
|
63
|
+
index = pattern =~ /t/
|
64
|
+
pattern = ""
|
65
|
+
lines = lines[index..-1]
|
66
|
+
end
|
67
|
+
|
61
68
|
# if there is an embedded email marker, not followed by a quote
|
62
69
|
# then take everything up to that marker
|
63
70
|
if pattern =~ /te*b[^q]*$/
|
File without changes
|
@@ -0,0 +1,19 @@
|
|
1
|
+
Le 2016-11-16 02:22, Erlend Sogge Heggen a écrit :
|
2
|
+
> erlend_sh [1] Erlend Sogge Heggen [1] team
|
3
|
+
> November 16
|
4
|
+
>
|
5
|
+
> Hello French guy,
|
6
|
+
>
|
7
|
+
>> is the back office also available in french like the front end ?
|
8
|
+
>
|
9
|
+
> Oui!
|
10
|
+
>
|
11
|
+
> Sincerely,
|
12
|
+
>
|
13
|
+
> Erlend
|
14
|
+
>
|
15
|
+
> *
|
16
|
+
>
|
17
|
+
> Links:
|
18
|
+
> ------
|
19
|
+
> [1] https://meta.discourse.org/users/erlend_sh
|
File without changes
|
@@ -0,0 +1,21 @@
|
|
1
|
+
Le 2016-11-16 02:22, Erlend Sogge Heggen a écrit :
|
2
|
+
> erlend_sh [1] Erlend Sogge Heggen [1] team
|
3
|
+
> November 16
|
4
|
+
>
|
5
|
+
> Hello French guy,
|
6
|
+
>
|
7
|
+
>> is the back office also available in french like the front end ?
|
8
|
+
>
|
9
|
+
> Oui!
|
10
|
+
>
|
11
|
+
> Sincerely,
|
12
|
+
>
|
13
|
+
> Erlend
|
14
|
+
>
|
15
|
+
> *
|
16
|
+
>
|
17
|
+
> Links:
|
18
|
+
> ------
|
19
|
+
> [1] https://meta.discourse.org/users/erlend_sh
|
20
|
+
|
21
|
+
Thanks for your answer.
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
Thanks for your answer.
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: email_reply_trimmer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Régis Hanol
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-11-
|
11
|
+
date: 2016-11-17 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: EmailReplyTrimmer is a small library to trim replies from plain text
|
14
14
|
email.
|
@@ -58,7 +58,8 @@ files:
|
|
58
58
|
- test/elided/embedded_email_9.txt
|
59
59
|
- test/elided/embedded_email_dutch_1.txt
|
60
60
|
- test/elided/embedded_email_dutch_2.txt
|
61
|
-
- test/elided/
|
61
|
+
- test/elided/embedded_email_french_1.txt
|
62
|
+
- test/elided/embedded_email_french_2.txt
|
62
63
|
- test/elided/embedded_email_german_1.txt
|
63
64
|
- test/elided/embedded_email_german_2.txt
|
64
65
|
- test/elided/embedded_email_german_3.txt
|
@@ -99,7 +100,8 @@ files:
|
|
99
100
|
- test/emails/embedded_email_9.txt
|
100
101
|
- test/emails/embedded_email_dutch_1.txt
|
101
102
|
- test/emails/embedded_email_dutch_2.txt
|
102
|
-
- test/emails/
|
103
|
+
- test/emails/embedded_email_french_1.txt
|
104
|
+
- test/emails/embedded_email_french_2.txt
|
103
105
|
- test/emails/embedded_email_german_1.txt
|
104
106
|
- test/emails/embedded_email_german_2.txt
|
105
107
|
- test/emails/embedded_email_german_3.txt
|
@@ -149,7 +151,8 @@ files:
|
|
149
151
|
- test/trimmed/embedded_email_9.txt
|
150
152
|
- test/trimmed/embedded_email_dutch_1.txt
|
151
153
|
- test/trimmed/embedded_email_dutch_2.txt
|
152
|
-
- test/trimmed/
|
154
|
+
- test/trimmed/embedded_email_french_1.txt
|
155
|
+
- test/trimmed/embedded_email_french_2.txt
|
153
156
|
- test/trimmed/embedded_email_german_1.txt
|
154
157
|
- test/trimmed/embedded_email_german_2.txt
|
155
158
|
- test/trimmed/embedded_email_german_3.txt
|