email_reply_trimmer 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +150 -0
- data/lib/email_reply_trimmer/delimiter_matcher.rb +10 -0
- data/lib/email_reply_trimmer.rb +1 -1
- data/test/elided/bullet_list_reply.txt +0 -0
- data/test/elided/lone_bullet_vs_separator.txt +2 -0
- data/test/emails/bullet_list_reply.txt +8 -0
- data/test/emails/lone_bullet_vs_separator.txt +9 -0
- data/test/trimmed/bullet_list_reply.txt +8 -0
- data/test/trimmed/lone_bullet_vs_separator.txt +6 -0
- metadata +9 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 54aecf374022b3de478e77efe03466144d1ea805c4cc9c0735706a579cf5451e
|
|
4
|
+
data.tar.gz: 38073ca3beed260c32563c1cdffdf58a2572107492b1fd648af86e554dbf3fa4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 32eecb6c61e7f6f06d32d16d01332d3fa1a78f31b3189f826f2fe630ffccd549486ff3b77e45b5ac7a60836b1cf7cbb91b7ed2c9c9a742dafd290e19aceb007c
|
|
7
|
+
data.tar.gz: 7eb4ec66f4ebeebd685e8dd2661e844db2a0abb8dd8a3eccc9a3711713034a7fdde3d37d5456dc32f5bbf772ce0eeba86abf7b4dd02653d00fd36a65ca499e38
|
data/Gemfile.lock
ADDED
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
PATH
|
|
2
|
+
remote: .
|
|
3
|
+
specs:
|
|
4
|
+
email_reply_trimmer (0.4.0)
|
|
5
|
+
|
|
6
|
+
GEM
|
|
7
|
+
remote: https://rubygems.org/
|
|
8
|
+
specs:
|
|
9
|
+
activesupport (8.1.3.1)
|
|
10
|
+
base64
|
|
11
|
+
bigdecimal
|
|
12
|
+
concurrent-ruby (~> 1.0, >= 1.3.1)
|
|
13
|
+
connection_pool (>= 2.2.5)
|
|
14
|
+
drb
|
|
15
|
+
i18n (>= 1.6, < 2)
|
|
16
|
+
json
|
|
17
|
+
logger (>= 1.4.2)
|
|
18
|
+
minitest (>= 5.1)
|
|
19
|
+
securerandom (>= 0.3)
|
|
20
|
+
tzinfo (~> 2.0, >= 2.0.5)
|
|
21
|
+
uri (>= 0.13.1)
|
|
22
|
+
ast (2.4.3)
|
|
23
|
+
base64 (0.3.0)
|
|
24
|
+
bigdecimal (4.1.2)
|
|
25
|
+
concurrent-ruby (1.3.8)
|
|
26
|
+
connection_pool (3.0.2)
|
|
27
|
+
drb (2.2.3)
|
|
28
|
+
i18n (1.15.2)
|
|
29
|
+
concurrent-ruby (~> 1.0)
|
|
30
|
+
json (2.21.2)
|
|
31
|
+
language_server-protocol (3.17.0.6)
|
|
32
|
+
lint_roller (1.1.0)
|
|
33
|
+
logger (1.7.0)
|
|
34
|
+
minitest (5.27.0)
|
|
35
|
+
parallel (2.1.0)
|
|
36
|
+
parser (3.3.12.0)
|
|
37
|
+
ast (~> 2.4.1)
|
|
38
|
+
racc
|
|
39
|
+
prism (1.9.0)
|
|
40
|
+
racc (1.8.1)
|
|
41
|
+
rack (3.2.6)
|
|
42
|
+
rainbow (3.1.1)
|
|
43
|
+
rake (13.4.2)
|
|
44
|
+
regexp_parser (2.12.0)
|
|
45
|
+
rubocop (1.88.2)
|
|
46
|
+
json (~> 2.3)
|
|
47
|
+
language_server-protocol (~> 3.17.0.2)
|
|
48
|
+
lint_roller (~> 1.1.0)
|
|
49
|
+
parallel (>= 1.10)
|
|
50
|
+
parser (>= 3.3.0.2)
|
|
51
|
+
rainbow (>= 2.2.2, < 4.0)
|
|
52
|
+
regexp_parser (>= 2.9.3, < 3.0)
|
|
53
|
+
rubocop-ast (>= 1.49.0, < 2.0)
|
|
54
|
+
ruby-progressbar (~> 1.7)
|
|
55
|
+
unicode-display_width (>= 2.4.0, < 4.0)
|
|
56
|
+
rubocop-ast (1.50.0)
|
|
57
|
+
parser (>= 3.3.7.2)
|
|
58
|
+
prism (~> 1.7)
|
|
59
|
+
rubocop-capybara (3.0.0)
|
|
60
|
+
lint_roller (~> 1.1)
|
|
61
|
+
rubocop (~> 1.81)
|
|
62
|
+
rubocop-discourse (3.18.0)
|
|
63
|
+
activesupport (>= 6.1)
|
|
64
|
+
lint_roller (>= 1.1.0)
|
|
65
|
+
rubocop-capybara (>= 2.23.0)
|
|
66
|
+
rubocop-discourse-base (>= 1.0.0)
|
|
67
|
+
rubocop-factory_bot (>= 2.27.0)
|
|
68
|
+
rubocop-rails (>= 2.30.3)
|
|
69
|
+
rubocop-rspec (>= 3.0.1)
|
|
70
|
+
rubocop-rspec_rails (>= 2.31.0)
|
|
71
|
+
rubocop-discourse-base (1.0.0)
|
|
72
|
+
rubocop (>= 1.80.0)
|
|
73
|
+
rubocop-factory_bot (2.28.0)
|
|
74
|
+
lint_roller (~> 1.1)
|
|
75
|
+
rubocop (~> 1.72, >= 1.72.1)
|
|
76
|
+
rubocop-rails (2.36.0)
|
|
77
|
+
activesupport (>= 4.2.0)
|
|
78
|
+
lint_roller (~> 1.1)
|
|
79
|
+
rack (>= 1.1)
|
|
80
|
+
rubocop (>= 1.75.0, < 2.0)
|
|
81
|
+
rubocop-ast (>= 1.44.0, < 2.0)
|
|
82
|
+
rubocop-rspec (3.10.2)
|
|
83
|
+
lint_roller (~> 1.1)
|
|
84
|
+
regexp_parser (>= 2.0)
|
|
85
|
+
rubocop (~> 1.86, >= 1.86.2)
|
|
86
|
+
rubocop-rspec_rails (2.32.0)
|
|
87
|
+
lint_roller (~> 1.1)
|
|
88
|
+
rubocop (~> 1.72, >= 1.72.1)
|
|
89
|
+
rubocop-rspec (~> 3.5)
|
|
90
|
+
ruby-progressbar (1.13.0)
|
|
91
|
+
securerandom (0.4.1)
|
|
92
|
+
tzinfo (2.0.6)
|
|
93
|
+
concurrent-ruby (~> 1.0)
|
|
94
|
+
unicode-display_width (3.2.0)
|
|
95
|
+
unicode-emoji (~> 4.1)
|
|
96
|
+
unicode-emoji (4.2.0)
|
|
97
|
+
uri (1.1.1)
|
|
98
|
+
|
|
99
|
+
PLATFORMS
|
|
100
|
+
arm64-darwin-23
|
|
101
|
+
ruby
|
|
102
|
+
|
|
103
|
+
DEPENDENCIES
|
|
104
|
+
email_reply_trimmer!
|
|
105
|
+
minitest (~> 5)
|
|
106
|
+
rake (~> 13)
|
|
107
|
+
rubocop
|
|
108
|
+
rubocop-discourse
|
|
109
|
+
|
|
110
|
+
CHECKSUMS
|
|
111
|
+
activesupport (8.1.3.1) sha256=85458765f25ea48b9019c46b6bb3fa5683197bf4280d9f06710a6e8d7a831376
|
|
112
|
+
ast (2.4.3) sha256=954615157c1d6a382bc27d690d973195e79db7f55e9765ac7c481c60bdb4d383
|
|
113
|
+
base64 (0.3.0) sha256=27337aeabad6ffae05c265c450490628ef3ebd4b67be58257393227588f5a97b
|
|
114
|
+
bigdecimal (4.1.2) sha256=53d217666027eab4280346fba98e7d5b66baaae1b9c3c1c0ffe89d48188a3fbd
|
|
115
|
+
concurrent-ruby (1.3.8) sha256=b2f1be836e968ccc78ccfce277ea79c72a88633f22306782c16ff23fb415d1e1
|
|
116
|
+
connection_pool (3.0.2) sha256=33fff5ba71a12d2aa26cb72b1db8bba2a1a01823559fb01d29eb74c286e62e0a
|
|
117
|
+
drb (2.2.3) sha256=0b00d6fdb50995fe4a45dea13663493c841112e4068656854646f418fda13373
|
|
118
|
+
email_reply_trimmer (0.4.0)
|
|
119
|
+
i18n (1.15.2) sha256=00f9eb62412fe593b2a65a97daa75300d37abb8f7202ec748e94b6d46a9dd1b5
|
|
120
|
+
json (2.21.2) sha256=1f1d3b7cf2b3ba1a69beca0bb6db13d5438b80bff3cd54cdaaa620b9b07c1c6a
|
|
121
|
+
language_server-protocol (3.17.0.6) sha256=5ef2c0c138f8267e1bc631d3328347d354f96724b0af22f2c79516120443b7f0
|
|
122
|
+
lint_roller (1.1.0) sha256=2c0c845b632a7d172cb849cc90c1bce937a28c5c8ccccb50dfd46a485003cc87
|
|
123
|
+
logger (1.7.0) sha256=196edec7cc44b66cfb40f9755ce11b392f21f7967696af15d274dde7edff0203
|
|
124
|
+
minitest (5.27.0) sha256=2d3b17f8a36fe7801c1adcffdbc38233b938eb0b4966e97a6739055a45fa77d5
|
|
125
|
+
parallel (2.1.0) sha256=b35258865c2e31134c5ecb708beaaf6772adf9d5efae28e93e99260877b09356
|
|
126
|
+
parser (3.3.12.0) sha256=21a6d7f755d5a24dfbdc6e6b772e4e879a52e7631a88bc5a3a134606052c9828
|
|
127
|
+
prism (1.9.0) sha256=7b530c6a9f92c24300014919c9dcbc055bf4cdf51ec30aed099b06cd6674ef85
|
|
128
|
+
racc (1.8.1) sha256=4a7f6929691dbec8b5209a0b373bc2614882b55fc5d2e447a21aaa691303d62f
|
|
129
|
+
rack (3.2.6) sha256=5ed78e1f73b2e25679bec7d45ee2d4483cc4146eb1be0264fc4d94cb5ef212c2
|
|
130
|
+
rainbow (3.1.1) sha256=039491aa3a89f42efa1d6dec2fc4e62ede96eb6acd95e52f1ad581182b79bc6a
|
|
131
|
+
rake (13.4.2) sha256=cb825b2bd5f1f8e91ca37bddb4b9aaf345551b4731da62949be002fa89283701
|
|
132
|
+
regexp_parser (2.12.0) sha256=35a916a1d63190ab5c9009457136ae5f3c0c7512d60291d0d1378ba18ce08ebb
|
|
133
|
+
rubocop (1.88.2) sha256=8def251c90cd955feb4daa3edc0ab56893250c4ce90ef81e6c80c03f9a939bbf
|
|
134
|
+
rubocop-ast (1.50.0) sha256=b9ca88300da0803ee222ad20cdb30494c0a784eed06fdc35d254b06d662788db
|
|
135
|
+
rubocop-capybara (3.0.0) sha256=7a64655238acda7f8f3c87e37ac825a64c615a79c17c253f1a28270dc3768c4b
|
|
136
|
+
rubocop-discourse (3.18.0) sha256=bdb31f13cbb1ed82443b5a53b36efbce3b52a77b7a0f3ee7b421ce81d937ce0b
|
|
137
|
+
rubocop-discourse-base (1.0.0) sha256=a4121f0f2a8e32c3259fee22106af9fd35372cbeac14b0c69673bdee79b472b7
|
|
138
|
+
rubocop-factory_bot (2.28.0) sha256=4b17fc02124444173317e131759d195b0d762844a71a29fe8139c1105d92f0cb
|
|
139
|
+
rubocop-rails (2.36.0) sha256=105a5f5b0001ff2ef28a3af90da50862464e0775e8d0016d599079c0ca408bdb
|
|
140
|
+
rubocop-rspec (3.10.2) sha256=0b3e2ecc592cd10ecbf0095bb58d1e357905276e069643523cc19eb7495f65e2
|
|
141
|
+
rubocop-rspec_rails (2.32.0) sha256=4a0d641c72f6ebb957534f539d9d0a62c47abd8ce0d0aeee1ef4701e892a9100
|
|
142
|
+
ruby-progressbar (1.13.0) sha256=80fc9c47a9b640d6834e0dc7b3c94c9df37f08cb072b7761e4a71e22cff29b33
|
|
143
|
+
securerandom (0.4.1) sha256=cc5193d414a4341b6e225f0cb4446aceca8e50d5e1888743fac16987638ea0b1
|
|
144
|
+
tzinfo (2.0.6) sha256=8daf828cc77bcf7d63b0e3bdb6caa47e2272dcfaf4fbfe46f8c3a9df087a829b
|
|
145
|
+
unicode-display_width (3.2.0) sha256=0cdd96b5681a5949cdbc2c55e7b420facae74c4aaf9a9815eee1087cb1853c42
|
|
146
|
+
unicode-emoji (4.2.0) sha256=519e69150f75652e40bf736106cfbc8f0f73aa3fb6a65afe62fefa7f80b0f80f
|
|
147
|
+
uri (1.1.1) sha256=379fa58d27ffb1387eaada68c749d1426738bd0f654d812fcc07e7568f5c57c6
|
|
148
|
+
|
|
149
|
+
BUNDLED WITH
|
|
150
|
+
4.0.10
|
|
@@ -4,7 +4,17 @@ class DelimiterMatcher
|
|
|
4
4
|
DELIMITER_CHARACTERS = "-_,=+~#*ᐧ—"
|
|
5
5
|
DELIMITER_REGEX = /^[[:blank:]]*[#{Regexp.escape(DELIMITER_CHARACTERS)}]+[[:blank:]]*$/
|
|
6
6
|
|
|
7
|
+
# A single "-" or "*" on its own line (ignoring surrounding blanks) is the
|
|
8
|
+
# way many mail clients render a plain-text bullet list item, not a reply
|
|
9
|
+
# or signature separator. Real separators built from these characters use
|
|
10
|
+
# at least two of them ("--", "***", "-----"), so excluding the lone case
|
|
11
|
+
# avoids discarding bullet-list content while leaving genuine separators
|
|
12
|
+
# (and every other delimiter character) untouched.
|
|
13
|
+
BULLET_MARKER_REGEX = /\A[[:blank:]]*[-*][[:blank:]]*\z/
|
|
14
|
+
|
|
7
15
|
def self.match?(line)
|
|
16
|
+
return false if BULLET_MARKER_REGEX.match?(line)
|
|
17
|
+
|
|
8
18
|
line =~ DELIMITER_REGEX
|
|
9
19
|
end
|
|
10
20
|
|
data/lib/email_reply_trimmer.rb
CHANGED
|
File without changes
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: email_reply_trimmer
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.4.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Régis Hanol
|
|
8
8
|
bindir: bin
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date: 2026-
|
|
10
|
+
date: 2026-08-14 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: rake
|
|
@@ -74,6 +74,7 @@ extensions: []
|
|
|
74
74
|
extra_rdoc_files: []
|
|
75
75
|
files:
|
|
76
76
|
- Gemfile
|
|
77
|
+
- Gemfile.lock
|
|
77
78
|
- LICENSE
|
|
78
79
|
- README.md
|
|
79
80
|
- Rakefile
|
|
@@ -96,6 +97,7 @@ files:
|
|
|
96
97
|
- test/before/forwarded_gmail.txt
|
|
97
98
|
- test/before/forwarded_message.txt
|
|
98
99
|
- test/elided/block_code_spacers.txt
|
|
100
|
+
- test/elided/bullet_list_reply.txt
|
|
99
101
|
- test/elided/complete_german_quote_at_end.txt
|
|
100
102
|
- test/elided/delimiter_before_forwarded_message.txt
|
|
101
103
|
- test/elided/delimiter_inside_new_reply.txt
|
|
@@ -153,6 +155,7 @@ files:
|
|
|
153
155
|
- test/elided/forwarded_gmail.txt
|
|
154
156
|
- test/elided/forwarded_message.txt
|
|
155
157
|
- test/elided/inline_images_before_reply_text.txt
|
|
158
|
+
- test/elided/lone_bullet_vs_separator.txt
|
|
156
159
|
- test/elided/normalize_line_endings.txt
|
|
157
160
|
- test/elided/quote_and_text.txt
|
|
158
161
|
- test/elided/quote_only.txt
|
|
@@ -166,6 +169,7 @@ files:
|
|
|
166
169
|
- test/elided/text_only.txt
|
|
167
170
|
- test/elided/usenet.txt
|
|
168
171
|
- test/emails/block_code_spacers.txt
|
|
172
|
+
- test/emails/bullet_list_reply.txt
|
|
169
173
|
- test/emails/complete_german_quote_at_end.txt
|
|
170
174
|
- test/emails/delimiter_before_forwarded_message.txt
|
|
171
175
|
- test/emails/delimiter_inside_new_reply.txt
|
|
@@ -223,6 +227,7 @@ files:
|
|
|
223
227
|
- test/emails/forwarded_gmail.txt
|
|
224
228
|
- test/emails/forwarded_message.txt
|
|
225
229
|
- test/emails/inline_images_before_reply_text.txt
|
|
230
|
+
- test/emails/lone_bullet_vs_separator.txt
|
|
226
231
|
- test/emails/normalize_line_endings.txt
|
|
227
232
|
- test/emails/quote_and_text.txt
|
|
228
233
|
- test/emails/quote_only.txt
|
|
@@ -249,6 +254,7 @@ files:
|
|
|
249
254
|
- test/test_email_matcher.rb
|
|
250
255
|
- test/test_email_reply_trimmer.rb
|
|
251
256
|
- test/trimmed/block_code_spacers.txt
|
|
257
|
+
- test/trimmed/bullet_list_reply.txt
|
|
252
258
|
- test/trimmed/complete_german_quote_at_end.txt
|
|
253
259
|
- test/trimmed/delimiter_before_forwarded_message.txt
|
|
254
260
|
- test/trimmed/delimiter_inside_new_reply.txt
|
|
@@ -306,6 +312,7 @@ files:
|
|
|
306
312
|
- test/trimmed/forwarded_gmail.txt
|
|
307
313
|
- test/trimmed/forwarded_message.txt
|
|
308
314
|
- test/trimmed/inline_images_before_reply_text.txt
|
|
315
|
+
- test/trimmed/lone_bullet_vs_separator.txt
|
|
309
316
|
- test/trimmed/normalize_line_endings.txt
|
|
310
317
|
- test/trimmed/quote_and_text.txt
|
|
311
318
|
- test/trimmed/quote_only.txt
|