email-fetch-and-process 0.1.0 → 0.1.1

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
  SHA256:
3
- metadata.gz: bd4238e5ce660f30d31bc897a198999950931fe26bdc70d0422bc352bf0f8bf6
4
- data.tar.gz: d4f266e248827632948a51d044abad845b9c148d10c7d284bb693947e40d6def
3
+ metadata.gz: a5a16792ae36fc27529004d4882e9a79e1df52efd8119c3bcb420ca1aae65288
4
+ data.tar.gz: 2a80e0b7e7e45db85af3472fac3cf41f36770a1c506c6fe81e490f7058db16ad
5
5
  SHA512:
6
- metadata.gz: 2ee4d00950c8672c0d89e0312212beb48c8207515a32d3905a935bd907874c726738507a9ca2f1079819317dc60319c6b2b84e0fcdc430f9e700d8afbf579057
7
- data.tar.gz: a7ab8cbed33ea683f9acdf10776efda4256818e655c010c90bf766b707f966405b07d8ae354f8a7b4cf8edc8c33a6ca9dbd8b9474d3e408a481f9649f3c170b9
6
+ metadata.gz: 646c8bf3b023cf95deda4a8d391616aa9800e530ca0ba21d704b220b0d0fd95693bc7146bd8875078af2a3d33c600771c6f29f9868127a5118e14f2fc2e2234e
7
+ data.tar.gz: 0377a0b6ec94cc2e087ef2251ff03e2e54ac70e1b42e41b593eef34e1f4ba6c5c8527c4e3f7d6be913f93ec3dc1dd524b03db4ce240a8541446cabe6affc777d
@@ -0,0 +1,22 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ email-fetch-and-process (0.1.1)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ minitest (5.11.3)
10
+ rake (10.5.0)
11
+
12
+ PLATFORMS
13
+ ruby
14
+
15
+ DEPENDENCIES
16
+ bundler (~> 1.17)
17
+ email-fetch-and-process!
18
+ minitest (~> 5.0)
19
+ rake (~> 10.0)
20
+
21
+ BUNDLED WITH
22
+ 1.17.3
@@ -29,6 +29,10 @@ class EmailFetchAndProcess
29
29
  @args[:fetch]
30
30
  end
31
31
 
32
+ def multiple_fetch_terms?
33
+ Array === @args[:fetch][0]
34
+ end
35
+
32
36
  def filename
33
37
  @args[:filename]
34
38
  end
@@ -117,7 +121,13 @@ class EmailFetchAndProcess
117
121
  @imap = imap_connection
118
122
 
119
123
  jobs.each do |job|
120
- msg_ids = @imap.search(job.fetch)
124
+ msg_ids = if job.multiple_fetch_terms?
125
+ _ids = []
126
+ job.fetch.each { |j| _ids += @imap.search(j) }
127
+ _ids
128
+ else
129
+ @imap.search(job.fetch)
130
+ end
121
131
  next if msg_ids.nil? || msg_ids.empty?
122
132
  begin
123
133
  msgs = @imap.fetch(msg_ids, %w[ENVELOPE RFC822])
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class EmailFetchAndProcess
4
- VERSION = '0.1.0'
4
+ VERSION = '0.1.1'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: email-fetch-and-process
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kirk Haines
@@ -64,6 +64,7 @@ files:
64
64
  - ".rubocop.yml"
65
65
  - ".travis.yml"
66
66
  - Gemfile
67
+ - Gemfile.lock
67
68
  - LICENSE.txt
68
69
  - README.md
69
70
  - Rakefile