email_reply_trimmer 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/email_reply_trimmer-0.0.1.gem +0 -0
- data/lib/email_reply_trimmer.rb +3 -1
- data/test/test_email_reply_trimmer.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 58c42a0326468771aa240b25100ca50b3f9d2e7d
|
4
|
+
data.tar.gz: 269926c61f392bc95f6dc0c15e40ff21e9ca773b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3dfd25e20d17f27e218b63e62cb26f35d0eb9f9f64cf3b2d58c66440e46d3e7ba8192524f32d1c1798213247c51e6ccc6589609ad7fe41e85c5dffa50ff48a38
|
7
|
+
data.tar.gz: 4b094d99e8af9a3ef1bce45bcbbac3d37852dc2aaf1cde840900f12eaedfe68de21caef2ab77c07e991d51aa0e4f5d6791e16c5a7fbfbc8e61b686066e18d47d
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Discourse Email Reply Trimmer
|
1
|
+
# Discourse Email Reply Trimmer [![Build Status](https://api.travis-ci.org/discourse/email_reply_trimmer.svg?branch=master)](https://travis-ci.org/discourse/email_reply_trimmer)
|
2
2
|
|
3
3
|
EmailReplyTrimmer is a small library to trim replies from plain text email.
|
4
4
|
|
Binary file
|
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.2"
|
10
10
|
|
11
11
|
DELIMITER = "d"
|
12
12
|
EMBEDDED = "b"
|
@@ -27,6 +27,8 @@ class EmailReplyTrimmer
|
|
27
27
|
end
|
28
28
|
|
29
29
|
def self.trim(text)
|
30
|
+
return "" if text.nil? || text =~ /\A[[:space:]]*\Z/m
|
31
|
+
|
30
32
|
# normalize line endings
|
31
33
|
text = text.gsub!(/\r*\n/, "\n")
|
32
34
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require "minitest/autorun"
|
2
2
|
require "email_reply_trimmer"
|
3
3
|
|
4
|
-
class TestEmailReplyTrimmer < Minitest::
|
4
|
+
class TestEmailReplyTrimmer < Minitest::Unit::TestCase
|
5
5
|
|
6
6
|
EMAILS = Dir["test/emails/*.txt"].map { |path| File.basename(path) }
|
7
7
|
REPLIES = Dir["test/replies/*.txt"].map { |path| File.basename(path) }
|
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.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Régis Hanol
|
@@ -21,6 +21,7 @@ files:
|
|
21
21
|
- LICENSE
|
22
22
|
- README.md
|
23
23
|
- Rakefile
|
24
|
+
- email_reply_trimmer-0.0.1.gem
|
24
25
|
- email_reply_trimmer.gemspec
|
25
26
|
- lib/email_reply_trimmer.rb
|
26
27
|
- lib/email_reply_trimmer/delimiter_matcher.rb
|
@@ -106,9 +107,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
106
107
|
version: '0'
|
107
108
|
requirements: []
|
108
109
|
rubyforge_project:
|
109
|
-
rubygems_version: 2.
|
110
|
+
rubygems_version: 2.5.1
|
110
111
|
signing_key:
|
111
112
|
specification_version: 4
|
112
113
|
summary: Library to trim replies from plain text email.
|
113
114
|
test_files: []
|
114
|
-
has_rdoc:
|