ar_mailer_aws 0.0.1 → 0.0.2
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 +4 -4
- data/.travis.yml +0 -1
- data/README.md +15 -8
- data/ar_mailer_aws.gemspec +1 -1
- data/bin/ar_mailer_aws +2 -1
- data/lib/ar_mailer_aws.rb +5 -0
- data/lib/ar_mailer_aws/sender.rb +0 -2
- data/lib/ar_mailer_aws/version.rb +1 -1
- data/spec/ar_mailer_aws/ar_mailer_aws_spec.rb +1 -1
- data/spec/ar_mailer_aws/mailer_spec.rb +1 -1
- data/spec/ar_mailer_aws/parse_options_spec.rb +4 -0
- data/spec/spec_helper.rb +1 -0
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3e5ef5bbb9f48e6714ba614f7b1dc4a9c0a44945
|
4
|
+
data.tar.gz: f36e2db8f3607aba94ad5ce1ce26eb803a4bee8a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2508486000bc5233f392c44405e4a06f94b560f72342703d793ce2a1250a1c6fe805f130b05e61790b2b66a9ab7bf6f431e4cd094c3729fac41cfdb56762db43
|
7
|
+
data.tar.gz: b1626ae04aa537e21165abcdaa29e4a64d5e3b00dcab89873ceea9b9cbbab04d9b5dfcd4900dff702c246df244958e361aaf5880eee80d62d5277d14edb5c2f1
|
data/README.md
CHANGED
@@ -1,7 +1,10 @@
|
|
1
1
|
# ArMailerAWS
|
2
2
|
|
3
|
-
Daemon for sending butches of emails via Amazon Simple Email Service (Amazon SES) using ActiveRecord for storing messages
|
3
|
+
Daemon for sending butches of emails via Amazon Simple Email Service (Amazon SES) using ActiveRecord for storing messages.
|
4
|
+
ArMailerAWS handles daily quotas, maximum number of emails send per second (max send rate),
|
5
|
+
batch email sending, expiring undelivered emails.
|
4
6
|
|
7
|
+
[](https://travis-ci.org/leschenko/ar_mailer_aws)
|
5
8
|
|
6
9
|
## Installation
|
7
10
|
|
@@ -13,10 +16,6 @@ And then execute:
|
|
13
16
|
|
14
17
|
$ bundle
|
15
18
|
|
16
|
-
Or install it yourself as:
|
17
|
-
|
18
|
-
$ gem install ar_mailer_aws
|
19
|
-
|
20
19
|
Run generator:
|
21
20
|
|
22
21
|
$ rails g ar_mailer_aws BatchEmail
|
@@ -25,23 +24,31 @@ Run migrations:
|
|
25
24
|
|
26
25
|
$ rake db:migrate
|
27
26
|
|
27
|
+
Or install it yourself as:
|
28
|
+
|
29
|
+
$ gem install ar_mailer_aws
|
30
|
+
|
28
31
|
## Usage
|
29
32
|
|
30
|
-
|
33
|
+
To use `ar_mailer_aws` as default delivery method edit `config/initializer/ar_mailer_aws.rb` and uncomment below line:
|
31
34
|
|
35
|
+
```ruby
|
32
36
|
ActionMailer::Base.delivery_method = :ar_mailer_aws
|
37
|
+
```
|
33
38
|
|
34
|
-
|
39
|
+
If you need `ar_mailer_aws` delivery method in particular mailer:
|
35
40
|
|
41
|
+
```ruby
|
36
42
|
class MyMailer < ActionMailer::Base
|
37
43
|
self.delivery_method = :ar_mailer_aws
|
38
44
|
end
|
45
|
+
```
|
39
46
|
|
40
47
|
Run delivery daemon:
|
41
48
|
|
42
49
|
$ bundle exec ar_mailer_aws start
|
43
50
|
|
44
|
-
|
51
|
+
List available options:
|
45
52
|
|
46
53
|
$ bundle exec ar_mailer_aws --help
|
47
54
|
|
data/ar_mailer_aws.gemspec
CHANGED
@@ -8,7 +8,7 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.version = ArMailerAWS::VERSION
|
9
9
|
spec.authors = ['Alex Leschenko']
|
10
10
|
spec.email = %w(leschenko.al@gmail.com)
|
11
|
-
spec.description = %q{Daemon for sending butches of emails via Amazon
|
11
|
+
spec.description = %q{Daemon for sending butches of emails via Amazon SES using ActiveRecord for storing messages. Handles daily quotas, max send rate.}
|
12
12
|
spec.summary = %q{Send butches of emails via Amazon SES}
|
13
13
|
spec.homepage = 'https://github.com/leschenko/ar_mailer_aws'
|
14
14
|
spec.license = 'MIT'
|
data/bin/ar_mailer_aws
CHANGED
@@ -23,7 +23,8 @@ unless name == 'rspec'
|
|
23
23
|
end
|
24
24
|
|
25
25
|
options = ArMailerAWS.parse_options(ARGV)
|
26
|
-
|
26
|
+
daemon_options = options.pid_dir ? {dir_mode: :normal, dir: options.pid_dir} : {}
|
27
|
+
Daemons.run_proc('ar_mailer_aws', daemon_options) do
|
27
28
|
if defined? Rails
|
28
29
|
ActiveRecord::Base.establish_connection
|
29
30
|
Rails.logger = ActiveRecord::Base.logger = ActionMailer::Base.logger = ActiveSupport::BufferedLogger.new(Rails.root.join("log/#{Rails.env}.log"))
|
data/lib/ar_mailer_aws.rb
CHANGED
@@ -95,6 +95,11 @@ module ArMailerAWS
|
|
95
95
|
options.max_age = max_age
|
96
96
|
end
|
97
97
|
|
98
|
+
opts.on('-p', '--pid-dir DIRECTORY', 'Directory for storing pid file',
|
99
|
+
'Default: Stored in current directory (named `ar_mailer_aws.pid`)') do |pid_dir|
|
100
|
+
options.pid_dir = pid_dir
|
101
|
+
end
|
102
|
+
|
98
103
|
opts.on('-v', '--[no-]verbose', 'Run verbosely') do |v|
|
99
104
|
options.verbose = v
|
100
105
|
end
|
data/lib/ar_mailer_aws/sender.rb
CHANGED
@@ -9,7 +9,7 @@ describe ArMailerAWS::Mailer do
|
|
9
9
|
|
10
10
|
context 'delivering' do
|
11
11
|
before do
|
12
|
-
@mail =
|
12
|
+
@mail = double('Mail')
|
13
13
|
@mail.stub(:return_path).and_return('from@example.com')
|
14
14
|
@mail.stub(:destinations).and_return(['to@example.com'])
|
15
15
|
@mail.stub(:encoded).and_return('email content')
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ar_mailer_aws
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Leschenko
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-11-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: daemons
|
@@ -136,8 +136,8 @@ dependencies:
|
|
136
136
|
- - '>='
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: '3.0'
|
139
|
-
description: Daemon for sending butches of emails via Amazon
|
140
|
-
|
139
|
+
description: Daemon for sending butches of emails via Amazon SES using ActiveRecord
|
140
|
+
for storing messages. Handles daily quotas, max send rate.
|
141
141
|
email:
|
142
142
|
- leschenko.al@gmail.com
|
143
143
|
executables:
|
@@ -187,7 +187,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
187
187
|
version: '0'
|
188
188
|
requirements: []
|
189
189
|
rubyforge_project:
|
190
|
-
rubygems_version: 2.0.
|
190
|
+
rubygems_version: 2.0.2
|
191
191
|
signing_key:
|
192
192
|
specification_version: 4
|
193
193
|
summary: Send butches of emails via Amazon SES
|