sanitize_email 2.0.3 → 2.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data/CHANGELOG.md +97 -12
  4. data/CODE_OF_CONDUCT.md +84 -0
  5. data/CONTRIBUTING.md +47 -0
  6. data/{LICENSE → LICENSE.txt} +1 -1
  7. data/README.md +415 -59
  8. data/SECURITY.md +15 -0
  9. data/lib/sanitize_email/bleach.rb +75 -68
  10. data/lib/sanitize_email/config.rb +22 -22
  11. data/lib/sanitize_email/deprecation.rb +6 -6
  12. data/lib/sanitize_email/{engine.rb → engine_v5.rb} +4 -3
  13. data/lib/sanitize_email/engine_v6.rb +15 -0
  14. data/lib/sanitize_email/mail_ext.rb +2 -0
  15. data/lib/sanitize_email/mail_header_tools.rb +24 -16
  16. data/lib/sanitize_email/overridden_addresses.rb +84 -22
  17. data/lib/sanitize_email/railtie.rb +1 -1
  18. data/lib/sanitize_email/rspec_matchers.rb +66 -31
  19. data/lib/sanitize_email/test_helpers.rb +6 -6
  20. data/lib/sanitize_email/version.rb +4 -2
  21. data/lib/sanitize_email.rb +35 -19
  22. data.tar.gz.sig +0 -0
  23. metadata +108 -93
  24. metadata.gz.sig +0 -0
  25. data/.coveralls.yml +0 -1
  26. data/.gitignore +0 -12
  27. data/.pryrc +0 -11
  28. data/.reek +0 -9
  29. data/.rspec +0 -2
  30. data/.rubocop.yml +0 -73
  31. data/.rubocop_rspec.yml +0 -35
  32. data/.rubocop_todo.yml +0 -21
  33. data/.ruby-gemset +0 -1
  34. data/.ruby-version +0 -1
  35. data/.travis.yml +0 -71
  36. data/Appraisals +0 -29
  37. data/Gemfile +0 -22
  38. data/REEK +0 -2
  39. data/Rakefile +0 -52
  40. data/gemfiles/rails_4_2.gemfile +0 -17
  41. data/gemfiles/rails_5_0.gemfile +0 -17
  42. data/gemfiles/rails_5_1.gemfile +0 -17
  43. data/gemfiles/rails_5_2.gemfile +0 -17
  44. data/init.rb +0 -3
  45. data/sanitize_email.gemspec +0 -49
  46. data/spec/sanitize_email_spec.rb +0 -944
  47. data/spec/spec_helper.rb +0 -28
data/.rubocop.yml DELETED
@@ -1,73 +0,0 @@
1
- require: rubocop-rspec
2
- inherit_from:
3
- - .rubocop_todo.yml
4
- - .rubocop_rspec.yml
5
- AllCops:
6
- DisplayCopNames: true # Display the name of the failing cops
7
- TargetRubyVersion: 2.3
8
- Exclude:
9
- - 'gemfiles/vendor/**/*'
10
- - 'vendor/**/*'
11
- - '**/.irbrc'
12
-
13
- Gemspec/RequiredRubyVersion:
14
- Enabled: false
15
-
16
- Metrics/BlockLength:
17
- Enabled: false
18
-
19
- Metrics/BlockNesting:
20
- Max: 2
21
-
22
- Metrics/LineLength:
23
- Enabled: false
24
-
25
- Metrics/MethodLength:
26
- Max: 15
27
-
28
- Metrics/ParameterLists:
29
- Max: 4
30
-
31
- Layout/AccessModifierIndentation:
32
- EnforcedStyle: outdent
33
-
34
- Layout/DotPosition:
35
- EnforcedStyle: trailing
36
-
37
- Layout/SpaceInsideHashLiteralBraces:
38
- EnforcedStyle: no_space
39
-
40
- Lint/UnusedBlockArgument:
41
- Exclude:
42
- - 'spec/**/*.rb'
43
- - 'gemfiles/vendor/**/*'
44
- - 'vendor/**/*'
45
- - '**/.irbrc'
46
-
47
- Style/ClassVars:
48
- Enabled: false
49
-
50
- Style/CollectionMethods:
51
- PreferredMethods:
52
- map: 'collect'
53
- reduce: 'inject'
54
- find: 'detect'
55
- find_all: 'select'
56
-
57
- Style/Documentation:
58
- Enabled: false
59
-
60
- Style/DoubleNegation:
61
- Enabled: false
62
-
63
- Style/EmptyMethod:
64
- EnforcedStyle: expanded
65
-
66
- Style/Encoding:
67
- Enabled: false
68
-
69
- Style/TrailingCommaInArrayLiteral:
70
- EnforcedStyleForMultiline: comma
71
-
72
- Style/TrailingCommaInHashLiteral:
73
- EnforcedStyleForMultiline: comma
data/.rubocop_rspec.yml DELETED
@@ -1,35 +0,0 @@
1
- RSpec/FilePath:
2
- Enabled: false
3
-
4
- RSpec/MultipleExpectations:
5
- Enabled: false
6
-
7
- RSpec/NamedSubject:
8
- Enabled: false
9
-
10
- RSpec/ExampleLength:
11
- Enabled: false
12
-
13
- RSpec/VerifiedDoubles:
14
- Enabled: false
15
-
16
- RSpec/MessageSpies:
17
- Enabled: false
18
-
19
- RSpec/InstanceVariable:
20
- Enabled: false
21
-
22
- RSpec/NestedGroups:
23
- Enabled: false
24
-
25
- RSpec/ContextWording:
26
- Enabled: false
27
-
28
- RSpec/RepeatedExample:
29
- Enabled: false
30
-
31
- Metrics/AbcSize:
32
- Enabled: false
33
-
34
- Style/ClassAndModuleChildren:
35
- Enabled: false
data/.rubocop_todo.yml DELETED
@@ -1,21 +0,0 @@
1
- Style/HashSyntax:
2
- EnforcedStyle: hash_rockets
3
-
4
- Style/Lambda:
5
- Enabled: false
6
-
7
- Style/SymbolArray:
8
- Enabled: false
9
-
10
- Style/EachWithObject:
11
- Enabled: false
12
-
13
- # Once we drop Rubies that lack support for __dir__ we can turn this on.
14
- Style/ExpandPathArguments:
15
- Enabled: false
16
-
17
- Style/CommentedKeyword:
18
- Enabled: false
19
-
20
- Style/MethodMissing:
21
- Enabled: false
data/.ruby-gemset DELETED
@@ -1 +0,0 @@
1
- foss
data/.ruby-version DELETED
@@ -1 +0,0 @@
1
- ruby-2.5.1
data/.travis.yml DELETED
@@ -1,71 +0,0 @@
1
- env:
2
- global:
3
- - JRUBY_OPTS="-Xcli.debug=true --debug"
4
- - CC_TEST_REPORTER_ID=3fe32ef74eebc6c91dbca2e96535898b5535cea7206dbeba157bda69ec3502e3
5
-
6
- before_script:
7
- - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
8
- - chmod +x ./cc-test-reporter
9
- - ./cc-test-reporter before-build
10
-
11
- script:
12
- - bundle exec rspec
13
-
14
- after_script:
15
- - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
16
-
17
- before_install:
18
- - gem update --system
19
- - gem install bundler
20
-
21
- install:
22
- - bundle install
23
-
24
- bundler_args: --no-deployment --jobs 3 --retry 3
25
-
26
- cache: bundler
27
-
28
- language: ruby
29
- sudo: false
30
-
31
- rvm:
32
- # latest versions on travis-ci as of 2018.09.04
33
- - jruby-9.1.9.0
34
- - ruby-2.3.7
35
- - ruby-2.4.4
36
- - ruby-2.5.1
37
- - jruby-head
38
- - ruby-head
39
-
40
- gemfile:
41
- - gemfiles/rails_4_2.gemfile
42
- - gemfiles/rails_5_0.gemfile
43
- - gemfiles/rails_5_1.gemfile
44
- - gemfiles/rails_5_2.gemfile
45
-
46
- matrix:
47
- allow_failures:
48
- - rvm: jruby-head
49
- - rvm: ruby-head
50
- fast_finish: true
51
- exclude:
52
- # ruby-2.3.7 tests on all versions
53
- # ruby-2.4.4 tests on all versions
54
- # ruby-2.5.1 tests on all versions
55
- # jruby-9.1.9.0 only tests on rails 5.1+
56
- - rvm: jruby-9.1.9.0
57
- gemfile: gemfiles/rails_5_0.gemfile
58
- # jruby-head only tests on rails 5.2+
59
- - rvm: jruby-head
60
- gemfile: gemfiles/rails_4_2.gemfile
61
- - rvm: jruby-head
62
- gemfile: gemfiles/rails_5_0.gemfile
63
- - rvm: jruby-head
64
- gemfile: gemfiles/rails_5_1.gemfile
65
- # ruby-head only tests on rails 5.2+
66
- - rvm: ruby-head
67
- gemfile: gemfiles/rails_4_2.gemfile
68
- - rvm: ruby-head
69
- gemfile: gemfiles/rails_5_0.gemfile
70
- - rvm: ruby-head
71
- gemfile: gemfiles/rails_5_1.gemfile
data/Appraisals DELETED
@@ -1,29 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- appraise 'rails-4-2' do
4
- gem 'actionmailer', '~> 4.2.0'
5
- gem 'railties', '~> 4.2.0'
6
- gem 'json', '~> 2.0'
7
- gem 'rake', '~> 11.0'
8
- end
9
-
10
- appraise 'rails-5-0' do
11
- gem 'actionmailer', '~> 5.0.0'
12
- gem 'railties', '~> 5.0.0'
13
- gem 'json', '~> 2.0'
14
- gem 'rake', '~> 12.0'
15
- end
16
-
17
- appraise 'rails-5-1' do
18
- gem 'actionmailer', '~> 5.1.0'
19
- gem 'railties', '~> 5.1.0'
20
- gem 'json', '~> 2.0'
21
- gem 'rake', '~> 12.0'
22
- end
23
-
24
- appraise 'rails-5-2' do
25
- gem 'actionmailer', '~> 5.2.0'
26
- gem 'railties', '~> 5.2.0'
27
- gem 'json', '~> 2.0'
28
- gem 'rake', '~> 12.0'
29
- end
data/Gemfile DELETED
@@ -1,22 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source 'https://rubygems.org'
4
-
5
- git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
6
-
7
- group :test do
8
- # Travis-CI does not support C-extensions on JRuby
9
- ruby_version = Gem::Version.new(RUBY_VERSION)
10
- if ruby_version >= Gem::Version.new('2.1')
11
- gem 'rubocop', '~> 0.58.2', platforms: :mri
12
- gem 'rubocop-rspec', '~> 1.29.1', platforms: :mri
13
- end
14
- if ruby_version >= Gem::Version.new('2.0')
15
- gem 'byebug', platforms: :mri
16
- gem 'pry', platforms: :mri
17
- gem 'pry-byebug', platforms: :mri
18
- end
19
- end
20
-
21
- # Specify your gem's dependencies in sanitize_email.gemspec
22
- gemspec
data/REEK DELETED
@@ -1,2 +0,0 @@
1
- bundler: command not found: reek
2
- Install missing gem executables with `bundle install`
data/Rakefile DELETED
@@ -1,52 +0,0 @@
1
-
2
- # frozen_string_literal: true
3
-
4
- # !/usr/bin/env rake
5
- require 'rubygems'
6
- require 'bundler/setup'
7
- require 'bundler/gem_tasks'
8
- require 'rake'
9
-
10
- begin
11
- require 'wwtd/tasks'
12
- require 'rspec/core/rake_task'
13
- RSpec::Core::RakeTask.new(:spec)
14
- task :default => :spec
15
- task :test => :spec
16
- rescue LoadError
17
- warn 'Failed to load rspec or wwtd'
18
- end
19
-
20
- begin
21
- require 'reek/rake/task'
22
- Reek::Rake::Task.new do |t|
23
- t.fail_on_error = true
24
- t.verbose = false
25
- t.source_files = 'lib/**/*.rb'
26
- end
27
- rescue LoadError
28
- warn 'Failed to load reek'
29
- end
30
-
31
- begin
32
- require 'roodi'
33
- require 'roodi_task'
34
- RoodiTask.new do |t|
35
- t.verbose = false
36
- end
37
- rescue LoadError
38
- warn 'Failed to load roodi'
39
- end
40
-
41
- require File.expand_path('lib/sanitize_email/version', __dir__)
42
- require 'rdoc'
43
- require 'rdoc/task'
44
- RDoc::Task.new do |rdoc|
45
- rdoc.rdoc_dir = 'rdoc'
46
- rdoc.title = "SanitizeEmail #{SanitizeEmail::VERSION}"
47
- rdoc.options << '--line-numbers'
48
- rdoc.rdoc_files.include('README*')
49
- rdoc.rdoc_files.include('lib/**/*.rb')
50
- end
51
-
52
- Bundler::GemHelper.install_tasks
@@ -1,17 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "actionmailer", "~> 4.2.0"
6
- gem "railties", "~> 4.2.0"
7
- gem "json", "~> 2.0"
8
- gem "rake", "~> 11.0"
9
-
10
- group :test do
11
- # Travis-CI does not support C-extensions on JRuby
12
- gem "rubocop", "~> 0.58.0", platforms: :mri
13
- gem "rubocop-rspec", "~> 1.29.0", platforms: :mri
14
- gem "byebug", platforms: :mri
15
- end
16
-
17
- gemspec path: "../"
@@ -1,17 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "actionmailer", "~> 5.0.0"
6
- gem "railties", "~> 5.0.0"
7
- gem "json", "~> 2.0"
8
- gem "rake", "~> 12.0"
9
-
10
- group :test do
11
- # Travis-CI does not support C-extensions on JRuby
12
- gem "rubocop", "~> 0.58.0", platforms: :mri
13
- gem "rubocop-rspec", "~> 1.29.0", platforms: :mri
14
- gem "byebug", platforms: :mri
15
- end
16
-
17
- gemspec path: "../"
@@ -1,17 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "actionmailer", "~> 5.1.0"
6
- gem "railties", "~> 5.1.0"
7
- gem "json", "~> 2.0"
8
- gem "rake", "~> 12.0"
9
-
10
- group :test do
11
- # Travis-CI does not support C-extensions on JRuby
12
- gem "rubocop", "~> 0.58.0", platforms: :mri
13
- gem "rubocop-rspec", "~> 1.29.0", platforms: :mri
14
- gem "byebug", platforms: :mri
15
- end
16
-
17
- gemspec path: "../"
@@ -1,17 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "actionmailer", "~> 5.2.0"
6
- gem "railties", "~> 5.2.0"
7
- gem "json", "~> 2.0"
8
- gem "rake", "~> 12.0"
9
-
10
- group :test do
11
- # Travis-CI does not support C-extensions on JRuby
12
- gem "rubocop", "~> 0.58.0", platforms: :mri
13
- gem "rubocop-rspec", "~> 1.29.0", platforms: :mri
14
- gem "byebug", platforms: :mri
15
- end
16
-
17
- gemspec path: "../"
data/init.rb DELETED
@@ -1,3 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'sanitize_email'
@@ -1,49 +0,0 @@
1
-
2
- # frozen_string_literal: true
3
-
4
- require File.expand_path('lib/sanitize_email/version', __dir__)
5
-
6
- Gem::Specification.new do |s|
7
- s.name = 'sanitize_email'
8
- s.version = SanitizeEmail::VERSION
9
-
10
- s.authors = ['Peter Boling', 'John Trupiano', 'George Anderson']
11
- s.summary = 'Email Condom for your Ruby Server'
12
- s.description = <<~DESCRIPTION
13
- Email Condom for your Ruby Server.
14
- In Rails, Sinatra, et al, or simply the mail gem: Aids in development, testing, qa, and production troubleshooting of email issues without worrying that emails will get sent to actual live addresses.
15
- DESCRIPTION
16
- s.email = ['peter.boling@gmail.com']
17
- s.extra_rdoc_files = [
18
- 'CHANGELOG.md',
19
- 'LICENSE',
20
- 'README.md',
21
- ]
22
- s.files = `git ls-files`.split($OUTPUT_RECORD_SEPARATOR)
23
- s.executables = s.files.grep(%r{^bin/}).map { |f| File.basename(f) }
24
- s.test_files = s.files.grep(%r{^(test|spec|features)/})
25
- s.homepage = 'http://github.com/pboling/sanitize_email'
26
- s.licenses = ['MIT']
27
- s.require_paths = ['lib']
28
- s.platform = Gem::Platform::RUBY
29
- s.required_ruby_version = '>= 2.3.0'
30
-
31
- # Runtime Dependencies
32
- # A project wanting to use this gem's engine/railtie will be expected to have already loaded the rails/railtie gem.
33
- # s.add_dependency "railties", ">= 3.2"
34
- # to replace the cattr_accessor method we lost when removing rails from run time dependencies
35
- # s.add_runtime_dependency("facets", ["> 0"])
36
-
37
- # Development Dependencies
38
- s.add_development_dependency('actionmailer', ['>= 3'])
39
- s.add_development_dependency('appraisal', '~> 1')
40
- s.add_development_dependency('bundler', '~> 1')
41
- s.add_development_dependency('gem-release', '~> 2')
42
- s.add_development_dependency('coveralls', '~> 0')
43
- s.add_development_dependency('mail', ['>= 0'])
44
- s.add_development_dependency('rails', ['>= 3.0', '< 6'])
45
- s.add_development_dependency('rake', ['>= 12'])
46
- s.add_development_dependency('rdoc', ['>= 3.12'])
47
- s.add_development_dependency('rspec', ['>= 3'])
48
- s.add_development_dependency('wwtd', '~> 1')
49
- end