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 +4 -4
- data/Gemfile.lock +22 -0
- data/lib/email-fetch-and-process.rb +11 -1
- data/lib/email-fetch-and-process/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a5a16792ae36fc27529004d4882e9a79e1df52efd8119c3bcb420ca1aae65288
|
4
|
+
data.tar.gz: 2a80e0b7e7e45db85af3472fac3cf41f36770a1c506c6fe81e490f7058db16ad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 646c8bf3b023cf95deda4a8d391616aa9800e530ca0ba21d704b220b0d0fd95693bc7146bd8875078af2a3d33c600771c6f29f9868127a5118e14f2fc2e2234e
|
7
|
+
data.tar.gz: 0377a0b6ec94cc2e087ef2251ff03e2e54ac70e1b42e41b593eef34e1f4ba6c5c8527c4e3f7d6be913f93ec3dc1dd524b03db4ce240a8541446cabe6affc777d
|
data/Gemfile.lock
ADDED
@@ -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 =
|
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])
|
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.
|
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
|