dl_validator 0.0.1 → 0.0.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: 1c05229f64b822fccb05d6bde7ee27eab8bb9174
4
- data.tar.gz: d40fe53c6d599829a8efba5456b853bfba5854fb
3
+ metadata.gz: 4b00ae3875765353b1516e9b3a1a4bab19fd97d5
4
+ data.tar.gz: a8d90bf06f6ed87cc24263cf2e0422d4c3748b2d
5
5
  SHA512:
6
- metadata.gz: 0ad7df42dd1b12b1d5bf82b5a4bf773cffd49ebec00eed152608c5e926b834af5053b752e3c483ed0c589b18dfce70576664ab1e8aa8b3a22073a54505f0a1a4
7
- data.tar.gz: 9fc7b0dabe5031269375451e2516ef8f8e4f14f4b8ddfe30698664512ea46357fa8bc25f9260da6307f6a88d8dfd6dcdaacdca477dd37fc97cfe63ab5e64ed1e
6
+ metadata.gz: c5ac7ede864602cc52cb0e93d464fb52ebdaef4233e51ff6dce5feddb2dd9186af0f4300dd31abb3c8cb9531e14d5dc4d58e4ebdd6c884d8ae90106de91a0605
7
+ data.tar.gz: a4108d0785bd3939511d81529d050cc71a4eda13f58aba8f1f7d73c9d1e664521587bfcb13cfd8de2a37ce6aec1d74ffba61367ae595bbff39deffc1caa502ef
@@ -1,5 +1,5 @@
1
1
  module DlValidator
2
- class Config
2
+ class DlConfig
3
3
  # Constant frozen hash of states and abbreviations
4
4
  STATES = {
5
5
  'AL' => 'ALABAMA',
data/lib/dl_validator.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  require 'dl_validator/version'
2
- require 'config/config'
2
+ require 'config/dl_config'
3
3
  require 'extensions/drivers_license_invalid_validator' if defined?(Rails)
4
4
 
5
5
  module DlValidator
@@ -12,13 +12,13 @@ module DlValidator
12
12
  dl_state = dl_state.to_s.upcase.gsub(/(\W|\d|_)*/, '')
13
13
 
14
14
  # Stop here and return true if the state does not exist
15
- return true if !Config::STATES.include?(dl_state) and !Config::STATES.values.include?(dl_state)
15
+ return true if !DlConfig::STATES.include?(dl_state) and !DlConfig::STATES.values.include?(dl_state)
16
16
 
17
17
  # Find the state abbreviation key we need to access our regex hash.
18
18
  key = get_abbreviation_key(dl_state)
19
19
 
20
20
  # Regular expression match to validate the drivers license is invalid or not
21
- return false if Config::STATES_REGEX[key].match(dl_number)
21
+ return false if DlConfig::STATES_REGEX[key].match(dl_number)
22
22
  true
23
23
  end
24
24
 
@@ -27,7 +27,7 @@ module DlValidator
27
27
  # If the dl_state is greater than 2 then it is a full state name and we need to find the corresponding abbreviation for that state.
28
28
  key = ''
29
29
  if dl_state.length > 2
30
- Config::STATES.each do |k, v|
30
+ DlConfig::STATES.each do |k, v|
31
31
  key = k if v == dl_state
32
32
  end
33
33
  else
@@ -1,3 +1,3 @@
1
1
  module DlValidator
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -55,11 +55,11 @@ class DlValidatorTest < Test::Unit::TestCase
55
55
  end
56
56
 
57
57
  context '#get_abbreviation_key' do
58
- DlValidator::Config::STATES.each do |state_abbreviation, state_name|
58
+ DlValidator::DlConfig::STATES.each do |state_abbreviation, state_name|
59
59
  should "return the correct state abbreviation #{state_abbreviation}" do
60
60
  assert_equal state_abbreviation, DlValidator.get_abbreviation_key(state_name)
61
61
  end
62
62
  end
63
63
  end
64
64
  end
65
- end
65
+ 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.1
4
+ version: 0.0.2
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-08 00:00:00.000000000 Z
11
+ date: 2013-08-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -68,7 +68,7 @@ files:
68
68
  - README.md
69
69
  - Rakefile
70
70
  - dl_validator.gemspec
71
- - lib/config/config.rb
71
+ - lib/config/dl_config.rb
72
72
  - lib/dl_validator.rb
73
73
  - lib/dl_validator/version.rb
74
74
  - lib/extensions/drivers_license_invalid_validator.rb