recoil 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b7681cd36e4fde7955fd8f33c5679f1fb212419f
4
- data.tar.gz: 94f28e1bd854a05f8a91aca5c0d40b4ebd368a94
3
+ metadata.gz: 2fc693767bb6d5351fe42011c2670e2301e188cc
4
+ data.tar.gz: 6c5ea9acc1b0944fb71684b775e2ba91f056c50a
5
5
  SHA512:
6
- metadata.gz: 8f508b60ed8ceccc4684b2a83fef3c26c6ae18a70b7756cd1df3d1a37d7cfd938fd94645b4f6fba436294d7ed58d52f23cc9d6040477166c4c0597fa731f1239
7
- data.tar.gz: 784668189d77b52da0971695b2ae8c36123e048847839c167ef4eb4a03dc9259dd8b99ebf6c2361e355a013ec8611c966d041e344e5b76dde374b708cc064aea
6
+ metadata.gz: fe4447797fa1192c2de8ca8761d1824120bff09733f395c55f2a4751127cbd3e3771a9fbf6c76ddaf9212c14e0f696c0890ed311e3544ad3e4659a799c6f6c45
7
+ data.tar.gz: 3f479a2893fee944f8b7dd61766e4449d9a4ff34f8bada9ee0d509ba159063c06f68b7ce3c2f5217997a1d72744a1f66f2ef9ac77112a328cbe56ab2d1e50e39
data/.gitignore CHANGED
@@ -12,3 +12,4 @@
12
12
  *.o
13
13
  *.a
14
14
  mkmf.log
15
+ .sqlite3
data/README.md CHANGED
@@ -1,4 +1,6 @@
1
1
  # Recoil
2
+ [![Gem Version](https://badge.fury.io/rb/recoil.svg)](http://badge.fury.io/rb/recoil)
3
+
2
4
  ![Recoil](http://nowthatsgangsta.com/wp-content/uploads/Sniper-Rrifle-Recoil.gif)
3
5
 
4
6
  Rails delivery method. Send via Amazon SES, but with local blacklist.
@@ -19,9 +21,9 @@ rake recoil:install:migrations
19
21
  rake db:migrate
20
22
  ```
21
23
 
22
- Change the action mailer delivery method:
24
+ Add an initializer: `config/initializers/recoil.rb` with the following content:
23
25
  ```ruby
24
- config.action_mailer.delivery_method = :recoil
26
+ ActionMailer::Base.register_interceptor(Recoil::Interceptor)
25
27
  ```
26
28
 
27
29
  Add endpoint to routes:
data/bin/rspec CHANGED
File without changes
data/lib/recoil/engine.rb CHANGED
@@ -1,11 +1,5 @@
1
1
  module Recoil
2
2
  class Engine < ::Rails::Engine
3
3
  isolate_namespace Recoil
4
-
5
- initializer "Add delivery method" do
6
- ActiveSupport.on_load :action_mailer do
7
- ActionMailer::Base.add_delivery_method :recoil, DeliveryMethod, {}
8
- end
9
- end
10
4
  end
11
5
  end
@@ -0,0 +1,7 @@
1
+ class Interceptor
2
+ def self.delivering_email(message)
3
+ if Email.blacklisted?(email['to'])
4
+ message.perform_deliveries = false
5
+ end
6
+ end
7
+ end
@@ -1,3 +1,3 @@
1
1
  module Recoil
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
data/lib/recoil.rb CHANGED
@@ -1,7 +1,7 @@
1
+ require 'recoil/email'
1
2
  require 'recoil/engine'
2
- require 'recoil/delivery_method'
3
+ require 'recoil/interceptor'
3
4
  require 'recoil/message'
4
- require 'recoil/email'
5
5
 
6
6
  module Recoil
7
7
  mattr_accessor :blacklist_threshold
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: recoil
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brightin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-05 00:00:00.000000000 Z
11
+ date: 2015-03-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -130,9 +130,9 @@ files:
130
130
  - config/routes.rb
131
131
  - db/migrate/20150305152728_add_emails_table.rb
132
132
  - lib/recoil.rb
133
- - lib/recoil/delivery_method.rb
134
133
  - lib/recoil/email.rb
135
134
  - lib/recoil/engine.rb
135
+ - lib/recoil/interceptor.rb
136
136
  - lib/recoil/message.rb
137
137
  - lib/recoil/message/abstract.rb
138
138
  - lib/recoil/message/notification.rb
@@ -177,7 +177,6 @@ files:
177
177
  - spec/dummy/config/secrets.yml
178
178
  - spec/dummy/db/development.sqlite3
179
179
  - spec/dummy/db/schema.rb
180
- - spec/dummy/db/test.sqlite3
181
180
  - spec/dummy/lib/assets/.keep
182
181
  - spec/dummy/public/404.html
183
182
  - spec/dummy/public/422.html
@@ -253,7 +252,6 @@ test_files:
253
252
  - spec/dummy/config/secrets.yml
254
253
  - spec/dummy/db/development.sqlite3
255
254
  - spec/dummy/db/schema.rb
256
- - spec/dummy/db/test.sqlite3
257
255
  - spec/dummy/lib/assets/.keep
258
256
  - spec/dummy/public/404.html
259
257
  - spec/dummy/public/422.html
@@ -1,16 +0,0 @@
1
- require 'aws-sdk'
2
-
3
- module Recoil
4
- class DeliveryMethod
5
- attr_accessor :settings
6
-
7
- def initialize(options = {})
8
- @settings = options
9
- end
10
-
11
- def deliver!(email)
12
- return if Email.blacklisted?(email['to'])
13
- AWS::SimpleEmailService.new.send_raw_email(email)
14
- end
15
- end
16
- end
Binary file