mailcannon 0.1.0.pre.1 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/{ReadmeContributors.md → Contributors.md} +0 -9
- data/LICENSE +5 -0
- data/Readme.md +13 -8
- data/lib/mailcannon/adapters/sendgrid_web.rb +1 -1
- data/lib/mailcannon/version.rb +2 -2
- data/lib/mailcannon/workers/barrel.rb +5 -3
- data/spec/factories/envelope.rb +1 -1
- data/spec/integration/1k_spec.rb +12 -0
- data/spec/mailcannon/workers/barrel_spec.rb +1 -1
- metadata +9 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4acfbc79ce867041aa1926d5bb0512f0dd7b1c3c
|
4
|
+
data.tar.gz: f5ab84274ad16ce8f4666af4a30fd6a7717ccc7a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3ed1607ac090774e6b74864308a20af693178a753c73f4ee624f148a386085fd885b1fab8a0bed5a9d815517c7f57fb618a68fe7e9d04bca3034aa75c7e10f87
|
7
|
+
data.tar.gz: 42baaf87765890631ea0fbc5d49d4b57c4c9b563d56850db336d8c5bd95f09faab02eb4594be2f69691c64a7c6084de223d09f612ff8568c4bd81e1ae9cce45f
|
@@ -9,12 +9,3 @@ $ . ./env.sh # will load your dev env vars.
|
|
9
9
|
```
|
10
10
|
|
11
11
|
I miss Pry when I'm on [Rubinius](http://rubini.us/), so I do write the code on MRI and test on Rubinius once in a while. You will find that [Travis](https://travis-ci.org/) is your friend.
|
12
|
-
|
13
|
-
# Roadmap
|
14
|
-
|
15
|
-
- Rake task for creating all the indexes;
|
16
|
-
- Routing core;
|
17
|
-
- MapReduce for campaign deliverability statistics;
|
18
|
-
- Sidekiq recurrent job to run updates on MapReduce;
|
19
|
-
- Load testing;
|
20
|
-
- Stats Reports - (readonly) JSON HTTP API;
|
data/LICENSE
ADDED
data/Readme.md
CHANGED
@@ -1,18 +1,24 @@
|
|
1
|
-
[![Gem version](https://badge.fury.io/rb/mailcannon.png)](http://rubygems.org/gems/mailcannon) [![Code Climate](https://codeclimate.com/github/
|
1
|
+
[![Gem version](https://badge.fury.io/rb/mailcannon.png)](http://rubygems.org/gems/mailcannon) [![Code Climate](https://codeclimate.com/github/mailcannon/mailcannon.png)](https://codeclimate.com/github/mailcannon/mailcannon) [![Build Status](https://travis-ci.org/mailcannon/mailcannon.png?branch=master)](https://travis-ci.org/mailcannon/mailcannon) [![Coverage Status](https://coveralls.io/repos/lucasmartins/mailcannon/badge.png)](https://coveralls.io/r/mailcannon/mailcannon) [![Dependency Status](https://gemnasium.com/mailcannon/mailcannon.png)](https://gemnasium.com/mailcannon/mailcannon) [![Inline docs](http://inch-pages.github.io/github/mailcannon/mailcannon.png)](http://inch-pages.github.io/github/mailcannon/mailcannon) [![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/mailcannon/mailcannon/trend.png)](https://bitdeli.com/free "Bitdeli Badge")
|
2
2
|
|
3
3
|
![MailCannon_logo](http://blog.railsnapraia.com/images/mailcannon_seal_128.png)
|
4
4
|
|
5
5
|
MailCannon
|
6
6
|
==========
|
7
7
|
|
8
|
-
Although this is a **WORK IN PROGRESS**, we're getting great results
|
8
|
+
Although this is a **WORK IN PROGRESS**, we're getting great results at **production** environments.
|
9
9
|
|
10
|
-
This Gem relies heavily on
|
10
|
+
This Gem relies heavily on [Sidekiq](https://github.com/mperham/sidekiq), you are encouraged to use it anywhere with Ruby (a http interface is on the Roadmap ). You REALLY should buy [Sidekiq's Pro](http://sidekiq.org/pro/) license for serious deployments, check it out.
|
11
11
|
|
12
12
|
This Gem provides a worker ready for deploy cooked with [MongoDB](http://www.mongodb.org/) + [Mongoid](https://github.com/mongoid/mongoid) + [Sidekiq](https://github.com/mperham/sidekiq) + [Rubinius](http://rubini.us/) (feel free to use on MRI and jRuby as well).
|
13
13
|
|
14
14
|
For production deployment, you should take a look at both [MailCannon Outpost](https://github.com/lucasmartins/mailcannon-outpost) and [MailCannon Monitor](https://github.com/lucasmartins/mailcannon-monitor) projects.
|
15
15
|
|
16
|
+
Changelog
|
17
|
+
========
|
18
|
+
|
19
|
+
### 1.1
|
20
|
+
- Added retry to barrel
|
21
|
+
|
16
22
|
Install
|
17
23
|
=======
|
18
24
|
|
@@ -113,7 +119,6 @@ You can trigger the reduce operation directly with `envelope.reduce_statistics`.
|
|
113
119
|
|
114
120
|
Repeating events on the same target will increase the array: `"click"=>{"count"=>3.0, "targets"=>["3","3","3"]}`
|
115
121
|
|
116
|
-
|
117
122
|
Docs
|
118
123
|
====
|
119
124
|
You should check the [factories](https://github.com/lucasmartins/mailcannon/tree/master/spec/factories) to learn what you need to build your objects, and the [tests](https://github.com/lucasmartins/mailcannon/tree/master/spec/mailcannon) to learn how to use them. But hey, we have docs [right here](http://rdoc.info/github/lucasmartins/mailcannon/master/frames).
|
@@ -121,15 +126,15 @@ You should check the [factories](https://github.com/lucasmartins/mailcannon/tree
|
|
121
126
|
Roadmap
|
122
127
|
=======
|
123
128
|
|
124
|
-
-
|
129
|
+
- Load testing;
|
130
|
+
- Webhook service to receive Sendgrid events;
|
125
131
|
- Memory optimization (focused on MailCannon Outpost);
|
126
132
|
- HTTP (webservice) interface - so you don't need to be coding Ruby to use it!;
|
127
|
-
- New service adapter (Mandrill?);
|
128
133
|
|
129
134
|
Contribute
|
130
135
|
==========
|
131
136
|
|
132
|
-
Just fork [MailCannon](https://github.com/lucasmartins/mailcannon), add your feature+spec, and make a pull request.
|
137
|
+
Just fork [MailCannon](https://github.com/lucasmartins/mailcannon), add your feature+spec, and make a pull request. **DO NOT** mess up with the version file though.
|
133
138
|
|
134
139
|
**NOTICE**: The project is at embrionary stage, breaking changes will apply.
|
135
140
|
|
@@ -141,4 +146,4 @@ This is an opensource project so don't expect premium support, but don't be shy,
|
|
141
146
|
License
|
142
147
|
=======
|
143
148
|
|
144
|
-
|
149
|
+
Please see [LICENSE](https://github.com/lucasmartins/mailcannon/blob/master/LICENSE) for licensing details.
|
@@ -27,7 +27,7 @@ module MailCannon::Adapter::SendgridWeb
|
|
27
27
|
begin
|
28
28
|
self.auth || self.envelope_bag.auth || default_auth
|
29
29
|
rescue Exception => e
|
30
|
-
logger.
|
30
|
+
logger.warn "Unable to read auth config from Envelope or Bag, using default auth options from ENV"
|
31
31
|
return default_auth
|
32
32
|
end
|
33
33
|
end
|
data/lib/mailcannon/version.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# This worker handles Envelopes dispatch
|
2
2
|
class MailCannon::Barrel
|
3
3
|
include Sidekiq::Worker
|
4
|
-
|
4
|
+
|
5
5
|
def perform(envelope_id)
|
6
6
|
envelope_id = envelope_id['$oid'] if envelope_id['$oid']
|
7
7
|
shoot!(envelope_id)
|
@@ -20,8 +20,10 @@ class MailCannon::Barrel
|
|
20
20
|
end
|
21
21
|
rescue Mongoid::Errors::DocumentNotFound
|
22
22
|
logger.error "unable to find the document MailCannon::Envelope.find('#{envelope_id}')"
|
23
|
+
raise Mongoid::Errors::DocumentNotFound
|
23
24
|
rescue Exception => e
|
24
|
-
logger.error "unable to send MailCannon::Envelope.find('#{envelope_id}') #{e.backtrace}"
|
25
|
+
logger.error "unable to send MailCannon::Envelope.find('#{envelope_id}') #{e} #{e.backtrace}"
|
26
|
+
raise e
|
25
27
|
end
|
26
28
|
end
|
27
|
-
end
|
29
|
+
end
|
data/spec/factories/envelope.rb
CHANGED
@@ -21,7 +21,7 @@ FactoryGirl.define do
|
|
21
21
|
|
22
22
|
factory :envelope_multi_1k, class: MailCannon::Envelope do
|
23
23
|
mails = []
|
24
|
-
source = '
|
24
|
+
source = 'mailcannon+#@sink.sendgrid.net'
|
25
25
|
1000.times.each do |i|
|
26
26
|
mails.push source.gsub('#',i.to_s)
|
27
27
|
end
|
data/spec/integration/1k_spec.rb
CHANGED
@@ -22,3 +22,15 @@ describe "shoot 1k emails!" do
|
|
22
22
|
end
|
23
23
|
end
|
24
24
|
end
|
25
|
+
|
26
|
+
if ENV['SENDGRID_PASSWORD'] && !ENV['CI']
|
27
|
+
describe "shoot 1k real (@sink) emails!" do
|
28
|
+
let!(:envelope_a) { build(:envelope_multi_1k) }
|
29
|
+
it "sends http request for Sendgrid web API" do
|
30
|
+
Sidekiq::Testing.inline! do
|
31
|
+
envelope_a.post!
|
32
|
+
expect(envelope_a.reload.processed?).to be_true
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -12,7 +12,7 @@ describe MailCannon::Barrel do
|
|
12
12
|
it "looks for an existing MongoDB document" do
|
13
13
|
VCR.use_cassette('mailcannon_barrel_envelope_post') do
|
14
14
|
Sidekiq::Testing.inline! do
|
15
|
-
expect{envelope.post!}.not_to raise_error
|
15
|
+
expect{envelope.post!}.not_to raise_error
|
16
16
|
end
|
17
17
|
end
|
18
18
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mailcannon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lucas Martins
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-04-
|
11
|
+
date: 2014-04-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|
@@ -266,10 +266,11 @@ files:
|
|
266
266
|
- .ruby-version
|
267
267
|
- .travis.yml
|
268
268
|
- .yardopts
|
269
|
+
- Contributors.md
|
269
270
|
- Gemfile
|
271
|
+
- LICENSE
|
270
272
|
- Rakefile
|
271
273
|
- Readme.md
|
272
|
-
- ReadmeContributors.md
|
273
274
|
- config/locales/en.yml
|
274
275
|
- config/locales/pt-BR.yml
|
275
276
|
- env.sample.sh
|
@@ -298,6 +299,7 @@ files:
|
|
298
299
|
- spec/factories/stamp.rb
|
299
300
|
- spec/fixtures/cassettes/mailcannon_adapter_sendgrid_send.yml
|
300
301
|
- spec/fixtures/cassettes/mailcannon_adapter_sendgrid_send_bulk.yml
|
302
|
+
- spec/fixtures/cassettes/mailcannon_barrel_envelope_post.yml
|
301
303
|
- spec/fixtures/cassettes/mailcannon_integration_1k.yml
|
302
304
|
- spec/integration/1k_spec.rb
|
303
305
|
- spec/integration/full_stack_stats_spec.rb
|
@@ -330,12 +332,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
330
332
|
version: 1.9.3
|
331
333
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
332
334
|
requirements:
|
333
|
-
- - '
|
335
|
+
- - '>='
|
334
336
|
- !ruby/object:Gem::Version
|
335
|
-
version:
|
337
|
+
version: '0'
|
336
338
|
requirements: []
|
337
339
|
rubyforge_project:
|
338
|
-
rubygems_version: 2.
|
340
|
+
rubygems_version: 2.1.11
|
339
341
|
signing_key:
|
340
342
|
specification_version: 4
|
341
343
|
summary: A mass mailing tool for real threads aficionados
|
@@ -345,6 +347,7 @@ test_files:
|
|
345
347
|
- spec/factories/stamp.rb
|
346
348
|
- spec/fixtures/cassettes/mailcannon_adapter_sendgrid_send.yml
|
347
349
|
- spec/fixtures/cassettes/mailcannon_adapter_sendgrid_send_bulk.yml
|
350
|
+
- spec/fixtures/cassettes/mailcannon_barrel_envelope_post.yml
|
348
351
|
- spec/fixtures/cassettes/mailcannon_integration_1k.yml
|
349
352
|
- spec/integration/1k_spec.rb
|
350
353
|
- spec/integration/full_stack_stats_spec.rb
|