validates_host 1.2.0 → 1.3.0
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 +4 -4
- data/.rubocop.yml +4 -0
- data/.travis.yml +14 -0
- data/README.md +2 -1
- data/gemfiles/Gemfile.rails3 +1 -1
- data/gemfiles/Gemfile.rails4 +1 -1
- data/gemfiles/Gemfile.rails5 +3 -3
- data/gemfiles/Gemfile.rails6 +5 -0
- data/lib/validates_host/domain_name_validator.rb +10 -1
- data/lib/validates_host/host_name_validator.rb +10 -1
- data/lib/validates_host/ip_validator.rb +10 -1
- data/lib/validates_host/subnet_validator.rb +10 -1
- data/lib/validates_host/version.rb +1 -1
- data/validates_host.gemspec +6 -5
- metadata +15 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 145ca9cab05675368ca33a513820cdaca5c50747a197635c48455b94464bf93b
|
4
|
+
data.tar.gz: 9dafd02e5e4481a18c05c475eaea0c70c438886efe13d9cf9ed3735f8fb1016f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a99df100cd2ec1b958a3462bd8f314a75687f4e0d0949b80cc4d7dcb8b19a7cd8484d2c9c94444aca8c40bd3c1efff3a0ba8fbee0a9086a52d9615093c436507
|
7
|
+
data.tar.gz: d10314be5e20e31cc370d8245b42ce5c976d9ab4a4f4129e2d5de3627dbcf728d79d9819c54e0c95047b40b5b3107d38d8665a585ee3187045838170ac321404
|
data/.rubocop.yml
CHANGED
data/.travis.yml
CHANGED
@@ -24,8 +24,22 @@ matrix:
|
|
24
24
|
gemfile: gemfiles/Gemfile.rails4
|
25
25
|
- rvm: 2.5
|
26
26
|
gemfile: gemfiles/Gemfile.rails5
|
27
|
+
- rvm: 2.5
|
28
|
+
gemfile: gemfiles/Gemfile.rails6
|
27
29
|
- rvm: 2.6
|
28
30
|
gemfile: gemfiles/Gemfile.rails4
|
29
31
|
- rvm: 2.6
|
30
32
|
gemfile: gemfiles/Gemfile.rails5
|
33
|
+
- rvm: 2.6
|
34
|
+
gemfile: gemfiles/Gemfile.rails6
|
35
|
+
- rvm: 2.7
|
36
|
+
gemfile: gemfiles/Gemfile.rails4
|
37
|
+
- rvm: 2.7
|
38
|
+
gemfile: gemfiles/Gemfile.rails5
|
39
|
+
- rvm: 2.7
|
40
|
+
gemfile: gemfiles/Gemfile.rails6
|
41
|
+
- rvm: 3.0
|
42
|
+
gemfile: gemfiles/Gemfile.rails4
|
43
|
+
- rvm: 3.0
|
44
|
+
gemfile: gemfiles/Gemfile.rails6
|
31
45
|
script: rake complete
|
data/README.md
CHANGED
@@ -2,7 +2,8 @@
|
|
2
2
|
|
3
3
|
[](http://badge.fury.io/rb/validates_host) [](http://travis-ci.org/plribeiro3000/validates_host) [](https://coveralls.io/r/plribeiro3000/validates_host) [](https://codeclimate.com/github/plribeiro3000/validates_host)
|
4
4
|
|
5
|
-
Validates host attributes and test it in a simple way
|
5
|
+
Validates host attributes and test it in a simple way.
|
6
|
+
Supports ruby 2.0+ and rails 3+
|
6
7
|
|
7
8
|
## Installation
|
8
9
|
|
data/gemfiles/Gemfile.rails3
CHANGED
data/gemfiles/Gemfile.rails4
CHANGED
data/gemfiles/Gemfile.rails5
CHANGED
@@ -2,6 +2,15 @@
|
|
2
2
|
|
3
3
|
class DomainNameValidator < ActiveModel::EachValidator
|
4
4
|
def validate_each(record, attribute, value)
|
5
|
-
|
5
|
+
return if ValidatesHost::DomainName.new(value).valid?
|
6
|
+
|
7
|
+
ruby_prior_version_three =
|
8
|
+
Gem::Version.new(RUBY_VERSION) < Gem::Version.new('3.0.0')
|
9
|
+
|
10
|
+
if ruby_prior_version_three
|
11
|
+
record.errors.add(attribute, :invalid, options)
|
12
|
+
else
|
13
|
+
record.errors.add(attribute, :invalid, **options)
|
14
|
+
end
|
6
15
|
end
|
7
16
|
end
|
@@ -2,6 +2,15 @@
|
|
2
2
|
|
3
3
|
class HostNameValidator < ActiveModel::EachValidator
|
4
4
|
def validate_each(record, attribute, value)
|
5
|
-
|
5
|
+
return if ValidatesHost::HostName.new(value).valid?
|
6
|
+
|
7
|
+
ruby_prior_version_three =
|
8
|
+
Gem::Version.new(RUBY_VERSION) < Gem::Version.new('3.0.0')
|
9
|
+
|
10
|
+
if ruby_prior_version_three
|
11
|
+
record.errors.add(attribute, :invalid, options)
|
12
|
+
else
|
13
|
+
record.errors.add(attribute, :invalid, **options)
|
14
|
+
end
|
6
15
|
end
|
7
16
|
end
|
@@ -2,6 +2,15 @@
|
|
2
2
|
|
3
3
|
class IpValidator < ActiveModel::EachValidator
|
4
4
|
def validate_each(record, attribute, value)
|
5
|
-
|
5
|
+
return if ValidatesHost::Ip.new(value).valid?
|
6
|
+
|
7
|
+
ruby_prior_version_three =
|
8
|
+
Gem::Version.new(RUBY_VERSION) < Gem::Version.new('3.0.0')
|
9
|
+
|
10
|
+
if ruby_prior_version_three
|
11
|
+
record.errors.add(attribute, :invalid, options)
|
12
|
+
else
|
13
|
+
record.errors.add(attribute, :invalid, **options)
|
14
|
+
end
|
6
15
|
end
|
7
16
|
end
|
@@ -2,6 +2,15 @@
|
|
2
2
|
|
3
3
|
class SubnetValidator < ActiveModel::EachValidator
|
4
4
|
def validate_each(record, attribute, value)
|
5
|
-
|
5
|
+
return if ValidatesHost::Subnet.new(value).valid?
|
6
|
+
|
7
|
+
ruby_prior_version_three =
|
8
|
+
Gem::Version.new(RUBY_VERSION) < Gem::Version.new('3.0.0')
|
9
|
+
|
10
|
+
if ruby_prior_version_three
|
11
|
+
record.errors.add(attribute, :invalid, options)
|
12
|
+
else
|
13
|
+
record.errors.add(attribute, :invalid, **options)
|
14
|
+
end
|
6
15
|
end
|
7
16
|
end
|
data/validates_host.gemspec
CHANGED
@@ -9,17 +9,18 @@ Gem::Specification.new do |gem|
|
|
9
9
|
gem.email = 'plribeiro3000@gmail.com'
|
10
10
|
gem.summary = 'Validates Host, Domain and IP and test it with matchers in a simple way.'
|
11
11
|
|
12
|
-
gem.files
|
13
|
-
gem.test_files
|
14
|
-
gem.executables
|
15
|
-
gem.require_paths
|
12
|
+
gem.files = `git ls-files`.split($OUTPUT_RECORD_SEPARATOR)
|
13
|
+
gem.test_files = `git ls-files -- {test,spec,features,examples,gemfiles}/*`.split("\n")
|
14
|
+
gem.executables = `git ls-files -- bin/*`.split('\n').map { |f| File.basename(f) }
|
15
|
+
gem.require_paths = %w[lib]
|
16
|
+
gem.required_ruby_version = '>= 2.0.0'
|
16
17
|
|
17
18
|
gem.license = 'MIT'
|
18
19
|
|
19
20
|
gem.add_development_dependency 'coveralls'
|
20
21
|
gem.add_development_dependency 'rake'
|
21
22
|
gem.add_development_dependency 'rspec'
|
22
|
-
gem.add_development_dependency 'rubocop'
|
23
|
+
gem.add_development_dependency 'rubocop', '< 0.50'
|
23
24
|
gem.add_development_dependency 'rubocop-rspec'
|
24
25
|
gem.add_development_dependency 'shoulda-matchers'
|
25
26
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: validates_host
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paulo Henrique Lopes Ribeiro
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-04-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: coveralls
|
@@ -56,16 +56,16 @@ dependencies:
|
|
56
56
|
name: rubocop
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - "<"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
61
|
+
version: '0.50'
|
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: '0'
|
68
|
+
version: '0.50'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rubocop-rspec
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -108,7 +108,7 @@ dependencies:
|
|
108
108
|
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: 3.0.0
|
111
|
-
description:
|
111
|
+
description:
|
112
112
|
email: plribeiro3000@gmail.com
|
113
113
|
executables: []
|
114
114
|
extensions: []
|
@@ -126,6 +126,7 @@ files:
|
|
126
126
|
- gemfiles/Gemfile.rails3
|
127
127
|
- gemfiles/Gemfile.rails4
|
128
128
|
- gemfiles/Gemfile.rails5
|
129
|
+
- gemfiles/Gemfile.rails6
|
129
130
|
- lib/validates_host.rb
|
130
131
|
- lib/validates_host/domain_name.rb
|
131
132
|
- lib/validates_host/domain_name_validator.rb
|
@@ -152,11 +153,11 @@ files:
|
|
152
153
|
- spec/validates_host/ip_validator_spec.rb
|
153
154
|
- spec/validates_host/subnet_validator_spec.rb
|
154
155
|
- validates_host.gemspec
|
155
|
-
homepage:
|
156
|
+
homepage:
|
156
157
|
licenses:
|
157
158
|
- MIT
|
158
159
|
metadata: {}
|
159
|
-
post_install_message:
|
160
|
+
post_install_message:
|
160
161
|
rdoc_options: []
|
161
162
|
require_paths:
|
162
163
|
- lib
|
@@ -164,21 +165,22 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
164
165
|
requirements:
|
165
166
|
- - ">="
|
166
167
|
- !ruby/object:Gem::Version
|
167
|
-
version:
|
168
|
+
version: 2.0.0
|
168
169
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
169
170
|
requirements:
|
170
171
|
- - ">="
|
171
172
|
- !ruby/object:Gem::Version
|
172
173
|
version: '0'
|
173
174
|
requirements: []
|
174
|
-
rubygems_version: 3.1.
|
175
|
-
signing_key:
|
175
|
+
rubygems_version: 3.1.4
|
176
|
+
signing_key:
|
176
177
|
specification_version: 4
|
177
178
|
summary: Validates Host, Domain and IP and test it with matchers in a simple way.
|
178
179
|
test_files:
|
179
180
|
- gemfiles/Gemfile.rails3
|
180
181
|
- gemfiles/Gemfile.rails4
|
181
182
|
- gemfiles/Gemfile.rails5
|
183
|
+
- gemfiles/Gemfile.rails6
|
182
184
|
- spec/fake_app/server.rb
|
183
185
|
- spec/fake_app/subnet.rb
|
184
186
|
- spec/shoulda/matchers/active_model/require_a_valid_domain_name_matcher_spec.rb
|