postcode_validation 0.0.17 → 0.0.18
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 782ec608ca15c631a91e38699f1014ab30db3bdd
|
|
4
|
+
data.tar.gz: 043da2654318cef841b526aec3783a2397a75767
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9be77a10d9211d39a25afbfd6e0c33d52a18a8f593885d4181eeb0eff93f9d1ddea4c4e9e8780293bbf8b8ef2a6d5a4a8109a7c8fc032896720df5e82c796b6b
|
|
7
|
+
data.tar.gz: 715fb0156eb953190a62a45541d6257c1d51f90a8eaf321ace5997ae73fdce543074a00fc896698132a869a09fec74fb4cfcf6dd9e0bf5f14510f8cc8621f9e1
|
data/.ruby-version
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
2.3.1
|
|
@@ -4,6 +4,7 @@ require_relative 'format_validators/gb_postcode_validator'
|
|
|
4
4
|
require_relative 'format_validators/fr_postcode_validator'
|
|
5
5
|
require_relative 'format_validators/sg_postcode_validator'
|
|
6
6
|
require_relative 'format_validators/in_postcode_validator'
|
|
7
|
+
require_relative 'format_validators/vn_postcode_validator'
|
|
7
8
|
require_relative 'format_validators/no_op_postcode_validator'
|
|
8
9
|
|
|
9
10
|
module PostcodeValidation
|
|
@@ -24,6 +25,8 @@ module PostcodeValidation
|
|
|
24
25
|
FormatValidators::SGPostcodeValidator.new
|
|
25
26
|
when 'IN'
|
|
26
27
|
FormatValidators::INPostcodeValidator.new
|
|
28
|
+
when 'VN'
|
|
29
|
+
FormatValidators::VNPostcodeValidator.new
|
|
27
30
|
else
|
|
28
31
|
FormatValidators::NoOpPostcodeValidator.new
|
|
29
32
|
end
|
data/lib/postcode_validation/use_case/validate_address/format_validators/vn_postcode_validator.rb
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
require_relative 'regex_validator'
|
|
2
|
+
require_relative 'use_format_check_only'
|
|
3
|
+
|
|
4
|
+
module PostcodeValidation
|
|
5
|
+
module UseCase
|
|
6
|
+
class ValidateAddress
|
|
7
|
+
module FormatValidators
|
|
8
|
+
class VNPostcodeValidator < RegexValidator
|
|
9
|
+
include UseFormatCheckOnly
|
|
10
|
+
|
|
11
|
+
REGEX = /^[1-9][0-9]{5}$/
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: postcode_validation
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.18
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Craig J. Bass
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2017-07-
|
|
11
|
+
date: 2017-07-21 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: httparty
|
|
@@ -118,6 +118,7 @@ files:
|
|
|
118
118
|
- ".env"
|
|
119
119
|
- ".gitignore"
|
|
120
120
|
- ".rspec"
|
|
121
|
+
- ".ruby-version"
|
|
121
122
|
- ".travis.yml"
|
|
122
123
|
- Gemfile
|
|
123
124
|
- LICENSE.txt
|
|
@@ -147,6 +148,7 @@ files:
|
|
|
147
148
|
- lib/postcode_validation/use_case/validate_address/format_validators/sg_postcode_validator.rb
|
|
148
149
|
- lib/postcode_validation/use_case/validate_address/format_validators/use_external_postcode_validator.rb
|
|
149
150
|
- lib/postcode_validation/use_case/validate_address/format_validators/use_format_check_only.rb
|
|
151
|
+
- lib/postcode_validation/use_case/validate_address/format_validators/vn_postcode_validator.rb
|
|
150
152
|
- lib/postcode_validation/version.rb
|
|
151
153
|
- postcode_validation.gemspec
|
|
152
154
|
homepage:
|
|
@@ -169,7 +171,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
169
171
|
version: '0'
|
|
170
172
|
requirements: []
|
|
171
173
|
rubyforge_project:
|
|
172
|
-
rubygems_version: 2.5.
|
|
174
|
+
rubygems_version: 2.5.1
|
|
173
175
|
signing_key:
|
|
174
176
|
specification_version: 4
|
|
175
177
|
summary: Provides really basic postcode validation (intended for eCommerce platforms).
|