artichoke 0.0.5 → 0.0.6

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 71c53c0e0c7a3c2375e67d8abbab6e72ddd8f463
4
- data.tar.gz: 0cf95187531d596017d24c497ba103ed1eea8bf1
3
+ metadata.gz: 550ebb71e2037df7fa25189df7e044fd58af64a7
4
+ data.tar.gz: 28fa4660f4a66c5fd84199a6778361fd132cca3d
5
5
  SHA512:
6
- metadata.gz: 9f6aa442ea8c0c8c12b79491576e282f6540c63dc84673db14669d01bfb481e0c2be159aed2e1e7daaaee728103fb31d7ce18a4afc57ddd5f752eeba35ada583
7
- data.tar.gz: 06e6d931c85dfa7acd398893773fc1256eebe559bbfda2112acc30676c4d90f13b8e1c427158adead35571ccce3a28454c9be4eb2b60294a80fa678e538f89c7
6
+ metadata.gz: 2c2314722aea5c9e38fce359ad979e5f7872fbfe89d82bf43662f2d6d44fe3bc4784521abf74af45311984d1a47c45a4727b1d4f9e2411181f8a59afe0f126c6
7
+ data.tar.gz: 90cea1186458eabb8e755530a1acc7034177cb3053d93392a787a587a9013f3220a28fac3a3945fc48e4f7f1058f3ce0d37ffb921d4eca207756ab01867ac3f7
data/README.md CHANGED
@@ -62,7 +62,7 @@ This is best used prior to an action that should trigger the email you want to e
62
62
  ### Evaluating and Manipulating the returned Message object
63
63
 
64
64
  # You can now do evaluations on the email, such as reading the body
65
- email.body.should have_content "I am forever in your debt master..."
65
+ email.message_content.should have_content "I am forever in your debt master..."
66
66
 
67
67
  # You can also evaluate attachments by calling email.attachments
68
68
  # or return the first attachment's filename by using
@@ -9,6 +9,10 @@ module Artichoke
9
9
  attachments.first.filename
10
10
  end
11
11
 
12
+ def message_content
13
+ text_part ? text_part.decoded : html_part.decoded
14
+ end
15
+
12
16
  private
13
17
  # Delegate all other methods to the Gmail message
14
18
  def method_missing(*args, &block)
@@ -36,7 +36,7 @@ module Artichoke
36
36
  @gmail.inbox.emails(:gm => gm_string).each do |email|
37
37
  message = email.message
38
38
  if (message.date.to_i >= @gmail_start_time.to_i) && (message.subject == options[:message_subject])
39
- body = email.text_part.decoded
39
+ body = message.text_part ? message.text_part.decoded : message.html_part.decoded
40
40
  return Message.new(message) if (options[:content]|| []).all?{|c| body =~ /#{c}/}
41
41
  end
42
42
  end
@@ -1,3 +1,3 @@
1
1
  module Artichoke
2
- VERSION = '0.0.5'
2
+ VERSION = '0.0.6'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: artichoke
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathaniel Ritholtz