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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 774af0458bf2099d4c99b37c4cbdbde4cbfad4e0
4
- data.tar.gz: e0d2896a25815df7ab7f33ea7e04de788efa4d48
2
+ SHA256:
3
+ metadata.gz: 71091ed73ad646ae899ff230d3a6d5e2601375564cf715c09437fe7c54912765
4
+ data.tar.gz: b1470b3881ba256bf3f44cb0c31b2cdd7c7e57b3a4b2bc8e5e1317a25e46ee28
5
5
  SHA512:
6
- metadata.gz: f52173779ac815ad780312a8ee04d9c3a6b71e6c1739ce9c6083c58aa9f0a686cea6179c5924a5c994144852ce13964247ca2f59325a560a5b0cf57c675a0595
7
- data.tar.gz: 0f52e760f690496880c35725608089c29c2e7c6ecde839f5f1906496fcf7f76a14995a9d41475c4a527686dedcfa4d5dfa5328769c8e558bd04a723e0f85066a
6
+ metadata.gz: 29407f4a020dc0edff23bbd8375a166919fa1e5505218525e1be31777fdaf6d24706bf575418fe6287954bfc0ad35a83c84de7fdc2d961179502c5e4e562e236
7
+ data.tar.gz: c641fbd26f864670cd42388c563075189beb07c76b98e396fdc76ef14d446a54bcf628f9de51a854faf20eb59de84790ad54edbfec696fb0ae2a10f8287ddb02
@@ -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
 
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- validates_zipcode (0.1.0)
4
+ validates_zipcode (0.1.1)
5
5
  activemodel (>= 3.2.0)
6
6
 
7
7
  GEM
@@ -49,4 +49,4 @@ DEPENDENCIES
49
49
  validates_zipcode!
50
50
 
51
51
  BUNDLED WITH
52
- 1.16.1
52
+ 1.16.2
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- validates_zipcode (0.1.0)
4
+ validates_zipcode (0.1.1)
5
5
  activemodel (>= 3.2.0)
6
6
 
7
7
  GEM
@@ -56,4 +56,4 @@ DEPENDENCIES
56
56
  validates_zipcode!
57
57
 
58
58
  BUNDLED WITH
59
- 1.16.1
59
+ 1.16.2
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- validates_zipcode (0.1.0)
4
+ validates_zipcode (0.1.1)
5
5
  activemodel (>= 3.2.0)
6
6
 
7
7
  GEM
@@ -53,4 +53,4 @@ DEPENDENCIES
53
53
  validates_zipcode!
54
54
 
55
55
  BUNDLED WITH
56
- 1.16.1
56
+ 1.16.2
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- validates_zipcode (0.1.0)
4
+ validates_zipcode (0.1.1)
5
5
  activemodel (>= 3.2.0)
6
6
 
7
7
  GEM
@@ -54,4 +54,4 @@ DEPENDENCIES
54
54
  validates_zipcode!
55
55
 
56
56
  BUNDLED WITH
57
- 1.16.1
57
+ 1.16.2
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- validates_zipcode (0.1.0)
4
+ validates_zipcode (0.1.1)
5
5
  activemodel (>= 3.2.0)
6
6
 
7
7
  GEM
@@ -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?\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/,
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module ValidatesZipcode
3
- VERSION = '0.1.0'
3
+ VERSION = '0.1.1'
4
4
  end
@@ -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', 'id11qd', 'SW1A2AA'].each do |zipcode|
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.0
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-04-23 00:00:00.000000000 Z
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.6.12
148
+ rubygems_version: 2.7.7
149
149
  signing_key:
150
150
  specification_version: 4
151
151
  summary: Localizable zipcode validation for Rails.