missing_validators 0.7.1 → 0.7.2
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 033cbbe718a1d580223dbb0adc271f1ed173b44f
|
4
|
+
data.tar.gz: d0d25453fc9461d621ac04bcb6cf0da3ac2525f5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e85456bdc73b306b960706151d1c345f4d33cf5f35d6c7468c5ade014afabb61a6f77280848b2be0c14b2fc0848afd5fd5a6469143d1b8a7da822afc3ca5bbfc
|
7
|
+
data.tar.gz: d64609918b653ab0c5e6f2a269d1edc995860661a2b76cc525edff37e96e6d32959188c086d67eb8c7662559a1badb5ed0ba618423b14a391874d64efd4b23d6
|
@@ -21,12 +21,12 @@ class MacAddressValidator < ActiveModel::EachValidator
|
|
21
21
|
end
|
22
22
|
|
23
23
|
def self.validate_format(mac_address)
|
24
|
-
!!(mac_address =~ /^([
|
25
|
-
!!(mac_address =~ /^([
|
26
|
-
!!(mac_address =~ /^([
|
27
|
-
!!(mac_address =~ /^([
|
28
|
-
!!(mac_address =~ /^([
|
29
|
-
!!(mac_address =~ /^[
|
24
|
+
!!(mac_address =~ /^([\h]{2}[:]){5}[\h]{2}?$/i) || # 08:00:2b:01:02:03
|
25
|
+
!!(mac_address =~ /^([\h]{2}[-]){5}[\h]{2}?$/i) || # 08-00-2b-01-02-03
|
26
|
+
!!(mac_address =~ /^([\h]{6}):[\h]{6}?$/i) || # 08002b:010203
|
27
|
+
!!(mac_address =~ /^([\h]{6})-[\h]{6}?$/i) || # 08002b-010203
|
28
|
+
!!(mac_address =~ /^([\h]{4}[\.]){2}[\h]{4}?$/i) || # 0800.2b01.0203
|
29
|
+
!!(mac_address =~ /^[\h]{12}?$/i) # 08002b010203
|
30
30
|
end
|
31
31
|
|
32
32
|
private
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: missing_validators
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Gridnev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-02-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|