ar_mailer_aws 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -2
- data/bin/ar_mailer_aws +14 -2
- data/lib/ar_mailer_aws.rb +1 -1
- data/lib/ar_mailer_aws/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 44303c25de4785259ee60573f99534f105d9d06c
|
4
|
+
data.tar.gz: 490efcb740a0ee53a5463e6522d677d47f38dc8b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2956195115b5145c191fc473352ffda7fa8277d1a26866884261081ea9d8549e6b2523ac465ed9ca298787c80dcaf439777ea2483f5ce74d1b0688f7c1a9e6c0
|
7
|
+
data.tar.gz: 7dc6a4182e3deec2151e9003bd78004de0a5f603935eda1d56cad770b37cbfed642e5563279fa5babf1f09437d2952031067c3439331de78f01f61eab754fa29
|
data/README.md
CHANGED
@@ -1,11 +1,12 @@
|
|
1
1
|
# ArMailerAWS
|
2
2
|
|
3
|
+
[![Build Status](https://travis-ci.org/leschenko/ar_mailer_aws.png?branch=master)](https://travis-ci.org/leschenko/ar_mailer_aws)
|
4
|
+
[![Dependency Status](https://gemnasium.com/leschenko/ar_mailer_aws.png)](https://gemnasium.com/leschenko/ar_mailer_aws)
|
5
|
+
|
3
6
|
Daemon for sending butches of emails via Amazon Simple Email Service (Amazon SES) using ActiveRecord for storing messages.
|
4
7
|
ArMailerAWS handles daily quotas, maximum number of emails send per second (max send rate),
|
5
8
|
batch email sending, expiring undelivered emails.
|
6
9
|
|
7
|
-
[![Build Status](https://travis-ci.org/leschenko/ar_mailer_aws.png?branch=master)](https://travis-ci.org/leschenko/ar_mailer_aws)
|
8
|
-
|
9
10
|
## Installation
|
10
11
|
|
11
12
|
Add this line to your application's Gemfile:
|
data/bin/ar_mailer_aws
CHANGED
@@ -23,11 +23,23 @@ unless name == 'rspec'
|
|
23
23
|
end
|
24
24
|
|
25
25
|
options = ArMailerAWS.parse_options(ARGV)
|
26
|
-
daemon_options =
|
26
|
+
daemon_options = {multiple: true}
|
27
|
+
daemon_options.update(dir_mode: :normal, dir: options.pid_dir) if options.pid_dir
|
28
|
+
|
27
29
|
Daemons.run_proc('ar_mailer_aws', daemon_options) do
|
30
|
+
# handle log files
|
28
31
|
if defined? Rails
|
29
32
|
ActiveRecord::Base.establish_connection
|
30
|
-
|
33
|
+
logger = ActiveSupport::BufferedLogger.new(Rails.root.join("log/#{Rails.env}.log"))
|
34
|
+
ActiveRecord::Base.logger = logger unless Rails.env.production?
|
35
|
+
Rails.logger = ActionMailer::Base.logger = logger
|
36
|
+
end
|
37
|
+
if ArMailerAWS.logger.respond_to?(:reopen)
|
38
|
+
ArMailerAWS.logger.reopen
|
39
|
+
ArMailerAWS.logger.info 'Started daemon'
|
31
40
|
end
|
41
|
+
AWS.config.logger.reopen if AWS.config.logger.respond_to?(:reopen)
|
42
|
+
|
43
|
+
# run mailer
|
32
44
|
ArMailerAWS.run(options)
|
33
45
|
end
|
data/lib/ar_mailer_aws.rb
CHANGED
@@ -18,7 +18,7 @@ module ArMailerAWS
|
|
18
18
|
mattr_accessor :logger
|
19
19
|
|
20
20
|
# error proc called when error occurred during delivering an email
|
21
|
-
# Example: lambda { |email, exception| ExceptionNotifier
|
21
|
+
# Example: lambda { |email, exception| ExceptionNotifier.notify_exception(exception, data: {email: email.attributes}) }
|
22
22
|
mattr_accessor :error_proc
|
23
23
|
|
24
24
|
class << self
|
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.3
|
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-12-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: daemons
|