bodyparts 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/VERSION +1 -1
  2. data/bodyparts.gemspec +1 -1
  3. data/lib/bodyparts.rb +8 -6
  4. metadata +2 -2
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.1.1
data/bodyparts.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{bodyparts}
8
- s.version = "0.1.0"
8
+ s.version = "0.1.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Max Ogden"]
data/lib/bodyparts.rb CHANGED
@@ -27,11 +27,13 @@ class BodyParts
27
27
  body = email.body.raw_source
28
28
  end
29
29
 
30
- matches = []
31
- rules.each {|rule| matches << body.match(rule[:reply_delimiter])}
32
- matches.compact!
33
- match = matches.sort_by {|m| m.begin(0)}.first
34
- new_message = body[0, match.begin(0)]
35
- {:new_message => new_message.strip, :rest_of_thread => body[match.begin(0)..-1].strip}
30
+ matches = rules.map {|rule| body.match(rule[:reply_delimiter])}.compact!
31
+ unless matches.empty?
32
+ match = matches.sort_by {|m| m.begin(0)}.first
33
+ new_message = body[0, match.begin(0)]
34
+ {:new_message => new_message.strip, :rest_of_thread => body[match.begin(0)..-1].strip}
35
+ else
36
+ body
37
+ end
36
38
  end
37
39
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 0
9
- version: 0.1.0
8
+ - 1
9
+ version: 0.1.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - Max Ogden