validators 2.8.1 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +86 -0
- data/.travis.yml +12 -9
- data/Gemfile +2 -0
- data/Rakefile +10 -1
- data/bin/sync-disposable-hostnames +3 -3
- data/data/disposable.json +854 -4
- data/data/tld.json +2 -5
- data/lib/validators/constants.rb +9 -7
- data/lib/validators/disposable_hostnames.rb +4 -2
- data/lib/validators/hostname.rb +12 -10
- data/lib/validators/ip.rb +7 -3
- data/lib/validators/tld.rb +5 -2
- data/lib/validators/validates_cnpj_format_of.rb +6 -2
- data/lib/validators/validates_cpf_format_of.rb +6 -2
- data/lib/validators/validates_datetime.rb +23 -22
- data/lib/validators/validates_email_format_of.rb +4 -2
- data/lib/validators/validates_hostname_format_of.rb +2 -0
- data/lib/validators/validates_ip_address.rb +5 -1
- data/lib/validators/validates_ownership_of.rb +5 -1
- data/lib/validators/validates_ssh_private_key.rb +5 -5
- data/lib/validators/validates_ssh_public_key.rb +3 -1
- data/lib/validators/validates_url_format_of.rb +11 -5
- data/lib/validators/version.rb +6 -4
- data/lib/validators.rb +2 -0
- data/test/schema.rb +2 -0
- data/test/support/dates.rb +4 -2
- data/test/support/emails.rb +8 -6
- data/test/support/hostnames.rb +6 -4
- data/test/support/ips.rb +4 -2
- data/test/support/models.rb +2 -0
- data/test/support/urls.rb +8 -7
- data/test/test_helper.rb +21 -6
- data/test/validators/disposable_email_test.rb +2 -0
- data/test/validators/ip_test.rb +2 -0
- data/test/validators/validates_cnpj_format_of_test.rb +22 -7
- data/test/validators/validates_cpf_format_of_test.rb +22 -7
- data/test/validators/validates_datetime/after_option_test.rb +27 -1
- data/test/validators/validates_datetime/before_option_test.rb +2 -0
- data/test/validators/validates_datetime/defaults_test.rb +2 -0
- data/test/validators/validates_email_format_of_test.rb +2 -0
- data/test/validators/validates_hostname_format_of/with_tld_validation_test.rb +2 -0
- data/test/validators/validates_hostname_format_of/without_tld_validation_test.rb +7 -0
- data/test/validators/validates_ip_address/ipv4_test.rb +8 -0
- data/test/validators/validates_ip_address/ipv6_test.rb +2 -0
- data/test/validators/validates_ip_address_test.rb +2 -0
- data/test/validators/validates_ownership_of_test.rb +2 -0
- data/test/validators/validates_ssh_private_key/bits_test.rb +12 -8
- data/test/validators/validates_ssh_private_key/common_test.rb +22 -7
- data/test/validators/validates_ssh_private_key/dsa_test.rb +12 -8
- data/test/validators/validates_ssh_private_key/rsa_test.rb +12 -8
- data/test/validators/validates_ssh_public_key_test.rb +22 -7
- data/test/validators/validates_url_format_of/with_tld_validation_test.rb +2 -0
- data/test/validators/validates_url_format_of/without_tld_validation_test.rb +2 -0
- data/validators.gemspec +12 -7
- metadata +52 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dff27e8c867e5bec933ca7d0a48d39a9035d305fce4abc45fdf172aad10ef832
|
4
|
+
data.tar.gz: b84c8d392ecca8b049b8c200057d9790cda2d7837d5107a0c41a7f68d1b0edaa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 367bc5f122844017dd15e14d5f44dbc9837ac46d5492d3e8fe892f1525a470a624235432b86644078f81a46e240857a26745f885ebedd1d6096f7dff1dc05df6
|
7
|
+
data.tar.gz: 2ab57842a75aaec739b70ed0f29efd5d227a6ec857b0814bbbaee5b75e66382154e4f763c5f6750a7692cb61497612050dc79681c21d2edca7a7f7f3cf55cc37
|
data/.rubocop.yml
ADDED
@@ -0,0 +1,86 @@
|
|
1
|
+
AllCops:
|
2
|
+
TargetRubyVersion: 2.4
|
3
|
+
TargetRailsVersion: 5.2
|
4
|
+
|
5
|
+
Exclude:
|
6
|
+
- db/schema.rb
|
7
|
+
- db/seeds.rb
|
8
|
+
- config/environments/**/*.rb
|
9
|
+
- bin/**/*
|
10
|
+
- vendor/**/*
|
11
|
+
|
12
|
+
Style/Documentation:
|
13
|
+
Enabled: false
|
14
|
+
|
15
|
+
Style/StringLiterals:
|
16
|
+
EnforcedStyle: double_quotes
|
17
|
+
|
18
|
+
Layout/SpaceInsideBlockBraces:
|
19
|
+
EnforcedStyle: space
|
20
|
+
EnforcedStyleForEmptyBraces: space
|
21
|
+
SpaceBeforeBlockParameters: false
|
22
|
+
|
23
|
+
Layout/SpaceInsideHashLiteralBraces:
|
24
|
+
EnforcedStyle: no_space
|
25
|
+
EnforcedStyleForEmptyBraces: no_space
|
26
|
+
|
27
|
+
Layout/FirstArrayElementLineBreak:
|
28
|
+
Enabled: true
|
29
|
+
|
30
|
+
Layout/FirstHashElementLineBreak:
|
31
|
+
Enabled: true
|
32
|
+
|
33
|
+
Style/PercentLiteralDelimiters:
|
34
|
+
PreferredDelimiters:
|
35
|
+
'%': '[]'
|
36
|
+
'%i': '[]'
|
37
|
+
'%q': '[]'
|
38
|
+
'%Q': '[]'
|
39
|
+
'%r': '{}'
|
40
|
+
'%s': '[]'
|
41
|
+
'%w': '[]'
|
42
|
+
'%W': '[]'
|
43
|
+
'%x': '[]'
|
44
|
+
|
45
|
+
Metrics/LineLength:
|
46
|
+
Enabled: false
|
47
|
+
|
48
|
+
Metrics/MethodLength:
|
49
|
+
Enabled: false
|
50
|
+
|
51
|
+
Style/EmptyMethod:
|
52
|
+
EnforcedStyle: expanded
|
53
|
+
|
54
|
+
Layout/IndentArray:
|
55
|
+
EnforcedStyle: consistent
|
56
|
+
|
57
|
+
Style/AccessModifierDeclarations:
|
58
|
+
EnforcedStyle: inline
|
59
|
+
|
60
|
+
Naming/UncommunicativeMethodParamName:
|
61
|
+
Enabled: false
|
62
|
+
|
63
|
+
Style/Alias:
|
64
|
+
EnforcedStyle: prefer_alias_method
|
65
|
+
|
66
|
+
Metrics/CyclomaticComplexity:
|
67
|
+
Enabled: false
|
68
|
+
|
69
|
+
Metrics/AbcSize:
|
70
|
+
Enabled: false
|
71
|
+
|
72
|
+
Metrics/PerceivedComplexity:
|
73
|
+
Enabled: false
|
74
|
+
|
75
|
+
Style/AsciiComments:
|
76
|
+
Enabled: false
|
77
|
+
|
78
|
+
Style/HashSyntax:
|
79
|
+
Exclude:
|
80
|
+
- Rakefile
|
81
|
+
- "**/*.rake"
|
82
|
+
|
83
|
+
Style/SymbolArray:
|
84
|
+
Exclude:
|
85
|
+
- Rakefile
|
86
|
+
- "**/*.rake"
|
data/.travis.yml
CHANGED
@@ -2,15 +2,18 @@ language: ruby
|
|
2
2
|
cache: bundler
|
3
3
|
sudo: false
|
4
4
|
script: bundle exec rake
|
5
|
+
before_script:
|
6
|
+
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
|
7
|
+
- chmod +x ./cc-test-reporter
|
8
|
+
- "./cc-test-reporter before-build"
|
9
|
+
after_script:
|
10
|
+
- "./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT"
|
5
11
|
notifications:
|
6
12
|
email: false
|
7
13
|
rvm:
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
secure: CX0AIDehELC1kcnvfeLLnhKpX68OCh7OhyRuFhJbMLt9NEu5FjLJgR3IF4V/e+BeyUIEi+xidi/Xa9j+06BbCGtjGmmgTde/Zp9qpVHOwsiGXYn4zkZZmudUQXdF/S3CrBkwauXC8HTUS1OIeGylK5fhW/fz+PpwU7ocQahrhvc=
|
15
|
-
after_success:
|
16
|
-
- bundle exec codeclimate-test-reporter
|
14
|
+
- 2.6.1
|
15
|
+
- 2.5.3
|
16
|
+
- 2.4.5
|
17
|
+
env:
|
18
|
+
global:
|
19
|
+
secure: P3k49Psmw9C7Z0FL0A93H/aD4Xsu+VEccD51FmP2Cw0oeGHpReafU07izyYkQ/Y8jmxOiPiLS29b39PNuGa0DF1MnbW9Tmr9eSrct3v4B0WTj+SA8ZcBEKwS/SQMgJnfEJq6jeWS9gpRtCrDHFGGFHJvtVYGHragwfY+evlN2MI=
|
data/Gemfile
CHANGED
data/Rakefile
CHANGED
@@ -1,5 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "bundler/setup"
|
1
4
|
require "bundler/gem_tasks"
|
2
5
|
require "rake/testtask"
|
6
|
+
require "rubocop/rake_task"
|
7
|
+
|
8
|
+
RuboCop::RakeTask.new(:rubocop) do |t|
|
9
|
+
t.options << "--config"
|
10
|
+
t.options << File.expand_path(".rubocop.yml", __dir__)
|
11
|
+
end
|
3
12
|
|
4
13
|
Rake::TestTask.new(:test) do |t|
|
5
14
|
t.libs << "test"
|
@@ -7,4 +16,4 @@ Rake::TestTask.new(:test) do |t|
|
|
7
16
|
t.warning = false
|
8
17
|
end
|
9
18
|
|
10
|
-
task :default => :test
|
19
|
+
task :default => [:test, :rubocop]
|
@@ -3,9 +3,9 @@
|
|
3
3
|
require "open-uri"
|
4
4
|
require "json"
|
5
5
|
|
6
|
-
domains = JSON.
|
7
|
-
domains += JSON.
|
8
|
-
domains += JSON.
|
6
|
+
domains = JSON.parse(open("https://raw.githubusercontent.com/ivolo/disposable-email-domains/master/index.json").read)
|
7
|
+
domains += JSON.parse(open("https://raw.githubusercontent.com/andreis/disposable-email-domains/master/domains.json").read)
|
8
|
+
domains += JSON.parse(open("https://raw.githubusercontent.com/FGRibreau/mailchecker/master/list.json").read).flatten
|
9
9
|
|
10
10
|
domains.map!(&:downcase)
|
11
11
|
domains.uniq!
|