safety_mailer 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,10 +1,10 @@
1
1
  module SafetyMailer
2
2
  class Carrier
3
- attr_accessor :params
3
+ attr_accessor :matchers, :settings
4
4
  def initialize(params = {})
5
- self.params = params
5
+ self.matchers = params[:allowed_matchers] || []
6
+ self.settings = params[:delivery_method_settings] || {}
6
7
  delivery_method = params[:delivery_method] || :smtp
7
- settings = params[:delivery_method_settings] || {}
8
8
  @delivery_method = Mail::Configuration.instance.lookup_delivery_method(delivery_method).new(settings)
9
9
  end
10
10
  def log(msg)
@@ -12,7 +12,7 @@ module SafetyMailer
12
12
  end
13
13
  def deliver!(mail)
14
14
  mail.to = mail.to.reject do |recipient|
15
- if params[:allowed_matchers].any?{ |m| recipient =~ m }
15
+ if matchers.any?{ |m| recipient =~ m }
16
16
  false
17
17
  else
18
18
  log "*** safety_mailer suppressing mail to #{recipient}"
@@ -0,0 +1,3 @@
1
+ module SafetyMailer
2
+ VERSION = '0.0.4'
3
+ end
data/lib/safety_mailer.rb CHANGED
@@ -1,2 +1,3 @@
1
1
  require "safety_mailer/safety_mailer"
2
+ require "safety_mailer/version"
2
3
  require "safety_mailer/railtie" if defined? Rails
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: safety_mailer
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 23
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 3
10
- version: 0.0.3
9
+ - 4
10
+ version: 0.0.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Bill Kirtley
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-02-12 00:00:00 Z
18
+ date: 2013-05-03 00:00:00 Z
19
19
  dependencies: []
20
20
 
21
21
  description: Specify a domain (or set of domains, or magic word in email address) email is allowed to go to, and email to all other domains is silently dropped. Useful for testing and staging environments.
@@ -29,6 +29,7 @@ extra_rdoc_files: []
29
29
  files:
30
30
  - lib/safety_mailer/railtie.rb
31
31
  - lib/safety_mailer/safety_mailer.rb
32
+ - lib/safety_mailer/version.rb
32
33
  - lib/safety_mailer.rb
33
34
  - README.rdoc
34
35
  homepage: http://github.com/cluesque/safety_opener
@@ -60,7 +61,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
60
61
  requirements: []
61
62
 
62
63
  rubyforge_project:
63
- rubygems_version: 1.8.15
64
+ rubygems_version: 1.8.24
64
65
  signing_key:
65
66
  specification_version: 3
66
67
  summary: Restrict email sent by your application to only approved domains or accounts.