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 CHANGED
@@ -1,5 +1,6 @@
1
1
  language: ruby
2
2
  rvm:
3
+ - 1.8.7
3
4
  - 1.9.2
4
5
  - 1.9.3
5
6
  - 2.0.0
@@ -17,3 +18,5 @@ matrix:
17
18
  gemfile: gemfiles/Gemfile.rails-4.0.x
18
19
  - rvm: 1.9.2
19
20
  gemfile: gemfiles/Gemfile.rails-4.0.x
21
+ - rvm: jruby-19mode
22
+ gemfile: gemfiles/Gemfile.rails-3.0.x
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
@@ -1,4 +1,4 @@
1
- Copyright (c) 2008-2013 Peter H. Boling of 9thBit LLC
1
+ Copyright (c) 2008-2013 Peter H. Boling of RailsBling.com
2
2
 
3
3
  MIT License
4
4
 
data/README.md CHANGED
@@ -1,28 +1,32 @@
1
- # sanitize_email [![Gem Version](https://badge.fury.io/rb/sanitize_email.png)](http://badge.fury.io/rb/sanitize_email) [![Build Status](https://secure.travis-ci.org/pboling/sanitize_email.png?branch=master)](https://travis-ci.org/pboling/sanitize_email) [![Code Climate](https://codeclimate.com/github/pboling/sanitize_email.png)](https://codeclimate.com/github/pboling/sanitize_email) [![Coverage Status](https://coveralls.io/repos/pboling/sanitize_email/badge.png)](https://coveralls.io/r/pboling/sanitize_email) [![Dependency Status](https://gemnasium.com/pboling/sanitize_email.png)](https://gemnasium.com/pboling/sanitize_email) [![Endorse Me](http://api.coderwall.com/pboling/endorsecount.png)](http://api.coderwall.com/pboling/endorsecount.png)
1
+ # sanitize_email
2
2
 
3
- This gem allows you to override your mail delivery settings, globally or in a local context. 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.
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) [![Endorse Me](http://api.coderwall.com/pboling/endorsecount.png)](http://api.coderwall.com/pboling/endorsecount.png) |
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/bleach.rb -- 2 warnings:
2
- SanitizeEmail::Bleach::MissingTo has no descriptive comment (IrresponsibleModule)
3
- SanitizeEmail::Bleach::UnknownOverride has no descriptive comment (IrresponsibleModule)
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 -- 7 warnings:
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 -- 5 warnings:
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:
@@ -1,5 +1,5 @@
1
- #Copyright (c) 2008-12 Peter H. Boling of 9thBit LLC
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
  require 'sanitize_email/version'
@@ -1,5 +1,5 @@
1
- #Copyright (c) 2008-12 Peter H. Boling of 9thBit LLC
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,3 +1,6 @@
1
+ # Copyright (c) 2008-13 Peter H. Boling of RailsBling.com
2
+ # Released under the MIT license
3
+
1
4
  module SanitizeEmail
2
5
  class Config
3
6
 
@@ -1,3 +1,5 @@
1
+ # Copyright (c) 2008-13 Peter H. Boling of RailsBling.com
2
+ # Released under the MIT license
1
3
  # See http://www.seejohncode.com/2012/01/09/deprecating-methods-in-ruby/
2
4
  #require 'facets/module/mattr' # gives cattr
3
5
 
@@ -1,5 +1,5 @@
1
- #Copyright (c) 2008-12 Peter H. Boling of 9thBit LLC
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
  # For Rails >= 3.1
4
4
  module SanitizeEmail
5
5
  class Engine < ::Rails::Engine
@@ -1,3 +1,5 @@
1
+ # Copyright (c) 2008-13 Peter H. Boling of RailsBling.com
2
+ # Released under the MIT license
1
3
  module SanitizeEmail
2
4
  module MailHeaderTools
3
5
 
@@ -1,3 +1,5 @@
1
+ # Copyright (c) 2008-13 Peter H. Boling of RailsBling.com
2
+ # Released under the MIT license
1
3
  module SanitizeEmail
2
4
  class OverriddenAddresses
3
5
 
@@ -1,6 +1,6 @@
1
- #Copyright (c) 2008-12 Peter H. Boling of 9thBit LLC
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
 
@@ -1,3 +1,5 @@
1
+ # Copyright (c) 2008-13 Peter H. Boling of RailsBling.com
2
+ # Released under the MIT license
1
3
  require 'sanitize_email/test_helpers'
2
4
 
3
5
  module SanitizeEmail
@@ -1,3 +1,5 @@
1
+ # Copyright (c) 2008-13 Peter H. Boling of RailsBling.com
2
+ # Released under the MIT license
1
3
  module SanitizeEmail
2
4
  module TestHelpers
3
5
  class UnexpectedMailType < StandardError; end
@@ -1,5 +1,5 @@
1
- #Copyright (c) 2008-12 Peter H. Boling of 9thBit LLC
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
  module SanitizeEmail
4
- VERSION = '1.0.10'
4
+ VERSION = '1.0.11'
5
5
  end
@@ -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>, ["> 3"])
34
- s.add_development_dependency(%q<actionmailer>, ["> 3"])
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"])
@@ -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
- Mail.class_variable_get(:@@delivery_interceptors).pop
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
- require 'sanitize_email'
2
- require 'sanitize_email/rspec_matchers'
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.10
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-11-25 00:00:00.000000000 Z
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