reply_parser 0.0.1 → 0.0.2
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/.travis.yml +0 -2
- data/README.md +2 -0
- data/lib/reply_parser.rb +10 -6
- data/lib/reply_parser/version.rb +1 -1
- data/spec/reply_parser_spec.rb +13 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b60c97f844b6930fa68c5de9216f69ee087feb47
|
4
|
+
data.tar.gz: ced6f432b56c78869fe6933e1755864cd19201c8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 00d89211a99bbb78802a247cbc373898ce300ea041138a9904e5d3b9a73c6a8022907f424d7c03da55837577bfa7a2607abb4da7848b7ff28fb8b2b086bb5f22
|
7
|
+
data.tar.gz: c8ed94ac484cde27157c9ae1117c631fdc77c384a9a08881ac5bfce0be784f7d9f51f8d5bdd0848661aa96a86e49dc3e0c25f3a87d4b40480ccfcb4117477bf3
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
data/lib/reply_parser.rb
CHANGED
@@ -11,11 +11,15 @@ module ReplyParser
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def self.remove_reply(text)
|
14
|
-
case text
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
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
|
data/lib/reply_parser/version.rb
CHANGED
data/spec/reply_parser_spec.rb
CHANGED
@@ -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
|