validates_zipcode 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +5 -1
- data/gemfiles/rails_3.2.gemfile.lock +2 -2
- data/gemfiles/rails_4.2.gemfile.lock +2 -2
- data/gemfiles/rails_5.0.gemfile.lock +2 -2
- data/gemfiles/rails_5.1.gemfile.lock +2 -2
- data/gemfiles/rails_5.2.gemfile.lock +2 -2
- data/lib/validates_zipcode/cldr_regex_collection.rb +2 -2
- data/lib/validates_zipcode/version.rb +1 -1
- data/spec/validates_zipcode_spec.rb +4 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 71091ed73ad646ae899ff230d3a6d5e2601375564cf715c09437fe7c54912765
|
4
|
+
data.tar.gz: b1470b3881ba256bf3f44cb0c31b2cdd7c7e57b3a4b2bc8e5e1317a25e46ee28
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 29407f4a020dc0edff23bbd8375a166919fa1e5505218525e1be31777fdaf6d24706bf575418fe6287954bfc0ad35a83c84de7fdc2d961179502c5e4e562e236
|
7
|
+
data.tar.gz: c641fbd26f864670cd42388c563075189beb07c76b98e396fdc76ef14d446a54bcf628f9de51a854faf20eb59de84790ad54edbfec696fb0ae2a10f8287ddb02
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,10 @@
|
|
2
2
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
|
5
|
+
## 0.1.1
|
6
|
+
|
7
|
+
- Relaxes UK / GB regex to support codes without whitespace. Fixes backward compatibility breaking in 0.0.20. ~ Thanks to @tom-lord
|
8
|
+
|
5
9
|
## 0.1.0
|
6
10
|
|
7
11
|
- Dropped support for Rails 4.0 and 4.1 and for older minor Ruby 2 versions. This means those versions or combinations will not be tested, they may still work but will not receive support. This change could potentially break some apps in the future. Also, gem is stable enough to merit a minor version. Hence, 0.1.0 is here.
|
@@ -9,7 +13,7 @@ All notable changes to this project will be documented in this file.
|
|
9
13
|
|
10
14
|
## 0.0.20
|
11
15
|
|
12
|
-
- Merge UK and GB regex, using official regex provided by gob.uk ~ @Onumis @dgilperez
|
16
|
+
- Merge UK and GB regex, using official regex provided by gob.uk. Breaks compatibility for codes without whitespace ~ @Onumis @dgilperez
|
13
17
|
|
14
18
|
## 0.0.19
|
15
19
|
|
@@ -5,8 +5,8 @@
|
|
5
5
|
module ValidatesZipcode
|
6
6
|
module CldrRegexpCollection
|
7
7
|
ZIPCODES_REGEX = {
|
8
|
-
GB: /\AGIR ?0AA|((([A-Z]\d{1,2})|(([A-Z][A-HJ-Y]\d{1,2})|(([A-Z]\d[A-Z])|([A-Z][A-HJ-Y]\d?[A-Z]))))
|
9
|
-
UK: /\AGIR ?0AA|((([A-Z]\d{1,2})|(([A-Z][A-HJ-Y]\d{1,2})|(([A-Z]\d[A-Z])|([A-Z][A-HJ-Y]\d?[A-Z]))))
|
8
|
+
GB: /\AGIR ?0AA|((([A-Z]\d{1,2})|(([A-Z][A-HJ-Y]\d{1,2})|(([A-Z]\d[A-Z])|([A-Z][A-HJ-Y]\d?[A-Z])))) ?\d[A-Z]{2})\z/i,
|
9
|
+
UK: /\AGIR ?0AA|((([A-Z]\d{1,2})|(([A-Z][A-HJ-Y]\d{1,2})|(([A-Z]\d[A-Z])|([A-Z][A-HJ-Y]\d?[A-Z])))) ?\d[A-Z]{2})\z/i,
|
10
10
|
# GB: /\AGIR[ ]?0AA|((AB|AL|B|BA|BB|BD|BH|BL|BN|BR|BS|BT|CA|CB|CF|CH|CM|CO|CR|CT|CV|CW|DA|DD|DE|DG|DH|DL|DN|DT|DY|E|EC|EH|EN|EX|FK|FY|G|GL|GY|GU|HA|HD|HG|HP|HR|HS|HU|HX|IG|IM|IP|IV|JE|KA|KT|KW|KY|L|LA|LD|LE|LL|LN|LS|LU|M|ME|MK|ML|N|NE|NG|NN|NP|NR|NW|OL|OX|PA|PE|PH|PL|PO|PR|RG|RH|RM|S|SA|SE|SG|SK|SL|SM|SN|SO|SP|SR|SS|ST|SW|SY|TA|TD|TF|TN|TQ|TR|TS|TW|UB|W|WA|WC|WD|WF|WN|WR|WS|WV|YO|ZE)(\d[\dA-Z]?[ ]?\d[ABD-HJLN-UW-Z]{2}))|BFPO[ ]?\d{1,4}\z/i,
|
11
11
|
# UK: /\A([A-PR-UWYZ0-9][A-HK-Y0-9][AEHMNPRTVXY0-9]?[ABEHMNPRVWXY0-9]? {1,2}[0-9][ABD-HJLN-UW-Z]{2}|GIR 0AA)\z/,
|
12
12
|
JE: /\AJE\d[\dA-Z]?[ ]?\d[ABD-HJLN-UW-Z]{2}\z/,
|
@@ -274,7 +274,9 @@ describe ValidatesZipcode, '#validate_each' do
|
|
274
274
|
'SW1A 2AA',
|
275
275
|
'W1K 7DA',
|
276
276
|
'id1 1qd',
|
277
|
-
'Sw1A 2aA'
|
277
|
+
'Sw1A 2aA',
|
278
|
+
'id11qd',
|
279
|
+
'SW1A2AA'
|
278
280
|
].each do |zipcode|
|
279
281
|
record = build_record(zipcode, cc)
|
280
282
|
zipcode_should_be_valid(record)
|
@@ -282,7 +284,7 @@ describe ValidatesZipcode, '#validate_each' do
|
|
282
284
|
end
|
283
285
|
|
284
286
|
it 'does not validate with an invalid zipcode' do
|
285
|
-
[nil, '', 'nope', '
|
287
|
+
[nil, '', 'nope', 'id11qd1000', '28001'].each do |zipcode|
|
286
288
|
record = build_record(zipcode, cc)
|
287
289
|
zipcode_should_be_invalid(record, nil)
|
288
290
|
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.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Gil
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-10-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|
@@ -145,7 +145,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
145
145
|
version: '0'
|
146
146
|
requirements: []
|
147
147
|
rubyforge_project:
|
148
|
-
rubygems_version: 2.
|
148
|
+
rubygems_version: 2.7.7
|
149
149
|
signing_key:
|
150
150
|
specification_version: 4
|
151
151
|
summary: Localizable zipcode validation for Rails.
|