email_reply_trimmer 0.1.6 → 0.1.7
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.rb +57 -22
- data/lib/email_reply_trimmer/delimiter_matcher.rb +1 -1
- data/lib/email_reply_trimmer/email_header_matcher.rb +25 -13
- data/lib/email_reply_trimmer/embedded_email_matcher.rb +51 -25
- data/lib/email_reply_trimmer/signature_matcher.rb +16 -9
- data/test/elided/email_headers_5.txt +23 -0
- data/test/elided/embedded_ception.txt +3 -3
- data/test/elided/embedded_email_12.txt +2 -2
- 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_chinese.txt +4 -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_norwegian.txt +9 -0
- data/test/elided/embedded_email_quote_text.txt +5 -0
- data/test/elided/{embedded_email_russian.txt → embedded_email_russian_1.txt} +0 -0
- data/test/elided/embedded_email_russian_2.txt +23 -0
- data/test/elided/embedded_email_swedish.txt +8 -0
- data/test/elided/signatures.txt +2 -0
- data/test/emails/email_headers_5.txt +37 -0
- data/test/emails/embedded_email_1.txt +1 -1
- 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_4.txt +13 -13
- data/test/emails/embedded_email_7.txt +4 -4
- data/test/emails/embedded_email_chinese.txt +7 -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_norwegian.txt +11 -0
- data/test/emails/{embedded_email_russian.txt → embedded_email_russian_1.txt} +0 -0
- data/test/emails/embedded_email_russian_2.txt +26 -0
- data/test/emails/embedded_email_swedish.txt +20 -0
- data/test/emails/signatures.txt +2 -0
- data/test/test_email_reply_trimmer.rb +2 -2
- data/test/trimmed/email_headers_5.txt +11 -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_chinese.txt +2 -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_norwegian.txt +1 -0
- data/test/trimmed/embedded_email_quote_text.txt +0 -5
- data/test/trimmed/{embedded_email_russian.txt → embedded_email_russian_1.txt} +0 -0
- data/test/trimmed/embedded_email_russian_2.txt +1 -0
- data/test/trimmed/embedded_email_swedish.txt +9 -0
- metadata +51 -6
@@ -0,0 +1,14 @@
|
|
1
|
+
Ich habe konzeptionell eine Präferenz für die zweite Option. Die 2 VLs
|
2
|
+
stellen die Inhalte vor, und präsentieren diese in einen größeren Kontext.
|
3
|
+
Dann beginnt das Training der technischen Finessen mit Trainingsblatt,
|
4
|
+
Trainingsvideos usw. Bin gleichzeitig robust, sofern nötig.
|
5
|
+
|
6
|
+
Am 21.04.2016 17:48 schrieb "Einz Zwei" <noreply@discourse.pseuco.com
|
7
|
+
>:
|
8
|
+
|
9
|
+
> einz.zwei <https://discourse.pseuco.com/users/einz.zwei> einz
|
10
|
+
> zwei <https://discourse.pseuco.com/users/einz.zwei>
|
11
|
+
> 21. April
|
12
|
+
>
|
13
|
+
> Vielleicht noch eine wichtige Frage:
|
14
|
+
> Wann sollten wir diese Trainingsvideos veröffentlichen, es gibt 2
|
@@ -0,0 +1,11 @@
|
|
1
|
+
Thanx :-)
|
2
|
+
|
3
|
+
Sendt fra min iPad
|
4
|
+
|
5
|
+
Den 15. jun. 2016 kl. 20.42 skrev Jeff Atwood <info@discourse.org<mailto:info@discourse.org>>:
|
6
|
+
|
7
|
+
codinghorror<https://meta.discourse.org/users/codinghorror> Jeff Atwood<https://meta.discourse.org/users/codinghorror> co-founder
|
8
|
+
June 15
|
9
|
+
|
10
|
+
|
11
|
+
Enable tags in your admin, site settings.
|
File without changes
|
@@ -0,0 +1,26 @@
|
|
1
|
+
Yes.
|
2
|
+
|
3
|
+
20 окт. 2016 г. 19:37 пользователь "Rafael dos Santos Silva" <
|
4
|
+
meta@discoursemail.com> написал:
|
5
|
+
|
6
|
+
> Falco <https://meta.discourse.org/users/falco> Rafael dos Santos Silva
|
7
|
+
> <https://meta.discourse.org/users/falco> team
|
8
|
+
> October 20
|
9
|
+
>
|
10
|
+
> Are you using our official docker install?
|
11
|
+
>
|
12
|
+
> If you are, try a rebuild:
|
13
|
+
>
|
14
|
+
> ssh root@server
|
15
|
+
> cd /var/discourse
|
16
|
+
> ./launcher rebuild app
|
17
|
+
>
|
18
|
+
> ------------------------------
|
19
|
+
>
|
20
|
+
> Visit Topic <https://meta.discourse.org/t/error-upgrading/51797/2> or
|
21
|
+
> reply to this email to respond.
|
22
|
+
>
|
23
|
+
> To unsubscribe from these emails, click here
|
24
|
+
> <https://meta.discourse.org/email/unsubscribe/184ce11578cd0abaddcb6e7460708971afed7278523347d3184a421229d87d08>
|
25
|
+
> .
|
26
|
+
>
|
@@ -0,0 +1,20 @@
|
|
1
|
+
Hi everyone!
|
2
|
+
|
3
|
+
Here you can find the pictures that I took https://foo.bar
|
4
|
+
|
5
|
+
It was a pleasure to support this event.
|
6
|
+
|
7
|
+
Best regards
|
8
|
+
|
9
|
+
Some One
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
Från: Foo Bar [mailto:noreply@foo.bar]
|
14
|
+
Skickat: den 5 juni 2017 12:22
|
15
|
+
Till: someone@domain.com
|
16
|
+
Ämne: [WAT] Photos from the symposium
|
17
|
+
|
18
|
+
If you have any pictures from any parts of the symposium that you are willing to share, please reply to this post to share them (you can simply copy and paste or drag'n'drop them into the text).
|
19
|
+
|
20
|
+
Here are the group pictures we took on Wednesday after lunch.
|
data/test/emails/signatures.txt
CHANGED
@@ -22,8 +22,8 @@ class TestEmailReplyTrimmer < Minitest::Test
|
|
22
22
|
EMAILS.each do |filename|
|
23
23
|
name = File.basename(filename, ".txt")
|
24
24
|
define_method("test_#{name}") do
|
25
|
-
assert_equal(
|
26
|
-
assert_equal(
|
25
|
+
assert_equal(trimmed(filename), trim(filename), "[TRIMMED] EMAIL: #{filename}")
|
26
|
+
assert_equal(elided(filename), elide(filename), "[ELIDED] EMAIL: #{filename}")
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
@@ -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,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...
|
@@ -0,0 +1,35 @@
|
|
1
|
+
The intent was to return nil when the first value was nil.
|
2
|
+
That was the op's issue.
|
3
|
+
If one of the values was nil, she/he wanted nil.
|
4
|
+
|
5
|
+
Nil && anything_else will always return nil, and I will not evaluate the
|
6
|
+
second clause.
|
7
|
+
|
8
|
+
|
9
|
+
> >>>>>>>>
|
10
|
+
> It should be:
|
11
|
+
> 2.0 && 2.0 + 12.0
|
12
|
+
> <<<<<<<<<
|
13
|
+
>
|
14
|
+
> Ah! Yes, that works.
|
15
|
+
>
|
16
|
+
>
|
17
|
+
People are intent on not understanding, aren't they.
|
18
|
+
|
19
|
+
def nil_add_12 f
|
20
|
+
f && f + 12.0
|
21
|
+
end
|
22
|
+
|
23
|
+
Generalised to two parameters:
|
24
|
+
|
25
|
+
def nil_add a, b
|
26
|
+
a && b && a + b
|
27
|
+
end
|
28
|
+
|
29
|
+
The only quirk is the way they handle `false`.
|
30
|
+
|
31
|
+
This is not tested, but it may be possible to do this, too:
|
32
|
+
|
33
|
+
f&.+ b
|
34
|
+
|
35
|
+
Cheers
|
@@ -0,0 +1,13 @@
|
|
1
|
+
I had a really hard time with the official guide, so when I finally
|
2
|
+
figured it out, I wrote one of my own:
|
3
|
+
|
4
|
+
|
5
|
+
http://ryanlue.com/posts/2017-02-18-how-to-publish-a-gem
|
6
|
+
|
7
|
+
|
8
|
+
|
9
|
+
Let me know if you like it (or if you don't) – any feedback is highly
|
10
|
+
appreciated!
|
11
|
+
|
12
|
+
|
13
|
+
—Ryan
|
@@ -0,0 +1 @@
|
|
1
|
+
Hi there! I am replying from my german Google Inbox.
|
@@ -0,0 +1 @@
|
|
1
|
+
Okay. Will give it a whirl.
|
@@ -0,0 +1,4 @@
|
|
1
|
+
Ich habe konzeptionell eine Präferenz für die zweite Option. Die 2 VLs
|
2
|
+
stellen die Inhalte vor, und präsentieren diese in einen größeren Kontext.
|
3
|
+
Dann beginnt das Training der technischen Finessen mit Trainingsblatt,
|
4
|
+
Trainingsvideos usw. Bin gleichzeitig robust, sofern nötig.
|
@@ -0,0 +1 @@
|
|
1
|
+
Thanx :-)
|
@@ -1,7 +1,2 @@
|
|
1
|
-
> This seems like a problem that would be better solved at the web server
|
2
|
-
> level, rather than by the application. If nothing else, adding an instance
|
3
|
-
> of Nginx as an SSL/TLS reverse-proxy would very quickly take care of this.
|
4
|
-
>
|
5
|
-
|
6
1
|
when I said looks possible, I pointed to rack because that's still the web
|
7
2
|
server level
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
Yes.
|
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.7
|
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:
|
11
|
+
date: 2017-07-31 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.
|
@@ -43,11 +43,19 @@ files:
|
|
43
43
|
- test/elided/email_headers_2.txt
|
44
44
|
- test/elided/email_headers_3.txt
|
45
45
|
- test/elided/email_headers_4.txt
|
46
|
+
- test/elided/email_headers_5.txt
|
46
47
|
- test/elided/embedded_ception.txt
|
47
48
|
- test/elided/embedded_email_1.txt
|
48
49
|
- test/elided/embedded_email_10.txt
|
49
50
|
- test/elided/embedded_email_11.txt
|
50
51
|
- test/elided/embedded_email_12.txt
|
52
|
+
- test/elided/embedded_email_13.txt
|
53
|
+
- test/elided/embedded_email_14.txt
|
54
|
+
- test/elided/embedded_email_15.txt
|
55
|
+
- test/elided/embedded_email_16.txt
|
56
|
+
- test/elided/embedded_email_17.txt
|
57
|
+
- test/elided/embedded_email_18.txt
|
58
|
+
- test/elided/embedded_email_19.txt
|
51
59
|
- test/elided/embedded_email_2.txt
|
52
60
|
- test/elided/embedded_email_3.txt
|
53
61
|
- test/elided/embedded_email_4.txt
|
@@ -56,6 +64,7 @@ files:
|
|
56
64
|
- test/elided/embedded_email_7.txt
|
57
65
|
- test/elided/embedded_email_8.txt
|
58
66
|
- test/elided/embedded_email_9.txt
|
67
|
+
- test/elided/embedded_email_chinese.txt
|
59
68
|
- test/elided/embedded_email_dutch_1.txt
|
60
69
|
- test/elided/embedded_email_dutch_2.txt
|
61
70
|
- test/elided/embedded_email_french_1.txt
|
@@ -63,13 +72,19 @@ files:
|
|
63
72
|
- test/elided/embedded_email_german_1.txt
|
64
73
|
- test/elided/embedded_email_german_2.txt
|
65
74
|
- test/elided/embedded_email_german_3.txt
|
75
|
+
- test/elided/embedded_email_german_4.txt
|
76
|
+
- test/elided/embedded_email_german_5.txt
|
77
|
+
- test/elided/embedded_email_german_6.txt
|
66
78
|
- test/elided/embedded_email_italian.txt
|
79
|
+
- test/elided/embedded_email_norwegian.txt
|
67
80
|
- test/elided/embedded_email_polish.txt
|
68
81
|
- test/elided/embedded_email_portuguese.txt
|
69
82
|
- test/elided/embedded_email_quote_text.txt
|
70
|
-
- test/elided/
|
83
|
+
- test/elided/embedded_email_russian_1.txt
|
84
|
+
- test/elided/embedded_email_russian_2.txt
|
71
85
|
- test/elided/embedded_email_spanish_1.txt
|
72
86
|
- test/elided/embedded_email_spanish_2.txt
|
87
|
+
- test/elided/embedded_email_swedish.txt
|
73
88
|
- test/elided/forwarded_message.txt
|
74
89
|
- test/elided/normalize_line_endings.txt
|
75
90
|
- test/elided/quote_and_text.txt
|
@@ -85,11 +100,19 @@ files:
|
|
85
100
|
- test/emails/email_headers_2.txt
|
86
101
|
- test/emails/email_headers_3.txt
|
87
102
|
- test/emails/email_headers_4.txt
|
103
|
+
- test/emails/email_headers_5.txt
|
88
104
|
- test/emails/embedded_ception.txt
|
89
105
|
- test/emails/embedded_email_1.txt
|
90
106
|
- test/emails/embedded_email_10.txt
|
91
107
|
- test/emails/embedded_email_11.txt
|
92
108
|
- test/emails/embedded_email_12.txt
|
109
|
+
- test/emails/embedded_email_13.txt
|
110
|
+
- test/emails/embedded_email_14.txt
|
111
|
+
- test/emails/embedded_email_15.txt
|
112
|
+
- test/emails/embedded_email_16.txt
|
113
|
+
- test/emails/embedded_email_17.txt
|
114
|
+
- test/emails/embedded_email_18.txt
|
115
|
+
- test/emails/embedded_email_19.txt
|
93
116
|
- test/emails/embedded_email_2.txt
|
94
117
|
- test/emails/embedded_email_3.txt
|
95
118
|
- test/emails/embedded_email_4.txt
|
@@ -98,6 +121,7 @@ files:
|
|
98
121
|
- test/emails/embedded_email_7.txt
|
99
122
|
- test/emails/embedded_email_8.txt
|
100
123
|
- test/emails/embedded_email_9.txt
|
124
|
+
- test/emails/embedded_email_chinese.txt
|
101
125
|
- test/emails/embedded_email_dutch_1.txt
|
102
126
|
- test/emails/embedded_email_dutch_2.txt
|
103
127
|
- test/emails/embedded_email_french_1.txt
|
@@ -105,13 +129,19 @@ files:
|
|
105
129
|
- test/emails/embedded_email_german_1.txt
|
106
130
|
- test/emails/embedded_email_german_2.txt
|
107
131
|
- test/emails/embedded_email_german_3.txt
|
132
|
+
- test/emails/embedded_email_german_4.txt
|
133
|
+
- test/emails/embedded_email_german_5.txt
|
134
|
+
- test/emails/embedded_email_german_6.txt
|
108
135
|
- test/emails/embedded_email_italian.txt
|
136
|
+
- test/emails/embedded_email_norwegian.txt
|
109
137
|
- test/emails/embedded_email_polish.txt
|
110
138
|
- test/emails/embedded_email_portuguese.txt
|
111
139
|
- test/emails/embedded_email_quote_text.txt
|
112
|
-
- test/emails/
|
140
|
+
- test/emails/embedded_email_russian_1.txt
|
141
|
+
- test/emails/embedded_email_russian_2.txt
|
113
142
|
- test/emails/embedded_email_spanish_1.txt
|
114
143
|
- test/emails/embedded_email_spanish_2.txt
|
144
|
+
- test/emails/embedded_email_swedish.txt
|
115
145
|
- test/emails/forwarded_message.txt
|
116
146
|
- test/emails/normalize_line_endings.txt
|
117
147
|
- test/emails/quote_and_text.txt
|
@@ -136,11 +166,19 @@ files:
|
|
136
166
|
- test/trimmed/email_headers_2.txt
|
137
167
|
- test/trimmed/email_headers_3.txt
|
138
168
|
- test/trimmed/email_headers_4.txt
|
169
|
+
- test/trimmed/email_headers_5.txt
|
139
170
|
- test/trimmed/embedded_ception.txt
|
140
171
|
- test/trimmed/embedded_email_1.txt
|
141
172
|
- test/trimmed/embedded_email_10.txt
|
142
173
|
- test/trimmed/embedded_email_11.txt
|
143
174
|
- test/trimmed/embedded_email_12.txt
|
175
|
+
- test/trimmed/embedded_email_13.txt
|
176
|
+
- test/trimmed/embedded_email_14.txt
|
177
|
+
- test/trimmed/embedded_email_15.txt
|
178
|
+
- test/trimmed/embedded_email_16.txt
|
179
|
+
- test/trimmed/embedded_email_17.txt
|
180
|
+
- test/trimmed/embedded_email_18.txt
|
181
|
+
- test/trimmed/embedded_email_19.txt
|
144
182
|
- test/trimmed/embedded_email_2.txt
|
145
183
|
- test/trimmed/embedded_email_3.txt
|
146
184
|
- test/trimmed/embedded_email_4.txt
|
@@ -149,6 +187,7 @@ files:
|
|
149
187
|
- test/trimmed/embedded_email_7.txt
|
150
188
|
- test/trimmed/embedded_email_8.txt
|
151
189
|
- test/trimmed/embedded_email_9.txt
|
190
|
+
- test/trimmed/embedded_email_chinese.txt
|
152
191
|
- test/trimmed/embedded_email_dutch_1.txt
|
153
192
|
- test/trimmed/embedded_email_dutch_2.txt
|
154
193
|
- test/trimmed/embedded_email_french_1.txt
|
@@ -156,13 +195,19 @@ files:
|
|
156
195
|
- test/trimmed/embedded_email_german_1.txt
|
157
196
|
- test/trimmed/embedded_email_german_2.txt
|
158
197
|
- test/trimmed/embedded_email_german_3.txt
|
198
|
+
- test/trimmed/embedded_email_german_4.txt
|
199
|
+
- test/trimmed/embedded_email_german_5.txt
|
200
|
+
- test/trimmed/embedded_email_german_6.txt
|
159
201
|
- test/trimmed/embedded_email_italian.txt
|
202
|
+
- test/trimmed/embedded_email_norwegian.txt
|
160
203
|
- test/trimmed/embedded_email_polish.txt
|
161
204
|
- test/trimmed/embedded_email_portuguese.txt
|
162
205
|
- test/trimmed/embedded_email_quote_text.txt
|
163
|
-
- test/trimmed/
|
206
|
+
- test/trimmed/embedded_email_russian_1.txt
|
207
|
+
- test/trimmed/embedded_email_russian_2.txt
|
164
208
|
- test/trimmed/embedded_email_spanish_1.txt
|
165
209
|
- test/trimmed/embedded_email_spanish_2.txt
|
210
|
+
- test/trimmed/embedded_email_swedish.txt
|
166
211
|
- test/trimmed/forwarded_message.txt
|
167
212
|
- test/trimmed/normalize_line_endings.txt
|
168
213
|
- test/trimmed/quote_and_text.txt
|
@@ -192,7 +237,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
192
237
|
version: '0'
|
193
238
|
requirements: []
|
194
239
|
rubyforge_project:
|
195
|
-
rubygems_version: 2.
|
240
|
+
rubygems_version: 2.6.11
|
196
241
|
signing_key:
|
197
242
|
specification_version: 4
|
198
243
|
summary: Library to trim replies from plain text email.
|