sanitize_email 2.0.0 → 2.0.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7496020f3a0eb3316969b622590c311c5684de54acf9141521043017a534b842
4
- data.tar.gz: b9d715acafb0d1ce744720756524ce1235dc95e6744f375d11ee2689125184e7
3
+ metadata.gz: 01fa948760859a93fec72f7222ef550a8d14fb1366181977d5c951c127b3c5f5
4
+ data.tar.gz: 0c39cdac07dad7125f8644e69a10ce019e645f75cfde524f0ef389bb00bc2453
5
5
  SHA512:
6
- metadata.gz: e7878f30073db37643499d8c21610030f63cba4444c703c20c06fce00180a53c29b618b0fbe0396cb613897f837387245164b2fe27e65c2f2fce7638c35e8abe
7
- data.tar.gz: 18c5def158cb17a95a1587b3a4bdcf28b5bfe12c5dc6a085d7027b97b7897ab69c7c9efb8bae9f48b0f8e356650f9f28c3625b47dc711f64217e3f9777ae5eea
6
+ metadata.gz: e8d523a93e0ddb26df9d244b93e4a11256fe8da667b88a08af0fad36da07b3adac86a9b2c82404805cbb532d17718cd3788691e103b903fe88527e510e37278e
7
+ data.tar.gz: 5a29e1bb4b70cd51ae401d7d789484a904881ae2431f3296fcc89c8daf7d055d05cc4ed191763aab3a2962cdbd8e34ace6434ed4fdc97f93bfef2ca84a397cc3
data/.gitignore CHANGED
@@ -9,3 +9,4 @@ spec/tmp
9
9
  Gemfile.lock
10
10
  gemfiles/*.lock
11
11
  rdoc/*
12
+ .byebug_history
@@ -0,0 +1,73 @@
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
@@ -0,0 +1,35 @@
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
@@ -0,0 +1,21 @@
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/Appraisals CHANGED
@@ -1,55 +1,57 @@
1
- appraise "rails-3-0" do
2
- gem "rails", "~> 3.0.0"
3
- gem "reek", "~> 2.0" # for Ruby < 2.0
4
- gem "tins", "~> 1.6.0" # for Ruby < 2.0
5
- gem "json", "~> 1.8.3"
6
- gem "rake", "~> 11.2.2"
7
- gem "rest-client", "~> 1.8.0"
1
+ # frozen_string_literal: true
2
+
3
+ appraise 'rails-3-0' do
4
+ gem 'rails', '~> 3.0.0'
5
+ gem 'reek', '~> 2.0' # for Ruby < 2.0
6
+ gem 'tins', '~> 1.6.0' # for Ruby < 2.0
7
+ gem 'json', '~> 1.8.3'
8
+ gem 'rake', '~> 11.2.2'
9
+ gem 'rest-client', '~> 1.8.0'
8
10
  end
9
- appraise "rails-3-1" do
10
- gem "actionmailer", "~> 3.1.0"
11
- gem "railties", "~> 3.1.0"
12
- gem "reek", "~> 2.0" # for Ruby < 2.0
13
- gem "tins", "~> 1.6.0" # for Ruby < 2.0
14
- gem "json", "~> 1.8.3"
15
- gem "rake", "~> 11.2.2"
16
- gem "rest-client", "~> 1.8.0"
11
+ appraise 'rails-3-1' do
12
+ gem 'actionmailer', '~> 3.1.0'
13
+ gem 'railties', '~> 3.1.0'
14
+ gem 'reek', '~> 2.0' # for Ruby < 2.0
15
+ gem 'tins', '~> 1.6.0' # for Ruby < 2.0
16
+ gem 'json', '~> 1.8.3'
17
+ gem 'rake', '~> 11.2.2'
18
+ gem 'rest-client', '~> 1.8.0'
17
19
  end
18
- appraise "rails-3-2" do
19
- gem "actionmailer", "~> 3.2.0"
20
- gem "railties", "~> 3.2.0"
21
- # reek >= 4.0 requires Ruby 2.1 minimum
22
- gem "reek", "~>3.11.0"
23
- gem "json", "~> 1.8.3"
24
- gem "rake", "~> 11.2.2"
20
+ appraise 'rails-3-2' do
21
+ gem 'actionmailer', '~> 3.2.0'
22
+ gem 'railties', '~> 3.2.0'
23
+ # reek >= 4.0 requires Ruby 2.1 minimum
24
+ gem 'reek', '~>3.11.0'
25
+ gem 'json', '~> 1.8.3'
26
+ gem 'rake', '~> 11.2.2'
25
27
  end
26
28
 
27
- appraise "rails-4-0" do
28
- gem "actionmailer", "~> 4.0.0"
29
- gem "railties", "~> 4.0.0"
30
- # reek >= 4.0 requires Ruby 2.1 minimum
31
- gem "reek", "~>3.11.0"
32
- gem "json", "~> 1.8.3"
33
- gem "rake", "~> 11.2.2"
29
+ appraise 'rails-4-0' do
30
+ gem 'actionmailer', '~> 4.0.0'
31
+ gem 'railties', '~> 4.0.0'
32
+ # reek >= 4.0 requires Ruby 2.1 minimum
33
+ gem 'reek', '~>3.11.0'
34
+ gem 'json', '~> 1.8.3'
35
+ gem 'rake', '~> 11.2.2'
34
36
  end
35
- appraise "rails-4-1" do
36
- gem "actionmailer", "~> 4.1.0"
37
- gem "railties", "~> 4.1.0"
38
- # reek >= 4.0 requires Ruby 2.1 minimum
39
- gem "reek", "~>3.11.0"
40
- gem "json", "~> 1.8.3"
41
- gem "rake", "~> 11.2.2"
37
+ appraise 'rails-4-1' do
38
+ gem 'actionmailer', '~> 4.1.0'
39
+ gem 'railties', '~> 4.1.0'
40
+ # reek >= 4.0 requires Ruby 2.1 minimum
41
+ gem 'reek', '~>3.11.0'
42
+ gem 'json', '~> 1.8.3'
43
+ gem 'rake', '~> 11.2.2'
42
44
  end
43
- appraise "rails-4-2" do
44
- gem "actionmailer", "~> 4.2.0"
45
- gem "railties", "~> 4.2.0"
46
- gem "json", "~> 1.8.3"
47
- gem "rake", "~> 11.2.2"
45
+ appraise 'rails-4-2' do
46
+ gem 'actionmailer', '~> 4.2.0'
47
+ gem 'railties', '~> 4.2.0'
48
+ gem 'json', '~> 1.8.3'
49
+ gem 'rake', '~> 11.2.2'
48
50
  end
49
51
 
50
- appraise "rails-5-0" do
51
- gem "actionmailer", "~> 5.0.0"
52
- gem "railties", "~> 5.0.0"
53
- gem "json", "~> 2.0.2"
54
- gem "rake", "~> 11.2.2"
52
+ appraise 'rails-5-0' do
53
+ gem 'actionmailer', '~> 5.0.0'
54
+ gem 'railties', '~> 5.0.0'
55
+ gem 'json', '~> 2.0.2'
56
+ gem 'rake', '~> 11.2.2'
55
57
  end
data/Gemfile CHANGED
@@ -1,4 +1,17 @@
1
- source "http://rubygems.org"
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
+ ruby_version = Gem::Version.new(RUBY_VERSION)
9
+ if ruby_version >= Gem::Version.new('2.1')
10
+ gem 'rubocop', '~> 0.53.0'
11
+ gem 'rubocop-rspec', '~> 1.24.0'
12
+ end
13
+ gem 'byebug' if ruby_version >= Gem::Version.new('2.0')
14
+ end
2
15
 
3
16
  # Specify your gem's dependencies in sanitize_email.gemspec
4
17
  gemspec
data/Rakefile CHANGED
@@ -1,50 +1,52 @@
1
- # encoding: utf-8
2
- #!/usr/bin/env rake
3
- require "rubygems"
4
- require "bundler/setup"
5
- require "bundler/gem_tasks"
6
- require "rake"
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'
7
9
 
8
10
  begin
9
- require "wwtd/tasks"
10
- require "rspec/core/rake_task"
11
+ require 'wwtd/tasks'
12
+ require 'rspec/core/rake_task'
11
13
  RSpec::Core::RakeTask.new(:spec)
12
14
  task :default => :spec
13
15
  task :test => :spec
14
16
  rescue LoadError
15
- warn "Failed to load rspec or wwtd"
17
+ warn 'Failed to load rspec or wwtd'
16
18
  end
17
19
 
18
20
  begin
19
- require "reek/rake/task"
21
+ require 'reek/rake/task'
20
22
  Reek::Rake::Task.new do |t|
21
23
  t.fail_on_error = true
22
24
  t.verbose = false
23
- t.source_files = "lib/**/*.rb"
25
+ t.source_files = 'lib/**/*.rb'
24
26
  end
25
27
  rescue LoadError
26
- warn "Failed to load reek"
28
+ warn 'Failed to load reek'
27
29
  end
28
30
 
29
31
  begin
30
- require "roodi"
31
- require "roodi_task"
32
+ require 'roodi'
33
+ require 'roodi_task'
32
34
  RoodiTask.new do |t|
33
35
  t.verbose = false
34
36
  end
35
37
  rescue LoadError
36
- warn "Failed to load roodi"
38
+ warn 'Failed to load roodi'
37
39
  end
38
40
 
39
- require File.expand_path("../lib/sanitize_email/version", __FILE__)
40
- require "rdoc"
41
- require "rdoc/task"
41
+ require File.expand_path('lib/sanitize_email/version', __dir__)
42
+ require 'rdoc'
43
+ require 'rdoc/task'
42
44
  RDoc::Task.new do |rdoc|
43
- rdoc.rdoc_dir = "rdoc"
45
+ rdoc.rdoc_dir = 'rdoc'
44
46
  rdoc.title = "SanitizeEmail #{SanitizeEmail::VERSION}"
45
- rdoc.options << "--line-numbers"
46
- rdoc.rdoc_files.include("README*")
47
- rdoc.rdoc_files.include("lib/**/*.rb")
47
+ rdoc.options << '--line-numbers'
48
+ rdoc.rdoc_files.include('README*')
49
+ rdoc.rdoc_files.include('lib/**/*.rb')
48
50
  end
49
51
 
50
52
  Bundler::GemHelper.install_tasks
@@ -1,10 +1,12 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # This file was generated by Appraisal
2
4
 
3
- source "http://rubygems.org"
5
+ source 'http://rubygems.org'
4
6
 
5
- gem "actionmailer", "~> 4.2.0"
6
- gem "railties", "~> 4.2.0"
7
- gem "json", "~> 2.1"
8
- gem "rake", "~> 12.0"
7
+ gem 'actionmailer', '~> 4.2.0'
8
+ gem 'json', '~> 2.1'
9
+ gem 'railties', '~> 4.2.0'
10
+ gem 'rake', '~> 12.0'
9
11
 
10
- gemspec :path => "../"
12
+ gemspec :path => '../'
@@ -1,10 +1,12 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # This file was generated by Appraisal
2
4
 
3
- source "http://rubygems.org"
5
+ source 'http://rubygems.org'
4
6
 
5
- gem "actionmailer", "~> 5.0.0"
6
- gem "railties", "~> 5.0.0"
7
- gem "json", "~> 2.1"
8
- gem "rake", "~> 12.0"
7
+ gem 'actionmailer', '~> 5.0.0'
8
+ gem 'json', '~> 2.1'
9
+ gem 'railties', '~> 5.0.0'
10
+ gem 'rake', '~> 12.0'
9
11
 
10
- gemspec :path => "../"
12
+ gemspec :path => '../'
@@ -1,10 +1,12 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # This file was generated by Appraisal
2
4
 
3
- source "http://rubygems.org"
5
+ source 'http://rubygems.org'
4
6
 
5
- gem "actionmailer", "~> 5.1.0"
6
- gem "railties", "~> 5.1.0"
7
- gem "json", "~> 2.1"
8
- gem "rake", "~> 12.0"
7
+ gem 'actionmailer', '~> 5.1.0'
8
+ gem 'json', '~> 2.1'
9
+ gem 'railties', '~> 5.1.0'
10
+ gem 'rake', '~> 12.0'
9
11
 
10
- gemspec :path => "../"
12
+ gemspec :path => '../'
@@ -1,10 +1,12 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # This file was generated by Appraisal
2
4
 
3
- source "http://rubygems.org"
5
+ source 'http://rubygems.org'
4
6
 
5
- gem "actionmailer", "5.2.0"
6
- gem "railties", "5.2.0"
7
- gem "json", "~> 2.1"
8
- gem "rake", "~> 12.0"
7
+ gem 'actionmailer', '5.2.0'
8
+ gem 'json', '~> 2.1'
9
+ gem 'railties', '5.2.0'
10
+ gem 'rake', '~> 12.0'
9
11
 
10
- gemspec :path => "../"
12
+ gemspec :path => '../'
data/init.rb CHANGED
@@ -1,2 +1,3 @@
1
- require "sanitize_email"
1
+ # frozen_string_literal: true
2
2
 
3
+ require 'sanitize_email'
@@ -1,25 +1,27 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Copyright (c) 2008-16 Peter H. Boling of RailsBling.com
2
4
  # Released under the MIT license
3
5
 
4
- module SanitizeEmail
5
- require "sanitize_email/version"
6
- require "sanitize_email/deprecation"
7
- require "sanitize_email/config"
8
- require "sanitize_email/mail_header_tools"
9
- require "sanitize_email/overridden_addresses"
10
- require "sanitize_email/bleach"
6
+ require 'sanitize_email/version'
7
+ require 'sanitize_email/deprecation'
8
+ require 'sanitize_email/config'
9
+ require 'sanitize_email/mail_header_tools'
10
+ require 'sanitize_email/overridden_addresses'
11
+ require 'sanitize_email/bleach'
11
12
 
13
+ module SanitizeEmail
12
14
  # Error is raised when a block parameter is required and not provided to a method
13
15
  class MissingBlockParameter < StandardError; end
14
16
 
15
17
  # Allow non-rails implementations to use this gem
16
18
  if defined?(::Rails)
17
19
  if defined?(::Rails::Engine)
18
- require "sanitize_email/engine"
19
- elsif ::Rails::VERSION::MAJOR == 3 && ::Rails::VERSION::MINOR == 0
20
- require "sanitize_email/railtie"
20
+ require 'sanitize_email/engine'
21
+ elsif ::Rails::VERSION::MAJOR == 3 && ::Rails::VERSION::MINOR.zero?
22
+ require 'sanitize_email/railtie'
21
23
  else
22
- raise "Please use the 0.X.X versions of sanitize_email for Rails 2.X and below."
24
+ raise 'Please use the 0.X.X versions of sanitize_email for Rails 2.X and below.'
23
25
  end
24
26
  else
25
27
  if defined?(Mailer)
@@ -30,7 +32,7 @@ module SanitizeEmail
30
32
  if mailer.respond_to?(:register_interceptor)
31
33
  mailer.register_interceptor(SanitizeEmail::Bleach)
32
34
  else
33
- warn "SanitizeEmail was unable to detect a compatible Mail class to register an interceptor on."
35
+ warn 'SanitizeEmail was unable to detect a compatible Mail class to register an interceptor on.'
34
36
  end
35
37
  end
36
38
 
@@ -39,7 +41,7 @@ module SanitizeEmail
39
41
  SanitizeEmail::Config.config[key.to_sym]
40
42
  end
41
43
 
42
- def self.method_missing(name, *_)
44
+ def self.method_missing(name, *_args)
43
45
  SanitizeEmail[name]
44
46
  end
45
47
 
@@ -80,9 +82,9 @@ module SanitizeEmail
80
82
  # end
81
83
  # end
82
84
  #
83
- def self.sanitary(config_options = {}, &block)
84
- raise MissingBlockParameter, "SanitizeEmail.sanitary must be called with a block" unless block_given?
85
- janitor({:forcing => true}) do
85
+ def self.sanitary(config_options = {})
86
+ raise MissingBlockParameter, 'SanitizeEmail.sanitary must be called with a block' unless block_given?
87
+ janitor(:forcing => true) do
86
88
  original = SanitizeEmail::Config.config.dup
87
89
  SanitizeEmail::Config.config.merge!(config_options)
88
90
  yield
@@ -102,15 +104,15 @@ module SanitizeEmail
102
104
  # end
103
105
  # end
104
106
  #
105
- def self.unsanitary &block
106
- raise MissingBlockParameter, "SanitizeEmail.unsanitary must be called with a block" unless block_given?
107
- janitor({:forcing => false}) do
107
+ def self.unsanitary
108
+ raise MissingBlockParameter, 'SanitizeEmail.unsanitary must be called with a block' unless block_given?
109
+ janitor(:forcing => false) do
108
110
  yield
109
111
  end
110
112
  end
111
113
 
112
- def self.janitor(options, &block)
113
- raise MissingBlockParameter, "SanitizeEmail.janitor must be called with a block" unless block_given?
114
+ def self.janitor(options)
115
+ raise MissingBlockParameter, 'SanitizeEmail.janitor must be called with a block' unless block_given?
114
116
  original = SanitizeEmail.force_sanitize
115
117
  SanitizeEmail.force_sanitize = options[:forcing]
116
118
  yield
@@ -123,5 +125,4 @@ module SanitizeEmail
123
125
  deprecated_alias :sanitized_recipients, :sanitized_to
124
126
  deprecated :local_environments, :activation_proc
125
127
  end
126
-
127
128
  end