reply_parser 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: 77aa7bc69ff21fe41da489c6cda07bf338c41863
4
- data.tar.gz: 195e3728e389ac7b297ed4f8d131a22153f32d3c
3
+ metadata.gz: b60c97f844b6930fa68c5de9216f69ee087feb47
4
+ data.tar.gz: ced6f432b56c78869fe6933e1755864cd19201c8
5
5
  SHA512:
6
- metadata.gz: 7bde707bc9dbf7aa8af699923e31dbfbe33862a6cdbdfda57102d2e291dc590c4a08bd56e67ae40026178b62be330fc6c16d914f9716e60448416472b2213579
7
- data.tar.gz: 3b484af83414f946798825345679547d14f7ebb3a33bfa5445f4165c1edcc5cfef5d4a76549f18d9272d214df3e28c68fda8ee906c41115ca8009aa532b25a5d
6
+ metadata.gz: 00d89211a99bbb78802a247cbc373898ce300ea041138a9904e5d3b9a73c6a8022907f424d7c03da55837577bfa7a2607abb4da7848b7ff28fb8b2b086bb5f22
7
+ data.tar.gz: c8ed94ac484cde27157c9ae1117c631fdc77c384a9a08881ac5bfce0be784f7d9f51f8d5bdd0848661aa96a86e49dc3e0c25f3a87d4b40480ccfcb4117477bf3
@@ -2,8 +2,6 @@ language: ruby
2
2
  rvm:
3
3
  - 2.0.0
4
4
  - 1.9.3
5
- - jruby-18mode # JRuby in 1.8 mode
6
5
  - jruby-19mode # JRuby in 1.9 mode
7
6
  - rbx-2.1.1
8
- - 1.8.7
9
7
  script: bundle exec rspec
data/README.md CHANGED
@@ -1,3 +1,5 @@
1
+ [![Build Status](https://travis-ci.org/excid3/reply_parser.png?branch=master)](https://travis-ci.org/excid3/reply_parser)
2
+
1
3
  # ReplyParser
2
4
 
3
5
  A Rails 4.0 email reply parser for incoming emails.
@@ -11,11 +11,15 @@ module ReplyParser
11
11
  end
12
12
 
13
13
  def self.remove_reply(text)
14
- case text
15
- when /On .+ wrote:$/m
16
- text[/(.+)On .+ wrote:$/m, 1].strip
17
- else
18
- text
19
- end
14
+ result = case text
15
+ when /(.+)On .+ wrote:$/m
16
+ $1
17
+ when /(.+)^.* Reply ABOVE THIS LINE/m
18
+ $1
19
+ else
20
+ text
21
+ end
22
+
23
+ result.strip
20
24
  end
21
25
  end
@@ -1,3 +1,3 @@
1
1
  module ReplyParser
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -27,5 +27,18 @@ describe ReplyParser do
27
27
  ).should eq("""This is my reply
28
28
 
29
29
  asdfljk""")
30
+
31
+ ReplyParser.sanitize("""<div>This is my reply</div>
32
+
33
+ asdfljk
34
+
35
+ > Reply ABOVE THIS LINE to add a comment to this conversation
36
+
37
+ asdfasdfdasfsadfdasf > asdfasdfladsdflkj
38
+ > asdfasdfdsa jlk
39
+ asdkfj"""
40
+ ).should eq("""This is my reply
41
+
42
+ asdfljk""")
30
43
  end
31
44
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: reply_parser
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
  - Chris Oliver