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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7e62f9968467e01fa3a5889f8be9cf71de984d48
4
- data.tar.gz: 0a04448f2c487e2b8086e511d82106f5392cdd8a
3
+ metadata.gz: 58c42a0326468771aa240b25100ca50b3f9d2e7d
4
+ data.tar.gz: 269926c61f392bc95f6dc0c15e40ff21e9ca773b
5
5
  SHA512:
6
- metadata.gz: 76db5365d1c3ae729a862ed55f4f704c529afaf8e25b925865ddb60967ff0c3ca36e69ce95c414b7c01609b1cd4ae42b09299f14cebc521fe84d78ca336972dc
7
- data.tar.gz: 637c4cbf1df229ef073786d527a0d501013144c3e618b499309e4701b994b9a5fd917a032e2ef744e69a5800be83b734cd056aaef418ac544ab060625d0b5059
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
@@ -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.1"
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::Test
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.1
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.4.5
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: