can_has_validations 1.3.2 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 35a018491f2cdaaf42b335b1d161573555a41b10f3a01b3789e51afbc8b75a0e
|
4
|
+
data.tar.gz: acfa4a74d6709f9184fe46d24eef3fa36771c0f1a540fdbd1d75682b49e67bf8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ea6a073102cae7965b1f430c169db660f16fcbb826271016a991fef4888401fbb0da206dcd030c61bdf4aab04100d934eaa6efbb76fb12f276f25a1ae30c6a04
|
7
|
+
data.tar.gz: 328d8fe59d6e527cc5373a1193654a689c3ff418573b4114fe358475ab5ce1c2a8e64e00ac85bd04cc5a55bd090c276cad4f19711c0919baae6895627958c455
|
@@ -24,8 +24,8 @@
|
|
24
24
|
# allows 'a.example.com', but not 'example.com'
|
25
25
|
# validates :domain, hostname: {allow_ip: true} # or 4 or 6 for ipv4 or ipv6 only
|
26
26
|
# allows '1.2.3.4' or 'a.example.com'
|
27
|
-
# validates :subdomain, hostname: {skip_tld: true
|
28
|
-
# allows 'subdomain1'
|
27
|
+
# validates :subdomain, hostname: {skip_tld: true}
|
28
|
+
# allows 'subdomain1'; implies segments: 1..100 unless otherwise specified
|
29
29
|
|
30
30
|
require 'resolv'
|
31
31
|
|
@@ -46,7 +46,7 @@ module ActiveModel::Validations
|
|
46
46
|
return if value =~ Resolv::IPv4::Regex || value =~ Resolv::IPv6::Regex
|
47
47
|
end
|
48
48
|
|
49
|
-
segments = options[:segments] || (2..100)
|
49
|
+
segments = options[:segments] || (options[:skip_tld] ? 1..100 : 2..100)
|
50
50
|
segments = segments..segments if segments.is_a?(Integer)
|
51
51
|
if defined?(Addressable::IDNA)
|
52
52
|
value &&= Addressable::IDNA.to_ascii(value)
|
@@ -63,6 +63,8 @@ module ActiveModel::Validations
|
|
63
63
|
is_valid &&= label.length <= 63
|
64
64
|
if !options[:skip_tld] && idx+1==labels.size
|
65
65
|
is_valid &&= label =~ FINAL_LABEL_REGEXP
|
66
|
+
elsif options[:allow_wildcard]==:multi && idx==0
|
67
|
+
is_valid &&= %w(** *).include?(label) || label =~ LABEL_REGEXP
|
66
68
|
elsif options[:allow_wildcard] && idx==0
|
67
69
|
is_valid &&= label=='*' || label =~ LABEL_REGEXP
|
68
70
|
else
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: can_has_validations
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- thomas morgan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-10-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -45,7 +45,7 @@ dependencies:
|
|
45
45
|
- !ruby/object:Gem::Version
|
46
46
|
version: '0'
|
47
47
|
description: 'Assorted Rails 5.x-6.x validators: Array, Email, Existence, Grandparent,
|
48
|
-
Hostname, IP address, Ordering, URL, Write Once'
|
48
|
+
Hash keys, Hash values, Hostname, IP address, Ordering, URL, Write Once'
|
49
49
|
email:
|
50
50
|
- tm@iprog.com
|
51
51
|
executables: []
|
@@ -121,7 +121,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
121
121
|
- !ruby/object:Gem::Version
|
122
122
|
version: '0'
|
123
123
|
requirements: []
|
124
|
-
rubygems_version: 3.2.
|
124
|
+
rubygems_version: 3.2.22
|
125
125
|
signing_key:
|
126
126
|
specification_version: 4
|
127
127
|
summary: Assorted Rails 5.x-6.x validators
|