watirmark_email 1.3.1 → 1.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/watirmark_email/email_base.rb +28 -0
- data/lib/watirmark_email/version.rb +1 -1
- data/spec/spec_helper.rb +0 -2
- data/spec/watirmark_email_qamail_spec.rb +1 -1
- metadata +6 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 97ec9e6825fcf1b1e0273c1168b0e13aed8628c4
|
4
|
+
data.tar.gz: 0e82308d2868089ed42603ce6ad938a67e76661c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7ab6b3dc26a7a0a31e6924e9c22c965f8dfa6e81f4cdd9a74baf370b2c549a8c3a3e31e7f05f959638461dae8782971045600733facc17eba1179e6d3cb327a5
|
7
|
+
data.tar.gz: c7a7d3c1d6f09e83e3b7fa776e8412d39a6a689452edf344f772af031aec20ff681404807088e0c99240cec81fee8e3b4457239569e1da749e17ca121b71797b
|
@@ -133,6 +133,34 @@ module WatirmarkEmail
|
|
133
133
|
end
|
134
134
|
attachment
|
135
135
|
end
|
136
|
+
|
137
|
+
def get_email_attachment_file(search_array, timeout=600)
|
138
|
+
attachment_file = nil
|
139
|
+
finished = false
|
140
|
+
::Timeout.timeout(timeout) do
|
141
|
+
@log.debug("start Timeout block for #{timeout} seconds")
|
142
|
+
loop do
|
143
|
+
begin
|
144
|
+
imap = connect
|
145
|
+
msgs = imap.search(search_array)
|
146
|
+
if (msgs && msgs.length > 0)
|
147
|
+
msgs.each do |msgID|
|
148
|
+
attachment_file = Base64.decode64(imap.fetch(msgID, "BODY[#{2}]")[0].attr["BODY[#{2}]"])
|
149
|
+
finished = true
|
150
|
+
end
|
151
|
+
end
|
152
|
+
rescue => e
|
153
|
+
@log.info("Error connecting to IMAP: #{e.message}")
|
154
|
+
ensure
|
155
|
+
disconnect(imap) unless imap.nil? # because sometimes the timeout happens before imap is defined
|
156
|
+
end
|
157
|
+
break if finished
|
158
|
+
@log.debug("Couldn't find email yet ... trying again")
|
159
|
+
sleep 10
|
160
|
+
end
|
161
|
+
end
|
162
|
+
attachment_file
|
163
|
+
end
|
136
164
|
end
|
137
165
|
end
|
138
166
|
|
data/spec/spec_helper.rb
CHANGED
@@ -24,7 +24,7 @@ describe "WatirmarkEmail::QAMail" do
|
|
24
24
|
|
25
25
|
it 'should send an email to qamail' do
|
26
26
|
e = WatirmarkEmail::QAMail.new(@username, @password)
|
27
|
-
e.send_email(@send_to, :subject => 'UNIT TEST MESSAGE', :body => "Watirmark Email test message").should
|
27
|
+
e.send_email(@send_to, :subject => 'UNIT TEST MESSAGE', :body => "Watirmark Email test message").should == true
|
28
28
|
end
|
29
29
|
|
30
30
|
it "should get a sample email with 'Watirmark Email test message' in the body of the email" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: watirmark_email
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alan Baird
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-01-26 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: watirmark_email lets you get email from both GMAIL and generic IMAP servers
|
14
14
|
email: abaird@convio.com
|
@@ -35,23 +35,22 @@ require_paths:
|
|
35
35
|
- lib
|
36
36
|
required_ruby_version: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
42
42
|
requirements:
|
43
|
-
- -
|
43
|
+
- - ">="
|
44
44
|
- !ruby/object:Gem::Version
|
45
45
|
version: '0'
|
46
46
|
requirements: []
|
47
47
|
rubyforge_project:
|
48
|
-
rubygems_version: 2.4.
|
48
|
+
rubygems_version: 2.4.6
|
49
49
|
signing_key:
|
50
50
|
specification_version: 4
|
51
|
-
summary: watirmark_email-1.3.
|
51
|
+
summary: watirmark_email-1.3.2
|
52
52
|
test_files:
|
53
53
|
- spec/get_emails_spec.rb
|
54
54
|
- spec/spec_helper.rb
|
55
55
|
- spec/watirmark_email_gmail_spec.rb
|
56
56
|
- spec/watirmark_email_qamail_spec.rb
|
57
|
-
has_rdoc:
|