sanitize_email 1.0.10 → 1.0.11
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +3 -0
- data/CHANGELOG.md +6 -0
- data/LICENSE +1 -1
- data/README.md +36 -12
- data/REEK +15 -5
- data/lib/sanitize_email.rb +2 -2
- data/lib/sanitize_email/bleach.rb +2 -2
- data/lib/sanitize_email/config.rb +3 -0
- data/lib/sanitize_email/deprecation.rb +2 -0
- data/lib/sanitize_email/engine.rb +2 -2
- data/lib/sanitize_email/mail_header_tools.rb +2 -0
- data/lib/sanitize_email/overridden_addresses.rb +2 -0
- data/lib/sanitize_email/railtie.rb +3 -3
- data/lib/sanitize_email/rspec_matchers.rb +2 -0
- data/lib/sanitize_email/test_helpers.rb +2 -0
- data/lib/sanitize_email/version.rb +3 -3
- data/sanitize_email.gemspec +2 -2
- data/spec/sanitize_email_spec.rb +5 -1
- data/spec/spec_helper.rb +9 -2
- metadata +10 -10
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
Version 1.0.11 - DEC.30.2013
|
2
|
+
* Fix travis build by Peter Boling
|
3
|
+
* Fix test suite to run on Ruby 1.8.7 again, add back to Travis by Peter Boling
|
4
|
+
* Add mode badges to Readme by Peter Boling
|
5
|
+
* Improve Readme by Peter Boling
|
6
|
+
|
1
7
|
Version 1.0.10 - NOV.24.2013
|
2
8
|
* Expand test suite to test against all supported versions of ActionMailer and Railties gems by Peter Boling
|
3
9
|
* Add Coveralls by Peter Boling
|
data/LICENSE
CHANGED
data/README.md
CHANGED
@@ -1,28 +1,32 @@
|
|
1
|
-
# sanitize_email
|
1
|
+
# sanitize_email
|
2
2
|
|
3
|
-
This gem allows you to override your mail delivery settings, globally or in a local context.
|
4
|
-
|
5
|
-
* compatible with Rails >= 3.X (since v1.0.5)
|
6
|
-
* compatible with any Ruby app with a Mail handler that uses the `register_interceptor` API (a la ActionMailer and Mail gems)
|
7
|
-
* configure it and forget it
|
8
|
-
* little configuration required
|
9
|
-
* solves common problems in ruby web applications that use email
|
10
|
-
* provides test helpers and spec matchers to assist with testing email content delivery
|
11
|
-
|
12
|
-
## Summary
|
3
|
+
This gem allows you to override your mail delivery settings, globally or in a local context.
|
13
4
|
|
14
5
|
| Project | Sanitize Email |
|
15
6
|
|------------------------ | ----------------- |
|
16
7
|
| gem name | sanitize_email |
|
17
8
|
| license | MIT |
|
9
|
+
| moldiness | [![Maintainer Status](http://stillmaintained.com/pboling/sanitize_email.png)](http://stillmaintained.com/pboling/sanitize_email) |
|
18
10
|
| version | [![Gem Version](https://badge.fury.io/rb/sanitize_email.png)](http://badge.fury.io/rb/sanitize_email) |
|
19
11
|
| dependencies | [![Dependency Status](https://gemnasium.com/pboling/sanitize_email.png)](https://gemnasium.com/pboling/sanitize_email) |
|
20
12
|
| code quality | [![Code Climate](https://codeclimate.com/github/pboling/sanitize_email.png)](https://codeclimate.com/github/pboling/sanitize_email) |
|
21
13
|
| continuous integration | [![Build Status](https://secure.travis-ci.org/pboling/sanitize_email.png?branch=master)](https://travis-ci.org/pboling/sanitize_email) |
|
14
|
+
| test coverage | [![Coverage Status](https://coveralls.io/repos/pboling/sanitize_email/badge.png)](https://coveralls.io/r/pboling/sanitize_email) |
|
22
15
|
| homepage | [https://github.com/pboling/sanitize_email][homepage] |
|
23
16
|
| documentation | [http://rdoc.info/github/pboling/sanitize_email/frames][documentation] |
|
24
|
-
| author | [Peter Boling](https://coderbits.com/pboling)
|
17
|
+
| author | [Peter Boling](https://coderbits.com/pboling) |
|
18
|
+
| Spread ~♡ⓛⓞⓥⓔ♡~ | [![Endorse Me](https://api.coderwall.com/pboling/endorsecount.png)](http://coderwall.com/pboling) |
|
19
|
+
|
20
|
+
## Summary
|
25
21
|
|
22
|
+
It's particularly helpful when you want to prevent the delivery of email (e.g. in development/test environments) or alter the to/cc/bcc (e.g. in staging or demo environments) of all email generated from your application.
|
23
|
+
|
24
|
+
* compatible with Rails >= 3.X (since v1.0.5)
|
25
|
+
* compatible with any Ruby app with a Mail handler that uses the `register_interceptor` API (a la ActionMailer and Mail gems)
|
26
|
+
* configure it and forget it
|
27
|
+
* little configuration required
|
28
|
+
* solves common problems in ruby web applications that use email
|
29
|
+
* provides test helpers and spec matchers to assist with testing email content delivery
|
26
30
|
|
27
31
|
## Working Locally with Production Data
|
28
32
|
|
@@ -130,6 +134,22 @@ John Trupiano did the initial gemification and some refactoring.
|
|
130
134
|
|
131
135
|
See the [Network View](https://github.com/pboling/sanitize_email/network) and the [CHANGELOG](https://github.com/pboling/sanitize_email/blob/master/CHANGELOG.md)
|
132
136
|
|
137
|
+
## How you can help!
|
138
|
+
|
139
|
+
Take a look at the `reek` list which is the file called `REEK` and stat fixing things. Once you complete a change, run the tests:
|
140
|
+
|
141
|
+
```
|
142
|
+
bundle exec rake test:all
|
143
|
+
```
|
144
|
+
|
145
|
+
If the tests pass refresh the `reek` list:
|
146
|
+
|
147
|
+
```
|
148
|
+
bundle exec rake reek > REEK
|
149
|
+
```
|
150
|
+
|
151
|
+
Follow the instructions for "Contributing" below.
|
152
|
+
|
133
153
|
## Contributing
|
134
154
|
|
135
155
|
1. Fork it
|
@@ -174,3 +194,7 @@ For example:
|
|
174
194
|
[peterboling]: http://www.peterboling.com
|
175
195
|
[documentation]: http://rdoc.info/github/pboling/sanitize_email/frames
|
176
196
|
[homepage]: https://github.com/pboling/sanitize_email
|
197
|
+
|
198
|
+
|
199
|
+
[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/pboling/sanitize_email/trend.png)](https://bitdeli.com/free "Bitdeli Badge")
|
200
|
+
|
data/REEK
CHANGED
@@ -1,6 +1,13 @@
|
|
1
|
-
lib/sanitize_email
|
2
|
-
SanitizeEmail
|
3
|
-
SanitizeEmail
|
1
|
+
lib/sanitize_email.rb -- 3 warnings:
|
2
|
+
SanitizeEmail#self.sanitary calls SanitizeEmail::Config.config twice (DuplicateMethodCall)
|
3
|
+
SanitizeEmail#self.sanitary has approx 6 statements (TooManyStatements)
|
4
|
+
SanitizeEmail::MissingBlockParameter has no descriptive comment (IrresponsibleModule)
|
5
|
+
lib/sanitize_email/bleach.rb -- 5 warnings:
|
6
|
+
SanitizeEmail::Bleach#delivering_email has approx 6 statements (TooManyStatements)
|
7
|
+
SanitizeEmail::Bleach#delivering_email has the variable name 'o' (UncommunicativeVariableName)
|
8
|
+
SanitizeEmail::Bleach#delivering_email refers to message more than self (FeatureEnvy)
|
9
|
+
SanitizeEmail::Bleach#delivering_email refers to o more than self (FeatureEnvy)
|
10
|
+
SanitizeEmail::Bleach#sanitize_engaged? has approx 6 statements (TooManyStatements)
|
4
11
|
lib/sanitize_email/config.rb -- 4 warnings:
|
5
12
|
SanitizeEmail::Config has no descriptive comment (IrresponsibleModule)
|
6
13
|
SanitizeEmail::Config#self.configure calls @config[:force_sanitize] twice (DuplicateMethodCall)
|
@@ -11,20 +18,23 @@ lib/sanitize_email/deprecation.rb -- 2 warnings:
|
|
11
18
|
SanitizeEmail::Deprecation#deprecation is controlled by argument replacement (ControlParameter)
|
12
19
|
lib/sanitize_email/engine.rb -- 1 warning:
|
13
20
|
SanitizeEmail::Engine has no descriptive comment (IrresponsibleModule)
|
14
|
-
lib/sanitize_email/mail_header_tools.rb --
|
21
|
+
lib/sanitize_email/mail_header_tools.rb -- 8 warnings:
|
15
22
|
SanitizeEmail::MailHeaderTools#self.add_original_addresses_as_headers has the variable name 'k' (UncommunicativeVariableName)
|
16
23
|
SanitizeEmail::MailHeaderTools#self.add_original_addresses_as_headers has the variable name 'v' (UncommunicativeVariableName)
|
17
24
|
SanitizeEmail::MailHeaderTools#self.prepend_environment_to_subject calls Rails.env twice (DuplicateMethodCall)
|
25
|
+
SanitizeEmail::MailHeaderTools#self.update_header calls (index + 1) twice (DuplicateMethodCall)
|
18
26
|
SanitizeEmail::MailHeaderTools#self.update_header has the parameter name 'k' (UncommunicativeParameterName)
|
19
27
|
SanitizeEmail::MailHeaderTools#self.update_header has the parameter name 'v' (UncommunicativeParameterName)
|
20
28
|
SanitizeEmail::MailHeaderTools#self.update_header has the variable name 'a' (UncommunicativeVariableName)
|
21
29
|
SanitizeEmail::MailHeaderTools#self.update_header is controlled by argument v (ControlParameter)
|
22
|
-
lib/sanitize_email/overridden_addresses.rb --
|
30
|
+
lib/sanitize_email/overridden_addresses.rb -- 7 warnings:
|
23
31
|
SanitizeEmail::OverriddenAddresses has no descriptive comment (IrresponsibleModule)
|
24
32
|
SanitizeEmail::OverriddenAddresses#inject_user_names contains iterators nested 2 deep (NestedIterators)
|
25
33
|
SanitizeEmail::OverriddenAddresses#inject_user_names doesn't depend on instance state (UtilityFunction)
|
26
34
|
SanitizeEmail::OverriddenAddresses#inject_user_names refers to real_recipient more than self (FeatureEnvy)
|
27
35
|
SanitizeEmail::OverriddenAddresses#override_email has approx 10 statements (TooManyStatements)
|
36
|
+
SanitizeEmail::OverriddenAddresses::MissingTo has no descriptive comment (IrresponsibleModule)
|
37
|
+
SanitizeEmail::OverriddenAddresses::UnknownOverride has no descriptive comment (IrresponsibleModule)
|
28
38
|
lib/sanitize_email/railtie.rb -- 1 warning:
|
29
39
|
SanitizeEmail::Railtie has no descriptive comment (IrresponsibleModule)
|
30
40
|
lib/sanitize_email/rspec_matchers.rb -- 2 warnings:
|
data/lib/sanitize_email.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
#Copyright (c) 2008-
|
2
|
-
#Released under the MIT license
|
1
|
+
# Copyright (c) 2008-13 Peter H. Boling of RailsBling.com
|
2
|
+
# Released under the MIT license
|
3
3
|
|
4
4
|
module SanitizeEmail
|
5
5
|
# SanitizeEmail::Bleach determines whether to sanitize the headers of an email, and does so when appropriate.
|
@@ -1,6 +1,6 @@
|
|
1
|
-
#Copyright (c) 2008-
|
2
|
-
#Released under the MIT license
|
3
|
-
# For Rails 3.0, which didn't yet support Engines
|
1
|
+
# Copyright (c) 2008-13 Peter H. Boling of RailsBling.com
|
2
|
+
# Released under the MIT license
|
3
|
+
# For Rails 3.0, which didn't yet support Engines
|
4
4
|
module SanitizeEmail
|
5
5
|
class Railtie < ::Rails::Railtie
|
6
6
|
|
data/sanitize_email.gemspec
CHANGED
@@ -30,8 +30,8 @@ Gem::Specification.new do |s|
|
|
30
30
|
#s.add_runtime_dependency(%q<facets>, ["> 0"])
|
31
31
|
|
32
32
|
# Development Dependencies
|
33
|
-
s.add_development_dependency(%q<rails>, ["
|
34
|
-
s.add_development_dependency(%q<actionmailer>, ["
|
33
|
+
s.add_development_dependency(%q<rails>, [">= 3.0"])
|
34
|
+
s.add_development_dependency(%q<actionmailer>, [">= 3.0"])
|
35
35
|
s.add_development_dependency(%q<letter_opener>, [">= 0"])
|
36
36
|
s.add_development_dependency(%q<launchy>, [">= 0"])
|
37
37
|
s.add_development_dependency(%q<rspec>, [">= 2.11"])
|
data/spec/sanitize_email_spec.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# Copyright (c) 2008-13 Peter H. Boling of RailsBling.com
|
2
|
+
# Released under the MIT license
|
1
3
|
require 'spec_helper'
|
2
4
|
|
3
5
|
#
|
@@ -21,7 +23,9 @@ describe SanitizeEmail do
|
|
21
23
|
after(:each) do
|
22
24
|
SanitizeEmail::Config.config = SanitizeEmail::Config::DEFAULTS
|
23
25
|
SanitizeEmail.force_sanitize = nil
|
24
|
-
|
26
|
+
# The following works with Ruby > 1.9, but to make the test suite run on 18.7 we need a little help
|
27
|
+
# Mail.class_variable_get(:@@delivery_interceptors).pop
|
28
|
+
Mail.send(:class_variable_get, :@@delivery_interceptors).pop
|
25
29
|
end
|
26
30
|
|
27
31
|
def sanitize_spec_dryer(rails_env = 'test')
|
data/spec/spec_helper.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
# Copyright (c) 2008-13 Peter H. Boling of RailsBling.com
|
2
|
+
# Released under the MIT license
|
3
3
|
require 'launchy'
|
4
4
|
require 'mail'
|
5
5
|
require 'rails'
|
@@ -7,6 +7,13 @@ require 'letter_opener'
|
|
7
7
|
require 'action_mailer'
|
8
8
|
require 'email_spec'
|
9
9
|
|
10
|
+
# For code coverage, must be required before all application / gem / library code.
|
11
|
+
require 'coveralls'
|
12
|
+
Coveralls.wear!
|
13
|
+
|
14
|
+
require 'sanitize_email'
|
15
|
+
require 'sanitize_email/rspec_matchers'
|
16
|
+
|
10
17
|
# Requires supporting files with custom matchers and macros, etc,
|
11
18
|
# in ./support/ and its subdirectories.
|
12
19
|
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sanitize_email
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.11
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -11,40 +11,40 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2013-
|
14
|
+
date: 2013-12-30 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: rails
|
18
18
|
requirement: !ruby/object:Gem::Requirement
|
19
19
|
none: false
|
20
20
|
requirements:
|
21
|
-
- - ! '
|
21
|
+
- - ! '>='
|
22
22
|
- !ruby/object:Gem::Version
|
23
|
-
version: '3'
|
23
|
+
version: '3.0'
|
24
24
|
type: :development
|
25
25
|
prerelease: false
|
26
26
|
version_requirements: !ruby/object:Gem::Requirement
|
27
27
|
none: false
|
28
28
|
requirements:
|
29
|
-
- - ! '
|
29
|
+
- - ! '>='
|
30
30
|
- !ruby/object:Gem::Version
|
31
|
-
version: '3'
|
31
|
+
version: '3.0'
|
32
32
|
- !ruby/object:Gem::Dependency
|
33
33
|
name: actionmailer
|
34
34
|
requirement: !ruby/object:Gem::Requirement
|
35
35
|
none: false
|
36
36
|
requirements:
|
37
|
-
- - ! '
|
37
|
+
- - ! '>='
|
38
38
|
- !ruby/object:Gem::Version
|
39
|
-
version: '3'
|
39
|
+
version: '3.0'
|
40
40
|
type: :development
|
41
41
|
prerelease: false
|
42
42
|
version_requirements: !ruby/object:Gem::Requirement
|
43
43
|
none: false
|
44
44
|
requirements:
|
45
|
-
- - ! '
|
45
|
+
- - ! '>='
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '3'
|
47
|
+
version: '3.0'
|
48
48
|
- !ruby/object:Gem::Dependency
|
49
49
|
name: letter_opener
|
50
50
|
requirement: !ruby/object:Gem::Requirement
|