iron_mailer 0.0.16 → 0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/Rakefile +2 -0
- data/iron_mailer.gemspec +1 -1
- data/lib/iron_mailer/mq_mailer.rb +0 -3
- data/lib/iron_mailer/version.rb +1 -1
- data/spec/iron_mailer/mq_mailer_spec.rb +62 -62
- data/spec/iron_mailer/send_email_spec.rb +4 -0
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YjAwMmRhYzFlM2QxZmUzY2EyNzY5ZTkzMzQ5OGYzZDY4MTA3ZGQ0ZA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
OGQ1ODQzNWRkOWY4OTVlM2U5MWYyMWMzMDE1Y2IwZWJlMWUzNzc1OA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YWM2NGU2ZTkyYzAwZDdiMTljMTU4NmNjZjBhMzNkMmEwZTY3Y2JhN2JmZWVi
|
10
|
+
YWI1YjcxNWYwMmE0YWFlY2NhYzJmMjEyZTI4NzJiNDkwNjlmYWU1ZGIxYjQ1
|
11
|
+
MjZiMWZjMzE3ZGRhNmU5NTRkYmQxNmE4MzExZTliODMwMWNjMjc=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ODNmZGZiZmUxZGU0ZDk2ODJkZGU0ZjgyNDBlNzUzNzhjMTM0NjcwYWYwYzIx
|
14
|
+
NmFlYTQxMzY5N2ExZWYzMGU5OGM1MGMxMjkzZjE3ZDA0NzEyYjNlZTFkNzA4
|
15
|
+
MWViNTg4YzVjZmU3Njk1ZGQwYzZiOTA3YTY5MDE5ODhlYzE0Yzg=
|
data/Rakefile
CHANGED
data/iron_mailer.gemspec
CHANGED
@@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
|
|
22
22
|
spec.add_development_dependency "rake"
|
23
23
|
spec.add_development_dependency "rspec"
|
24
24
|
spec.add_dependency "mail"
|
25
|
-
spec.add_dependency "iron_mq", '~>
|
25
|
+
spec.add_dependency "iron_mq", '~> 6.0'
|
26
26
|
spec.add_dependency "iron_cache", '~> 1.4'
|
27
27
|
spec.add_dependency "typhoeus"
|
28
28
|
spec.add_dependency "uuidtools"
|
data/lib/iron_mailer/version.rb
CHANGED
@@ -1,66 +1,66 @@
|
|
1
1
|
require 'iron_mailer'
|
2
2
|
|
3
3
|
describe IronMailer::MqMailer do
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
4
|
+
describe "initializer" do
|
5
|
+
it "should accept the queue name" do
|
6
|
+
IronMailer::MqMailer.new(queue_name: 'queue_name').queue_name.should == 'queue_name'
|
7
|
+
end
|
8
|
+
|
9
|
+
it "should accept the host" do
|
10
|
+
IronMailer::MqMailer.new(host: 'host').host.should == 'host'
|
11
|
+
end
|
12
|
+
|
13
|
+
end
|
14
|
+
|
15
|
+
describe "client" do
|
16
|
+
before(:each) do
|
17
|
+
@client=IronMQ::Client.new(:config=>'spec/config/iron_mq.json')
|
18
|
+
|
19
|
+
ENV['IRON_MQ_TOKEN'] = @client.token
|
20
|
+
ENV['IRON_MQ_PROJECT_ID'] = @client.project_id
|
21
|
+
|
22
|
+
end
|
23
|
+
it "should return a client with the given host" do
|
24
|
+
IronMailer::MqMailer.new(host: 'mq-rackspace-lon.iron.io').client.host.should == 'mq-rackspace-lon.iron.io'
|
25
|
+
end
|
26
|
+
|
27
|
+
it "should handle no host being passed in" do
|
28
|
+
IronMailer::MqMailer.new.client.host.should_not be_blank
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
def test_email
|
33
|
+
test_email = Mail.new do
|
34
|
+
subject ="This is a subject"
|
35
|
+
to 'to@someone.com'
|
36
|
+
from 'from@someone.com'
|
37
|
+
text_part do
|
38
|
+
body "This is Text"
|
39
|
+
end
|
40
|
+
html_part do
|
41
|
+
content_type 'text/html; charset=UTF-8'
|
42
|
+
body "<h1>This is html</h1>"
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
describe "deliver!" do
|
48
|
+
before(:each) do
|
49
|
+
@queue_name='test_mail_queue'
|
50
|
+
@client=IronMQ::Client.new(:config=>'spec/config/iron_mq.json')
|
51
|
+
|
52
|
+
ENV['IRON_MQ_TOKEN'] = @client.token
|
53
|
+
ENV['IRON_MQ_PROJECT_ID'] = @client.project_id
|
54
|
+
|
55
|
+
@queue=@client.queue(@queue_name)
|
56
|
+
@mailer = IronMailer::MqMailer.new(queue_name: @queue_name, host: 'mq-aws-eu-west-1-1.iron.io')
|
57
|
+
end
|
58
|
+
|
59
|
+
it "should add an email message to the queue" do
|
60
|
+
lambda{
|
61
|
+
@mailer.deliver!(test_email)
|
62
|
+
@queue.reload
|
63
|
+
}.should change(@queue, :size)
|
64
|
+
end
|
65
|
+
end
|
66
66
|
end
|
@@ -105,6 +105,10 @@ describe IronMailer::SendEmail do
|
|
105
105
|
end
|
106
106
|
@test_email = test_email
|
107
107
|
@message = @send_email.queue.post(@test_email)
|
108
|
+
|
109
|
+
@send_email.queue.reload
|
110
|
+
@send_email.cache.reload
|
111
|
+
|
108
112
|
@execute=lambda{
|
109
113
|
@send_email.execute
|
110
114
|
@send_email.queue.reload
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: iron_mailer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: '0.1'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Erich Timkar
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-02-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -72,14 +72,14 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - ~>
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
75
|
+
version: '6.0'
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - ~>
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '
|
82
|
+
version: '6.0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: iron_cache
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -162,7 +162,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
162
162
|
version: '0'
|
163
163
|
requirements: []
|
164
164
|
rubyforge_project:
|
165
|
-
rubygems_version: 2.4.
|
165
|
+
rubygems_version: 2.4.8
|
166
166
|
signing_key:
|
167
167
|
specification_version: 4
|
168
168
|
summary: A Rails mail delivery method using Iron MQ & Workers
|