mail_gate 1.1.1 → 1.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -26,7 +26,7 @@ module MailGate
26
26
 
27
27
  def initialize(settings = {})
28
28
  self.settings = settings
29
- @whitelist = Regexp.new(settings.delete(:whitelist) || /.*/)
29
+ @whitelist = Regexp.new(settings.fetch(:whitelist, /.*/))
30
30
  delivery_method = settings.fetch(:delivery_method, :test)
31
31
  delivery_settings = settings.fetch(:delivery_settings, {})
32
32
  @delivery_method = Mail::Configuration.instance.lookup_delivery_method(delivery_method).new(delivery_settings)
@@ -1,3 +1,3 @@
1
1
  module MailGate
2
- VERSION = '1.1.1'
2
+ VERSION = '1.1.2'
3
3
  end
@@ -28,7 +28,7 @@ class Test::Unit::TestCase
28
28
  # Returns instance of Mail::Message.
29
29
  def with_whitelist(options={})
30
30
  filter = MailGate::Filter.new \
31
- :whitelist => options.delete(:whitelist),
31
+ :whitelist => options.fetch(:whitelist, /.*/),
32
32
  :subject_prefix => options.delete(:subject_prefix),
33
33
  :append_emails => options.delete(:append_emails)
34
34
 
@@ -9,7 +9,7 @@ class TestFilter < Test::Unit::TestCase
9
9
  def test_with_whitelist_as_string
10
10
  mail = with_whitelist \
11
11
  :to => 'garrett@site.com',
12
- :whitelist => '@site.com'
12
+ :whitelist => /\@site.com/
13
13
  assert_equal %w{ garrett@site.com }, mail.to
14
14
  end
15
15
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mail_gate
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-03-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: mail
16
- requirement: &70253804795520 !ruby/object:Gem::Requirement
16
+ requirement: &70211421077700 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70253804795520
24
+ version_requirements: *70211421077700
25
25
  description: MailGate is an additional delivery method for the Mail gem that lets
26
26
  you restrict the delivery of mail to only whitelisted emails.
27
27
  email:
@@ -57,7 +57,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
57
57
  version: '0'
58
58
  segments:
59
59
  - 0
60
- hash: -4430125675642506806
60
+ hash: 3389828814842690469
61
61
  required_rubygems_version: !ruby/object:Gem::Requirement
62
62
  none: false
63
63
  requirements:
@@ -66,7 +66,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
66
66
  version: '0'
67
67
  segments:
68
68
  - 0
69
- hash: -4430125675642506806
69
+ hash: 3389828814842690469
70
70
  requirements: []
71
71
  rubyforge_project:
72
72
  rubygems_version: 1.8.17