rack-address_munging 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.rubocop.yml +3 -0
- data/Gemfile.lock +38 -33
- data/README.md +1 -0
- data/lib/rack/address_munging.rb +1 -1
- data/lib/rack/address_munging/detection.rb +6 -3
- data/lib/rack/address_munging/version.rb +1 -1
- data/rack-address_munging.gemspec +7 -9
- metadata +15 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 17a66ed69a9d27df061e997e87817ea15ead641e36969330830a897e52370ef9
|
4
|
+
data.tar.gz: f727b8fcac38b027d677d4bbd698e87dcf8ae88aeddb7836c4e208715e3625ef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4c0620b21dbffbd5f00aa419450ad2a88015972600d411b86bb0ca8e74c00986a5d6001244f60ef46d0a3c66b146c7f562bba0bb2689fe9f874f39bef6198e0d
|
7
|
+
data.tar.gz: 12add062a7e2fd96e12c45e7621d5023c65c0d5b50a76a9eae94ab4038fa886048ee48f8fffb8a6e9f07003d3c32f894477e3d2433175bfd3e02068903a94f08
|
data/.rubocop.yml
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,57 +1,62 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
rack-address_munging (0.1.
|
4
|
+
rack-address_munging (0.1.2)
|
5
5
|
mail (> 2.5.0)
|
6
|
-
rack (>=
|
6
|
+
rack (>= 2.1.4)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
|
-
ast (2.4.
|
12
|
-
diff-lcs (1.
|
13
|
-
mail (2.7.
|
11
|
+
ast (2.4.1)
|
12
|
+
diff-lcs (1.4.4)
|
13
|
+
mail (2.7.1)
|
14
14
|
mini_mime (>= 0.1.1)
|
15
|
-
mini_mime (1.0.
|
16
|
-
parallel (1.
|
17
|
-
parser (2.
|
18
|
-
ast (~> 2.4.
|
19
|
-
|
20
|
-
rack (2.0.4)
|
15
|
+
mini_mime (1.0.2)
|
16
|
+
parallel (1.19.2)
|
17
|
+
parser (2.7.2.0)
|
18
|
+
ast (~> 2.4.1)
|
19
|
+
rack (2.2.3)
|
21
20
|
rainbow (3.0.0)
|
22
|
-
rake (
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
rspec-
|
27
|
-
|
28
|
-
rspec-
|
29
|
-
rspec-
|
21
|
+
rake (13.0.1)
|
22
|
+
regexp_parser (1.8.2)
|
23
|
+
rexml (3.2.4)
|
24
|
+
rspec (3.10.0)
|
25
|
+
rspec-core (~> 3.10.0)
|
26
|
+
rspec-expectations (~> 3.10.0)
|
27
|
+
rspec-mocks (~> 3.10.0)
|
28
|
+
rspec-core (3.10.0)
|
29
|
+
rspec-support (~> 3.10.0)
|
30
|
+
rspec-expectations (3.10.0)
|
30
31
|
diff-lcs (>= 1.2.0, < 2.0)
|
31
|
-
rspec-support (~> 3.
|
32
|
-
rspec-mocks (3.
|
32
|
+
rspec-support (~> 3.10.0)
|
33
|
+
rspec-mocks (3.10.0)
|
33
34
|
diff-lcs (>= 1.2.0, < 2.0)
|
34
|
-
rspec-support (~> 3.
|
35
|
-
rspec-support (3.
|
36
|
-
rubocop (
|
35
|
+
rspec-support (~> 3.10.0)
|
36
|
+
rspec-support (3.10.0)
|
37
|
+
rubocop (1.1.0)
|
37
38
|
parallel (~> 1.10)
|
38
|
-
parser (>= 2.5)
|
39
|
-
powerpack (~> 0.1)
|
39
|
+
parser (>= 2.7.1.5)
|
40
40
|
rainbow (>= 2.2.2, < 4.0)
|
41
|
+
regexp_parser (>= 1.8)
|
42
|
+
rexml
|
43
|
+
rubocop-ast (>= 1.0.1)
|
41
44
|
ruby-progressbar (~> 1.7)
|
42
|
-
unicode-display_width (
|
43
|
-
|
44
|
-
|
45
|
+
unicode-display_width (>= 1.4.0, < 2.0)
|
46
|
+
rubocop-ast (1.1.0)
|
47
|
+
parser (>= 2.7.1.5)
|
48
|
+
ruby-progressbar (1.10.1)
|
49
|
+
unicode-display_width (1.7.0)
|
45
50
|
|
46
51
|
PLATFORMS
|
47
52
|
ruby
|
48
53
|
|
49
54
|
DEPENDENCIES
|
50
|
-
bundler (~> 1
|
55
|
+
bundler (~> 2.1)
|
51
56
|
rack-address_munging!
|
52
|
-
rake (~>
|
53
|
-
rspec (~> 3.
|
57
|
+
rake (~> 13.0)
|
58
|
+
rspec (~> 3.10.0)
|
54
59
|
rubocop
|
55
60
|
|
56
61
|
BUNDLED WITH
|
57
|
-
1.
|
62
|
+
2.1.4
|
data/README.md
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# Rack::AddressMunging
|
2
2
|
|
3
3
|
[![Build Status](https://travis-ci.org/notus-sh/rack-address_munging.svg?branch=master)](https://travis-ci.org/notus-sh/rack-address_munging)
|
4
|
+
[![Gem Version](https://badge.fury.io/rb/rack-address_munging.svg)](https://badge.fury.io/rb/rack-address_munging)
|
4
5
|
|
5
6
|
`Rack::AddressMunging` is a Rack middleware for automatic [e-mail addresses munging](https://en.wikipedia.org/wiki/Address_munging).
|
6
7
|
|
data/lib/rack/address_munging.rb
CHANGED
@@ -8,15 +8,16 @@ module Rack
|
|
8
8
|
# This module contains email address detection and validation methods.
|
9
9
|
# It is meant to be included in any munging strategy.
|
10
10
|
module Detection
|
11
|
-
REGEXP_EMAIL = /[a-z0-9][^@\s'":<>]+@[^@\s'":<>]+[a-z0-9]/i
|
12
|
-
REGEXP_MAILTO = /mailto:#{REGEXP_EMAIL}/i
|
13
|
-
REGEXP_LINK = %r{<a[^>]+?href="#{REGEXP_MAILTO}"[^>]*?>.+?</a>}i
|
11
|
+
REGEXP_EMAIL = /[a-z0-9][^@\s'":<>]+@[^@\s'":<>]+[a-z0-9]/i.freeze
|
12
|
+
REGEXP_MAILTO = /mailto:#{REGEXP_EMAIL}/i.freeze
|
13
|
+
REGEXP_LINK = %r{<a[^>]+?href="#{REGEXP_MAILTO}"[^>]*?>.+?</a>}i.freeze
|
14
14
|
|
15
15
|
def email?(string)
|
16
16
|
m = ::Mail::Address.new(string)
|
17
17
|
return false unless m.address == string
|
18
18
|
return false unless valid_local?(m.local)
|
19
19
|
return false unless valid_domain?(m.domain)
|
20
|
+
|
20
21
|
true
|
21
22
|
rescue StandardError
|
22
23
|
false
|
@@ -28,6 +29,7 @@ module Rack
|
|
28
29
|
return false if local.include?('..') # Can't contain ..
|
29
30
|
return false if local.include?('@') # Can't contain an @
|
30
31
|
return false unless local !~ /^"?\s+"?$/ # Can't be blank
|
32
|
+
|
31
33
|
true
|
32
34
|
end
|
33
35
|
|
@@ -36,6 +38,7 @@ module Rack
|
|
36
38
|
return false if local_domain?(domain)
|
37
39
|
return false if hires_image?(domain)
|
38
40
|
return false if domain.include?('..') # Can't contain ..
|
41
|
+
|
39
42
|
true
|
40
43
|
end
|
41
44
|
|
@@ -15,22 +15,20 @@ Gem::Specification.new do |spec|
|
|
15
15
|
spec.description = 'A Rack middleware for automatic e-mail addresses munging.'
|
16
16
|
spec.homepage = 'https://github.com/notus-sh/rack-address_munging'
|
17
17
|
|
18
|
-
|
19
|
-
spec.metadata["allowed_push_host"] = 'https://rubygems.org'
|
20
|
-
else
|
21
|
-
raise "RubyGems 2.0 or newer is required."
|
22
|
-
end
|
18
|
+
spec.metadata['allowed_push_host'] = 'https://rubygems.org'
|
23
19
|
|
24
20
|
spec.require_paths = ['lib']
|
25
21
|
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
26
22
|
f.match(%r{^(test|spec|features)/})
|
27
23
|
end
|
28
24
|
|
25
|
+
spec.required_ruby_version = '>= 2.5'
|
26
|
+
|
29
27
|
spec.add_dependency 'mail', '> 2.5.0'
|
30
|
-
spec.add_dependency 'rack', '>=
|
28
|
+
spec.add_dependency 'rack', '>= 2.1.4'
|
31
29
|
|
32
|
-
spec.add_development_dependency 'bundler', '~> 1
|
33
|
-
spec.add_development_dependency 'rake', '~>
|
34
|
-
spec.add_development_dependency 'rspec', '~> 3.
|
30
|
+
spec.add_development_dependency 'bundler', '~> 2.1'
|
31
|
+
spec.add_development_dependency 'rake', '~> 13.0'
|
32
|
+
spec.add_development_dependency 'rspec', '~> 3.10.0'
|
35
33
|
spec.add_development_dependency 'rubocop'
|
36
34
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-address_munging
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gaël-Ian Havard
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-11-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mail
|
@@ -30,56 +30,56 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 2.1.4
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 2.1.4
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '1
|
47
|
+
version: '2.1'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '1
|
54
|
+
version: '2.1'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rake
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
61
|
+
version: '13.0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
68
|
+
version: '13.0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rspec
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 3.
|
75
|
+
version: 3.10.0
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: 3.
|
82
|
+
version: 3.10.0
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: rubocop
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -122,7 +122,7 @@ licenses:
|
|
122
122
|
- Apache-2.0
|
123
123
|
metadata:
|
124
124
|
allowed_push_host: https://rubygems.org
|
125
|
-
post_install_message:
|
125
|
+
post_install_message:
|
126
126
|
rdoc_options: []
|
127
127
|
require_paths:
|
128
128
|
- lib
|
@@ -130,16 +130,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
130
130
|
requirements:
|
131
131
|
- - ">="
|
132
132
|
- !ruby/object:Gem::Version
|
133
|
-
version: '
|
133
|
+
version: '2.5'
|
134
134
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
136
|
- - ">="
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: '0'
|
139
139
|
requirements: []
|
140
|
-
|
141
|
-
|
142
|
-
signing_key:
|
140
|
+
rubygems_version: 3.1.2
|
141
|
+
signing_key:
|
143
142
|
specification_version: 4
|
144
143
|
summary: Rack middleware for automatic address munging.
|
145
144
|
test_files: []
|