validates_zipcode 0.0.9 → 0.0.10

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: fc753ae28483c43a47c1b9ddce7ffd1f173eb4ec
4
- data.tar.gz: d97bc060568e9572b0a4f8eb8c622aa626206b82
3
+ metadata.gz: d92ec44117812b43729e6458b3df9671b1fa094a
4
+ data.tar.gz: 74f57e1b70b7e2d4f1154310b0c7db7e6923cfba
5
5
  SHA512:
6
- metadata.gz: 3763d277e9f3bf990bc7164089d639b04878a0056b2756214f781d7c63f9d847d36a79f380ae25b6a4104e27ab41bbbc34c7eaab4b76d9d5f5c181b6bc911086
7
- data.tar.gz: 25e77e02daae5d6f408f799023f4f4506ebfc3031aaca0c6c6fc01b7a4994761b40655b5f20f939791fc076f1fe024c55a614858892d4c08c5f149bf39089cdd
6
+ metadata.gz: 6b1e90c726fb81dc5531eb2b6a7b315547fb494c57d69cc0b6577b92e0f46a0a885ffc8ba5a00f6d4533dbbf2e2755d284e6200ad0f60ed0092e56fd0235dcd7
7
+ data.tar.gz: 1b0222049366748e77a7fa6d329676dd113103dccdbadc475eab09bc4bc5c9f61d4dd966bdc9c5aa15747e4d4af985f711dd55a85b9994547a875a66f3ae7a45
data/.travis.yml CHANGED
@@ -3,3 +3,5 @@ rvm:
3
3
  - 2.0.0
4
4
  - 2.1.0
5
5
  - 2.2.2
6
+ before_install:
7
+ - gem install bundler
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 [![Build Status](https://secure.travis-ci.org/dgilperez/validates_zipcode.png)](https://travis-ci.org/dgilperez/validates_zipcode) [![Code Climate](https://codeclimate.com/github/dgilperez/validates_zipcode/badges/gpa.svg)](https://codeclimate.com/github/dgilperez/validates_zipcode) [![Gem Version](https://badge.fury.io/rb/validates_zipcode.svg)](http://badge.fury.io/rb/validates_zipcode) [![security](https://hakiri.io/github/dgilperez/validates_zipcode/master.svg)](https://hakiri.io/github/dgilperez/validates_zipcode/master)
2
2
 
3
- Add zipcode validation support to Rails (ActiveModel), considering different zipcode country formats.
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 zipcode will validate without errors.
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}([ \-]\d{4})?\z/,
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/,
@@ -1,3 +1,3 @@
1
1
  module ValidatesZipcode
2
- VERSION = "0.0.9"
2
+ VERSION = "0.0.10"
3
3
  end
@@ -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.9
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-03-02 00:00:00.000000000 Z
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.4.5.1
117
+ rubygems_version: 2.5.1
118
118
  signing_key:
119
119
  specification_version: 4
120
120
  summary: Localizable zipcode validation for Rails.