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: 19151a1b0306908f229506fd9852c2e5f2977e99
4
- data.tar.gz: 79f45dc86fc21c4781b2a67443da9a25c514ffbd
3
+ metadata.gz: 3580bb67f3fef9014b7efecbfe07a87b7f17eb5d
4
+ data.tar.gz: d2d2800bc7a41ba50a81cb5674d11b0af82d9e95
5
5
  SHA512:
6
- metadata.gz: 3004669e3deeb2f2ef729cfa6e09fc1c40fd97560bcb199f96c6c1290f81358b5ec53dad5d63054719f538887b3fd107dffd238929ae5c6a54dcd556a2116e55
7
- data.tar.gz: d5c4e1139d2d4e618eca348e09d58d5ba98a2b9c64c8d7f3c51536eb434c75c9b32051f7bc1463bcbaf1ca1929ed4d35bb36194c569573c2a7b7a359a7823647
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:
@@ -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.6"
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 =~ /hh[ht]+e/
79
- index = pattern =~ /hh[ht]+e/
80
- size = pattern[/hh[ht]+/].size
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.6
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