validates_zipcode 0.0.9 → 0.0.10
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 +4 -4
- data/.travis.yml +2 -0
- data/CHANGELOG.md +5 -1
- data/README.md +2 -2
- data/lib/validates_zipcode/cldr_regex_collection.rb +1 -1
- data/lib/validates_zipcode/version.rb +1 -1
- data/spec/validates_zipcode_spec.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d92ec44117812b43729e6458b3df9671b1fa094a
|
4
|
+
data.tar.gz: 74f57e1b70b7e2d4f1154310b0c7db7e6923cfba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6b1e90c726fb81dc5531eb2b6a7b315547fb494c57d69cc0b6577b92e0f46a0a885ffc8ba5a00f6d4533dbbf2e2755d284e6200ad0f60ed0092e56fd0235dcd7
|
7
|
+
data.tar.gz: 1b0222049366748e77a7fa6d329676dd113103dccdbadc475eab09bc4bc5c9f61d4dd966bdc9c5aa15747e4d4af985f711dd55a85b9994547a875a66f3ae7a45
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,10 +1,14 @@
|
|
1
1
|
# Changelog
|
2
2
|
All notable changes to this project will be documented in this file.
|
3
3
|
|
4
|
+
## 0.0.10
|
5
|
+
|
6
|
+
- Support zip+6 for the USA ~ @dimroc
|
7
|
+
|
4
8
|
## 0.0.9
|
5
9
|
|
6
10
|
- Added Code of Conduct from Contributor Covenant ~ @dgilperez
|
7
|
-
- Fixed Regex for Greece thanks to @Masa331
|
11
|
+
- Fixed Regex for Greece thanks to @Masa331
|
8
12
|
|
9
13
|
## 0.0.8
|
10
14
|
|
data/README.md
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
# ValidatesZipcode [](https://travis-ci.org/dgilperez/validates_zipcode) [](https://codeclimate.com/github/dgilperez/validates_zipcode) [](http://badge.fury.io/rb/validates_zipcode) [](https://hakiri.io/github/dgilperez/validates_zipcode/master)
|
2
2
|
|
3
|
-
|
3
|
+
Adds zipcode / postal code validation support to Rails (ActiveModel), considering postal code formats for mostly every country.
|
4
4
|
|
5
|
-
``ValidatesZipcode`` currently support **259 countries**. Regex data taken from several sources, being the main source the [CLDR](http://unicode.org/cldr/trac/browser/tags/release-27-d05/common/supplemental/postalCodeData.xml) database (release 27, around 159). Any other country's
|
5
|
+
``ValidatesZipcode`` currently support **259 countries**. Regex data taken from several sources, being the main source the [CLDR](http://unicode.org/cldr/trac/browser/tags/release-27-d05/common/supplemental/postalCodeData.xml) database (release 27, around 159). Any other country's postal code will validate without errors.
|
6
6
|
|
7
7
|
``ValidatesZipcode`` works for Rails 3 & 4 and Ruby >= 1.9.3.
|
8
8
|
|
@@ -8,7 +8,7 @@ module ValidatesZipcode
|
|
8
8
|
JE: /\AJE\d[\dA-Z]?[ ]?\d[ABD-HJLN-UW-Z]{2}\z/,
|
9
9
|
GG: /\AGY\d[\dA-Z]?[ ]?\d[ABD-HJLN-UW-Z]{2}\z/,
|
10
10
|
IM: /\AIM\d[\dA-Z]?[ ]?\d[ABD-HJLN-UW-Z]{2}\z/,
|
11
|
-
US: /\A\d{5}([ \-]
|
11
|
+
US: /\A\d{5}([ \-](?:\d{4}|\d{6}))?\z/,
|
12
12
|
CA: /\A[ABCEGHJKLMNPRSTVXY]\d[ABCEGHJ-NPRSTV-Z][ ]?\d[ABCEGHJ-NPRSTV-Z]\d\z/,
|
13
13
|
DE: /\A\d{5}\z/,
|
14
14
|
AU: /\A\d{4}\z/,
|
@@ -19,7 +19,7 @@ describe ValidatesZipcode, '#validate_each' do
|
|
19
19
|
it 'does not add errors with a valid zipcode' do
|
20
20
|
record = build_record('93108', "US")
|
21
21
|
zipcode_should_be_valid(record)
|
22
|
-
[12345, '12345', '12345-1234'].each do |zipcode|
|
22
|
+
[12345, '12345', '12345-1234', '12345-123456', '12345 1234', '12345 123456'].each do |zipcode|
|
23
23
|
record = build_record(zipcode, 'US')
|
24
24
|
zipcode_should_be_valid(record)
|
25
25
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: validates_zipcode
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Gil
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-04-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|
@@ -114,7 +114,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
114
114
|
version: '0'
|
115
115
|
requirements: []
|
116
116
|
rubyforge_project:
|
117
|
-
rubygems_version: 2.
|
117
|
+
rubygems_version: 2.5.1
|
118
118
|
signing_key:
|
119
119
|
specification_version: 4
|
120
120
|
summary: Localizable zipcode validation for Rails.
|