dl_validator 0.0.2 → 0.0.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4b00ae3875765353b1516e9b3a1a4bab19fd97d5
4
- data.tar.gz: a8d90bf06f6ed87cc24263cf2e0422d4c3748b2d
3
+ metadata.gz: 76554deef531864d8c973ddeb96e1f0dbb0e5bf7
4
+ data.tar.gz: 1486e96a648374dcd4a9ea9a4b7f996c1a429377
5
5
  SHA512:
6
- metadata.gz: c5ac7ede864602cc52cb0e93d464fb52ebdaef4233e51ff6dce5feddb2dd9186af0f4300dd31abb3c8cb9531e14d5dc4d58e4ebdd6c884d8ae90106de91a0605
7
- data.tar.gz: a4108d0785bd3939511d81529d050cc71a4eda13f58aba8f1f7d73c9d1e664521587bfcb13cfd8de2a37ce6aec1d74ffba61367ae595bbff39deffc1caa502ef
6
+ metadata.gz: 4843364c3d988ab432f44a2c33178c160b8418bbe83fa010c1ae67548eeee103f0a56edd3e9fa6efea6f529ebaeda6f28035bed7df6a51027657afeccc9ba9e9
7
+ data.tar.gz: f231305738916b5987c6cd5bf8e9db408b569ef5f910d00824e76899c5a6c95e915fbb843a84842f7c19bdd959ea87bda16ca9c2587883e4ff36f1028b2c8a29
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dl_validator (0.0.1)
4
+ dl_validator (0.0.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -58,56 +58,56 @@ module DlValidator
58
58
 
59
59
  # Constant frozen hash of regular expressions to validate a drivers license by state
60
60
  STATES_REGEX = {
61
- 'AL' => /^([0-9]{7})$/, # Format: 7 numeric
62
- 'AK' => /^([0-9]{7})$/, # Format: 7 numeric
61
+ 'AL' => /^([0-9]{7}|[0-9]{8})$/, # Format: 7 or 8 numeric
62
+ 'AK' => /^([0-9]{1,7})$/, # Format: up to 7 numeric
63
63
  'AZ' => /^([A-Z][0-9]{8})$/, # Format: 1 Alpha 8 numeric
64
- 'AR' => /^([0-9]{8})$/, # Format: 8 Numeric
64
+ 'AR' => /^([0-9]{8}|[0-9]{9})$/, # Format: 8 or 9 Numeric
65
65
  'CA' => /^([A-Z][0-9]{7})$/, # Format: 1 Alpha 7 Numeric
66
66
  'CO' => /^([0-9]{9})$/, # Format: 9 Numeric
67
67
  'CT' => /^((01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24)[0-9]{7})$/, # Format: 9 Numeric; The first 2 digits can not be less than 01 or greater than 24.
68
- 'DE' => /^([0-9]{7})$/, # Format: 7 Numeric
68
+ 'DE' => /^([0-9]{1,7}$)/, # Format: upto 7 Numeric
69
69
  'DC' => /^([0-9]{7})$/, # Format: 7 Numeric
70
70
  'FL' => /^([A-Z][0-9]{12})$/, # Format: 1 Alpha 12 Numeric
71
- 'GA' => /^([0-9]{7,9})$/, # Format: 7-9 Numeric
71
+ 'GA' => /^([0-9]{1,9})$/, # Format: up to 9 Numeric
72
72
  'HI' => /^([H][0-9]{8})$/, # Format: H followed by 8 numeric
73
73
  'ID' => /^([A-Z]{2}[0-9]{6}[A-Z])$/, # Format: 2 Alpha 6 Numeric 1 Alpha (example LS123456C)
74
74
  'IL' => /^([A-Z][0-9]{11})$/, # Format: 1 alpha 11 numeric
75
75
  'IN' => /^([0-9]{10})$/, # Format: 10 Numeric
76
76
  'IA' => /^([0-9]{3}[A-Z]{2}[0-9]{4})$/, # Format: 3 Numeric 2 Alpha 4 Numeric (example 123SL4567)
77
- 'KS' => /^([A-Z][0-9]{8})$/, # Format: 1 Alpha 8 Numeric
77
+ 'KS' => /^([K][0-9]{8})$/, # Format: 1 Alpha K for Alpha 8 Numeric
78
78
  'KY' => /^([A-Z][0-9]{8})$/, # Format: 1 Alpha 8 Numeric
79
79
  'LA' => /^((00|01)[0-9]{7})$/, # Format: 9 Numeric (First two numbers are 00 or 01)
80
80
  'ME' => /^([0-9]{7})$/, # Format: 7 Numeric
81
81
  'MD' => /^([A-Z][0-9]{12})$/, # Format: 1 Alpha 12 Numeric
82
- 'MA' => /^([A-Z][0-9]{8})$/, # Format: 1 Alpha 8 Numeric
82
+ 'MA' => /^([S][0-9]{8})$/, # Format: 1 Alpha 8 Numeric
83
83
  'MI' => /^([A-Z][0-9]{12})$/, # Format: 1 Alpha 12 Numeric
84
- 'MN' => /^([A-Z][0-9]{12})$/, # Format: 1 Alpha 12 Numeric
84
+ 'MN' => /^([A-Z0-9]{13})$/, # Format: 13 Alphanumeric
85
85
  'MS' => /^([0-9]{9})$/, # Format: 9 Numeric
86
- 'MO' => /^([A-Z][0-9]{5,9})$/, # Format: 1 Alpha 5-9 Numeric
87
- 'MT' => /^(([A-Z]|[0-9]){9})$/, # Format: 9 Alpha And Numeric Combination
86
+ 'MO' => /^([A-Z][0-9]{6,9})$/, # Format: 1 Alpha 6-9 Numeric
87
+ 'MT' => /^(([A-Z0-9]{9}|[0-9]{13}))$/, # Format: 13 Numeric or 9 Alphanumeric
88
88
  'NE' => /^([A-Z][0-9]{3,8})$/, # Format: 1 Alpha 3-8 Numeric
89
- 'NV' => /^([0-9]{10}|[0-9]{12}|[X][0-9]{8})$/, # Format: 10 Numeric; or 12 Numeric; or X Followed By 8 Numeric
89
+ 'NV' => /^([0-9]{10})$/, # Format: 10 Numeric
90
90
  'NH' => /^([0-9]{2}[A-Z]{3}[0-9]{5})$/, # Format: 2 Numeric 3 Alpha 5 Numeric
91
91
  'NJ' => /^([A-Z][0-9]{14})$/, # Format: 1 Alpha 14 Numeric
92
92
  'NY' => /^([0-9]{9})$/, # Format: 9 Numeric
93
93
  'NM' => /^([0-9]{9})$/, # Format: 9 Numeric
94
- 'NC' => /^([0-9]{6,9})$/, # Format: 6-9 Numeric
94
+ 'NC' => /^([0-9]{1,12})$/, # Format: Up to 12 Numeric
95
95
  'ND' => /^([0-9]{9})$/, # Format: 9 Numeric
96
96
  'OH' => /^([A-Z]{2}[0-9]{6})$/, # Format: 2 Alpha 6 Numeric
97
- 'OK' => /^([0-9]{9})$/, # Format: 9 Numeric
98
- 'OR' => /^([0-9]{5,7})$/, # Format: 5-7 Numeric
97
+ 'OK' => /^([A-Z][0-9]{9})$/, # Format: 1 Alpha 9 Numeric
98
+ 'OR' => /^([0-9]{1,7})$/, # Format: Up to 7 Numeric
99
99
  'PA' => /^([0-9]{8})$/, # Format: 8 Numeric
100
100
  'RI' => /^([0-9]{7})$/, # Format: 7 Numeric
101
101
  'SC' => /^([0-9]{9})$/, # Format: 9 Numeric
102
102
  'SD' => /^([0-9]{8})$/, # Format: 8 Numeric
103
- 'TN' => /^([0-9]{7}|[0-9]{8}|[0-9]{9})$/, # Format: 7,8 or 9 Numeric
103
+ 'TN' => /^([0-9]{8}|[0-9]{9})$/, # Format: 8 or 9 Numeric
104
104
  'TX' => /^([0-9]{8})$/, # Format: 8 Numeric
105
- 'UT' => /^([0-9]{6,10})$/, # Format: 6-10 Numeric
106
- 'VT' => /^([0-9]{8}|[0-9]{7}[A-Z])$/, # Format: 8 Numeric; or 7 Numeric 1 Alpha
107
- 'VA' => /^([A-Z][0-9]{8})$/, # Format: 1 Alpha 8 Numeric
105
+ 'UT' => /^([0-9]{4,9})$/, # Format: 4 to 9 Numeric
106
+ 'VT' => /^([0-9]{8}|[0-9]{7}[A])$/, # Format: 8 Numeric; or 7 Numeric 1 Alpha. Alpha is A.
107
+ 'VA' => /^([A-Z][0-9]{8})$/, # Format: 1 Alpha 8 Numeric
108
108
  'WA' => /^(([A-Z]|[0-9]){12})$/, # Format: 12 Alpha And Numeric Combination
109
- 'WV' => /^([0-9]{7}|[A-Z][0-9]{6})$/, # Format: 7 Numeric; or 1 Alpha 6 Numeric
109
+ 'WV' => /^([0-9]{7}|[A-Z][0-9]{6})$/, # Format: 7 Numeric; or 1 Alpha 6 Numeric
110
110
  'WI' => /^([A-Z][0-9]{13})$/, # Format: 1 Alpha 13 Numeric
111
- 'WY' => /^([0-9]{9,10})$/ }.freeze # Format: 9-10 Numeric
111
+ 'WY' => /^([0-9]{9})$/ }.freeze # Format: 9 Numeric
112
112
  end
113
113
  end
@@ -1,3 +1,3 @@
1
1
  module DlValidator
2
- VERSION = "0.0.2"
2
+ VERSION = '0.0.3'
3
3
  end
@@ -5,17 +5,17 @@ require 'shoulda'
5
5
  class Helper
6
6
 
7
7
  VALID_DRIVERS_LICENSES = {
8
- 'AL' => ['1234567'], # Format: 7 numeric
9
- 'AK' => ['1234567'], # Format: 7 numeric
8
+ 'AL' => ['1234567', '12345678'], # Format: 7 numeric or 8 numeric
9
+ 'AK' => ['1234567', '12345'], # Format: Up to 7 numeric
10
10
  'AZ' => ['A12345678'], # Format: 1 Alpha 8 numeric
11
- 'AR' => ['12345678'], # Format: 8 Numeric
11
+ 'AR' => ['12345678', '123456789'], # Format: 8 or 9 Numeric
12
12
  'CA' => ['c1234567'], # Format: 1 Alpha 7 Numeric
13
13
  'CO' => ['123456789'], # Format: 9 Numeric
14
14
  'CT' => ['201234567', '241234567'], # Format: 9 Numeric; The first 2 digits can not be less than 01 or greater than 24.
15
- 'DE' => ['1234567'], # Format: 7 Numeric
15
+ 'DE' => ['1234567', '12345'], # Format: Up to 7 Numeric
16
16
  'DC' => ['1234567'], # Format: 7 Numeric
17
17
  'FL' => ['F123456789876'], # Format: 1 Alpha 12 Numeric
18
- 'GA' => ['1234567', '1234567', '123456789'], # Format: 7-9 Numeric
18
+ 'GA' => ['1234567', '1234567', '123456789'], # Format: Up to 9 Numeric
19
19
  'HI' => ['h12345678'], # Format: H followed by 8 numeric
20
20
  'ID' => ['LS123456C'], # Format: 2 Alpha 6 Numeric 1 Alpha (example LS123456C)
21
21
  'IL' => ['J12345678901'], # Format: 1 alpha 11 numeric
@@ -26,34 +26,34 @@ class Helper
26
26
  'LA' => ['001234567', '012345678'], # Format: 9 Numeric (First two numbers are 00 or 01)
27
27
  'ME' => ['1234567'], # Format: 7 Numeric
28
28
  'MD' => ['M123456789012'], # Format: 1 Alpha 12 Numeric
29
- 'MA' => ['A12345678'], # Format: 1 Alpha 8 Numeric
29
+ 'MA' => ['S12345678'], # Format: 1 Alpha 8 Numeric Alpha is S
30
30
  'MI' => ['h123456789012'], # Format: 1 Alpha 12 Numeric
31
- 'MN' => ['L123456789012'], # Format: 1 Alpha 12 Numeric
31
+ 'MN' => ['L1234G6J89012'], # Format: 13 Alphanumeric
32
32
  'MS' => ['123456789'], # Format: 9 Numeric
33
- 'MO' => ['M12345678', 'M12345678' , 'M12345679'], # Format: 1 Alpha 5-9 Numeric
34
- 'MT' => ['J9G4n6E8a'], # Format: 9 Alpha And Numeric Combination
33
+ 'MO' => ['M12345678', 'M123456' , 'M12345679'], # Format: 1 Alpha 6-9 Numeric
34
+ 'MT' => ['J9G4n6E8a', '1234567890123'], # Format: 9 Alpha And Numeric Combination or 13 numeric
35
35
  'NE' => ['A123', 'A1234', 'A12345', 'A123456', 'A1234567', 'A12345678'], # Format: 1 Alpha 3-8 Numeric
36
- 'NV' => ['1234567890', '123456789123', 'X12345678'], # Format: 10 Numeric; or 12 Numeric; or X Followed By 8 Numeric
36
+ 'NV' => ['1234567890'], # Format: 10 Numeric
37
37
  'NH' => ['12ADF12345'], # Format: 2 Numeric 3 Alpha 5 Numeric
38
38
  'NJ' => ['F12345678901234'], # Format: 1 Alpha 14 Numeric
39
39
  'NY' => ['123456789'], # Format: 9 Numeric
40
40
  'NM' => ['123456789'], # Format: 9 Numeric
41
- 'NC' => ['123456', '1234567', '12345678', '123456789'], # Format: 6-9 Numeric
41
+ 'NC' => ['123456', '1234567', '12345678', '123456789', '123456789012'], # Format: Up to 12 numeric
42
42
  'ND' => ['123456789'], # Format: 9 Numeric
43
43
  'OH' => ['LK123456'], # Format: 2 Alpha 6 Numeric
44
- 'OK' => ['123456789'], # Format: 9 Numeric
45
- 'OR' => ['12345', '123456', '1234567'], # Format: 5-7 Numeric
44
+ 'OK' => ['O123456789'], # Format: 1 Alpha 9 Numeric
45
+ 'OR' => ['12345', '123456', '1234567'], # Format: Up to 7 numeric
46
46
  'PA' => ['12345678'], # Format: 8 Numeric
47
47
  'RI' => ['1234567'], # Format: 7 Numeric
48
48
  'SC' => ['123456789'], # Format: 9 Numeric
49
49
  'SD' => ['12345678'], # Format: 8 Numeric
50
- 'TN' => ['1234567', '12345678', '123456789'], # Format: 7,8 or 9 Numeric
50
+ 'TN' => ['12345678', '123456789'], # Format: 8 or 9 Numeric
51
51
  'TX' => ['12345678'], # Format: 8 Numeric
52
- 'UT' => ['123456', '1234567', '12345678', '123456789', '1234567890'], # Format: 6-10 Numeric
53
- 'VT' => ['12345678', '1234567K'], # Format: 8 Numeric; or 7 Numeric 1 Alpha
52
+ 'UT' => ['123456', '1234567', '12345678', '123456789', '1234'], # Format: 4-9 Numeric
53
+ 'VT' => ['12345678', '1234567A'], # Format: 8 Numeric; or 7 Numeric 1 Alpha is A
54
54
  'VA' => ['K12345678'], # Format: 1 Alpha 8 Numeric
55
55
  'WA' => ['123ghk456QWE'], # Format: 12 Characters
56
56
  'WV' => ['1234567', 'E123456'], # Format: 7 Numeric; or 1 Alpha 6 Numeric
57
57
  'WI' => ['W1234567890123'], # Format: 1 Alpha 13 Numeric
58
- 'WY' => ['123456789', '1234567890'] } # Format: 9-10 Numeric
58
+ 'WY' => ['123456789'] } # Format: 9 Numeric
59
59
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dl_validator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Medeiros
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-08-27 00:00:00.000000000 Z
11
+ date: 2013-09-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler