iron_mailer 0.0.16 → 0.1

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,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MGI0MmI5ODBlM2ZkMzA1Yjc3MGE5Y2MzMjBjZDcwOGJmYzliNTRkMQ==
4
+ YjAwMmRhYzFlM2QxZmUzY2EyNzY5ZTkzMzQ5OGYzZDY4MTA3ZGQ0ZA==
5
5
  data.tar.gz: !binary |-
6
- NTlmZmQ2ZmNkNzM4OTUxMTI5ODk5YmYwMjFjNTA3NWI3YzBjYzcyMA==
6
+ OGQ1ODQzNWRkOWY4OTVlM2U5MWYyMWMzMDE1Y2IwZWJlMWUzNzc1OA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- M2IzODBhMThiMWI3YWI3OTA5MDhiMjIzYjQ1ZWI2N2FjNmY0NmE5NWU1MmM0
10
- NDdkNmNkMDRiYTkwNGMyOGM3YjgzMzg5YmI2OTQyNzQ1ZmZiZjA4M2IyMjkx
11
- YWVlN2E0ODBlM2M4ZmY4ZmEyNDY2ZDYxODdmZWMyNWZkNzhlYjU=
9
+ YWM2NGU2ZTkyYzAwZDdiMTljMTU4NmNjZjBhMzNkMmEwZTY3Y2JhN2JmZWVi
10
+ YWI1YjcxNWYwMmE0YWFlY2NhYzJmMjEyZTI4NzJiNDkwNjlmYWU1ZGIxYjQ1
11
+ MjZiMWZjMzE3ZGRhNmU5NTRkYmQxNmE4MzExZTliODMwMWNjMjc=
12
12
  data.tar.gz: !binary |-
13
- YjFmODM0ZDI1MDBiZjBiMDcyNGM0MTY4YTc3MWU3Mzk3MzU0OWUzMTAwYWEz
14
- YWI5ZTA0YzI4YmVlMTY4MjQwZmUxNGQ5NjE4OGE5MTNlMTlhYmJkMzI5NTc0
15
- ZjRhNDk0YTczMWZmMTVkZDU2YjRkYmE1NjMyOTNiZDA1N2Y4NGQ=
13
+ ODNmZGZiZmUxZGU0ZDk2ODJkZGU0ZjgyNDBlNzUzNzhjMTM0NjcwYWYwYzIx
14
+ NmFlYTQxMzY5N2ExZWYzMGU5OGM1MGMxMjkzZjE3ZDA0NzEyYjNlZTFkNzA4
15
+ MWViNTg4YzVjZmU3Njk1ZGQwYzZiOTA3YTY5MDE5ODhlYzE0Yzg=
data/Rakefile CHANGED
@@ -1 +1,3 @@
1
1
  require "bundler/gem_tasks"
2
+ require 'rspec/core/rake_task'
3
+ RSpec::Core::RakeTask.new(:spec)
@@ -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", '~> 4.0'
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"
@@ -6,13 +6,10 @@ module IronMailer
6
6
  @host = options[:host]
7
7
  end
8
8
 
9
-
10
-
11
9
  def client
12
10
  IronMQ::Client.new(:host=> self.host)
13
11
  end
14
12
 
15
-
16
13
  def deliver!(mail)
17
14
  @queue = self.client.queue(@queue_name)
18
15
  @queue.post(mail.encoded)
@@ -1,3 +1,3 @@
1
1
  module IronMailer
2
- VERSION = "0.0.16"
2
+ VERSION = "0.1"
3
3
  end
@@ -1,66 +1,66 @@
1
1
  require 'iron_mailer'
2
2
 
3
3
  describe IronMailer::MqMailer do
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.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
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.0.16
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: 2015-08-25 00:00:00.000000000 Z
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: '4.0'
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: '4.0'
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.2
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