extended_email_reply_parser 0.2.0 → 0.3.0

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: 866bcd8a3614e5d375867919db294865cff1815e
4
- data.tar.gz: 7d26474062d3e306dec02c074099b825b9ed7550
3
+ metadata.gz: 973b3edc0195910548a7a07712dd593a1a85eaf5
4
+ data.tar.gz: 978d70f446b5c794029d00ee7692689eba284205
5
5
  SHA512:
6
- metadata.gz: 6375130ad59104bde4a02bec7fdf34322d6b20193484b82790986072828f5da945c59ea06059a9051e86ea0d018f28c187573084cdd91c488bd1d5d5194317ac
7
- data.tar.gz: 18da57f29e3ef35802fa52ea194a5007ade3dad7ceb9b7fd2635700b3269edbf0999a7654bf1813cd10f53092fc25c7fa0ee906ff60298562f3a3c5b7b857ab8
6
+ metadata.gz: 519d870958f4ffee3a4e89e9976c0d12bf48f71919871db62795225046ef789da590d77b79e8f8fe72cee38d0ba4b43873912584f849a7604f4b1274aa94b0f5
7
+ data.tar.gz: ddd1e82ecd562dfcd99a25e9a2abd9435835e2625111a9b68ebb339a64eec918cfce8608ad2bd9d0c5a175f6fbe173fe4f94015a034d20a42e0b949fda927d3c
data/CHANGELOG.md CHANGED
@@ -10,6 +10,11 @@ This project adheres to [Semantic Versioning](http://semver.org/).
10
10
  ### Removed
11
11
  ### Fixed
12
12
 
13
+
14
+ ## ExtendedEmailReplyParser 0.3.0 (2016-07-22)
15
+ ### Added
16
+ - `ExtendedEmailReplyParser#extract_text(message)` as alternative to `message.extract_text` in order to indicate where the method comes from. When using `message.extract_text` one is lead to look for the definition in `Mail::Message` directly.
17
+
13
18
  ## ExtendedEmailReplyParser 0.2.0 (2016-07-22)
14
19
  ### Added
15
20
  - `Parsers::Base#hide_everything_after(expressions)` is useful when email clients do not quote the previous conversation. This parser method hides everything lead by a series of expressions, e.g. `hide_everything_after %w(From: Sent: To:)`.
@@ -1,3 +1,3 @@
1
1
  module ExtendedEmailReplyParser
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.0"
3
3
  end
@@ -40,6 +40,23 @@ module ExtendedEmailReplyParser
40
40
  Mail.read email_file_path
41
41
  end
42
42
 
43
+ # Extract the body text from the given Mail::Message.
44
+ #
45
+ # ExtendedEmailReplyParser.extract_text message
46
+ # ExtendedEmailReplyParser.extract_text '/path/to/email.eml'
47
+ #
48
+ # This is the same as:
49
+ #
50
+ # message.extract_text
51
+ #
52
+ def self.extract_text(message_or_path)
53
+ if message_or_path.kind_of? Mail::Message
54
+ message_or_path.extract_text
55
+ elsif message_or_path.kind_of? String and File.file? message_or_path
56
+ Mail.read(message_or_path).extract_text
57
+ end
58
+ end
59
+
43
60
  # This parses the given object, i.e. removes quoted replies etc.
44
61
  #
45
62
  # Examples:
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: extended_email_reply_parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sebastian Fiedlschuster