validates_zipcode 0.2.0 → 0.2.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
2
  SHA256:
3
- metadata.gz: 6f552cb265e05972688928d50c57fe8c5776aab50ad7b571ddca0c95821fcff3
4
- data.tar.gz: f0b9e0d9bc534729e463218104e8e9b2d5bc0c1ef089ce0ca44189f0da94816a
3
+ metadata.gz: 28749acf8368d0467f685cee92bb54476c3b49ebe5b4bd95c347ee9f3ba28bcd
4
+ data.tar.gz: 724fc6dace5e4d37f81ad0183c373533e938fe8c2f67ded5b4ba31626ef55c2e
5
5
  SHA512:
6
- metadata.gz: 7d15ec2c9c6aee01cbfbd0c7691149249bf5cfbedd402aff198b4919dd5d4abc966963f97b6101ee74281dbf0e39b1ad9ecefd6f3f9d7e89b102db2fab7564ef
7
- data.tar.gz: ecf55dcfbd48516abe7c9de10fc06558c3cff5a0102a5bf10dfa870f2ad7a8d7da888f40f052a03400f2d7ed76819a9d3e4f5719e5634f3aa4fc9ae8885b190b
6
+ metadata.gz: d11fe3c378ec82922b225758b5dccc5616c84fea88a46cdec2bd13cbedc8d730565b4e616cd9e727d92dec62cddf362c505c503e23dcb88f8c5293db20634dc0
7
+ data.tar.gz: de90359182f4c55a9e188160a6d4f2035b3808e76472529ec300a4aa6d2a5ab844596a303001126c6b22069dd5c5507f40b4795edb2f7fc8625a84cec6d81d96
data/.travis.yml CHANGED
@@ -1,19 +1,23 @@
1
+ dist: xenial
2
+ language: ruby
1
3
  sudo: false
2
4
 
3
5
  cache: bundler
4
6
 
5
- script: "bundle exec rake"
7
+ bundler_args: --jobs 3 --retry 3
6
8
 
7
9
  before_install:
8
- - gem update --system
9
- - gem install bundler
10
+ - "travis_retry gem update --system"
11
+ - "travis_retry gem install bundler"
12
+
13
+ script: "bundle exec rake"
10
14
 
11
15
  rvm:
12
- - 2.2.10
13
16
  - 2.3.7
14
17
  - 2.4.4
15
- - 2.5.1
18
+ - 2.5.3
16
19
  - 2.6.0
20
+ - ruby-head
17
21
 
18
22
  gemfile:
19
23
  - gemfiles/rails_4.2.gemfile
@@ -22,12 +26,14 @@ gemfile:
22
26
 
23
27
  matrix:
24
28
  fast_finish: true
29
+ allow_failures:
30
+ - rvm: ruby-head
25
31
  exclude:
26
- - rvm: 2.2.10
27
- gemfile: gemfiles/rails_5.2.gemfile
28
- - rvm: 2.2.10
29
- gemfile: gemfiles/rails_edge.2.gemfile
30
- - rvm: 2.3.7
31
- gemfile: gemfiles/rails_edge.2.gemfile
32
- - rvm: 2.4.4
33
- gemfile: gemfiles/rails_edge.2.gemfile
32
+ - rvm: 2.2.10
33
+ gemfile: gemfiles/rails_5.2.gemfile
34
+ - rvm: 2.2.10
35
+ gemfile: gemfiles/rails_edge.gemfile
36
+ - rvm: 2.3.7
37
+ gemfile: gemfiles/rails_edge.gemfile
38
+ - rvm: 2.4.4
39
+ gemfile: gemfiles/rails_edge.gemfile
data/CHANGELOG.md CHANGED
@@ -2,9 +2,13 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## 0.2.1
6
+
7
+ - Fixes NI postal code format ~ Daniel Olivares
8
+
5
9
  ## 0.2.0
6
10
 
7
- - Dropped support for Rails 3.2, 4.0, 4.1 and Ruby 1.9.3. This means those versions or combinations may still work for you, but they will not be tested nor receive support.
11
+ - Dropped support for Rails 3.2, 4.0, 4.1 and Ruby 1.9.3 and Ruby less than Ruby 2.3. This means those versions or combinations may still work for you, but they will not be tested nor receive support.
8
12
  - Added support for Rails 6.0. Yeehaw!
9
13
  - Support for Taiwan 5-digit codes, thanks to ~ @ThomasChiesa
10
14
 
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- validates_zipcode (0.2.0)
4
+ validates_zipcode (0.2.1)
5
5
  activemodel (>= 3.2.0)
6
6
 
7
7
  GEM
@@ -50,10 +50,10 @@ PLATFORMS
50
50
  DEPENDENCIES
51
51
  activemodel (~> 4.2.0)
52
52
  appraisal
53
- bundler (~> 1.6)
53
+ bundler
54
54
  rake (~> 12.2.1)
55
55
  rspec
56
56
  validates_zipcode!
57
57
 
58
58
  BUNDLED WITH
59
- 1.17.3
59
+ 2.0.1
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- validates_zipcode (0.2.0)
4
+ validates_zipcode (0.2.1)
5
5
  activemodel (>= 3.2.0)
6
6
 
7
7
  GEM
@@ -20,24 +20,24 @@ GEM
20
20
  thor (>= 0.14.0)
21
21
  concurrent-ruby (1.1.4)
22
22
  diff-lcs (1.3)
23
- i18n (1.4.0)
23
+ i18n (1.5.3)
24
24
  concurrent-ruby (~> 1.0)
25
25
  minitest (5.11.3)
26
26
  rake (12.2.1)
27
- rspec (3.5.0)
28
- rspec-core (~> 3.5.0)
29
- rspec-expectations (~> 3.5.0)
30
- rspec-mocks (~> 3.5.0)
31
- rspec-core (3.5.4)
32
- rspec-support (~> 3.5.0)
33
- rspec-expectations (3.5.0)
27
+ rspec (3.8.0)
28
+ rspec-core (~> 3.8.0)
29
+ rspec-expectations (~> 3.8.0)
30
+ rspec-mocks (~> 3.8.0)
31
+ rspec-core (3.8.0)
32
+ rspec-support (~> 3.8.0)
33
+ rspec-expectations (3.8.2)
34
34
  diff-lcs (>= 1.2.0, < 2.0)
35
- rspec-support (~> 3.5.0)
36
- rspec-mocks (3.5.0)
35
+ rspec-support (~> 3.8.0)
36
+ rspec-mocks (3.8.0)
37
37
  diff-lcs (>= 1.2.0, < 2.0)
38
- rspec-support (~> 3.5.0)
39
- rspec-support (3.5.0)
40
- thor (0.19.4)
38
+ rspec-support (~> 3.8.0)
39
+ rspec-support (3.8.0)
40
+ thor (0.20.3)
41
41
  thread_safe (0.3.6)
42
42
  tzinfo (1.2.5)
43
43
  thread_safe (~> 0.1)
@@ -48,10 +48,10 @@ PLATFORMS
48
48
  DEPENDENCIES
49
49
  activemodel (~> 5.2.0)
50
50
  appraisal
51
- bundler (~> 1.6)
51
+ bundler
52
52
  rake (~> 12.2.1)
53
53
  rspec
54
54
  validates_zipcode!
55
55
 
56
56
  BUNDLED WITH
57
- 1.17.3
57
+ 2.0.1
@@ -1,19 +1,20 @@
1
1
  GIT
2
2
  remote: https://github.com/rails/rails.git
3
- revision: 1e09019088760adafaa122eb11c24effdb4c1160
3
+ revision: bd0618b1f3c684a7b5294e05e7c9abb0fd5b42d8
4
4
  specs:
5
- activemodel (6.0.0.alpha)
6
- activesupport (= 6.0.0.alpha)
7
- activesupport (6.0.0.alpha)
5
+ activemodel (6.1.0.alpha)
6
+ activesupport (= 6.1.0.alpha)
7
+ activesupport (6.1.0.alpha)
8
8
  concurrent-ruby (~> 1.0, >= 1.0.2)
9
9
  i18n (>= 0.7, < 2)
10
10
  minitest (~> 5.1)
11
11
  tzinfo (~> 1.1)
12
+ zeitwerk (~> 2.1, >= 2.1.4)
12
13
 
13
14
  PATH
14
15
  remote: ..
15
16
  specs:
16
- validates_zipcode (0.2.0)
17
+ validates_zipcode (0.2.1)
17
18
  activemodel (>= 3.2.0)
18
19
 
19
20
  GEM
@@ -23,9 +24,9 @@ GEM
23
24
  bundler
24
25
  rake
25
26
  thor (>= 0.14.0)
26
- concurrent-ruby (1.1.4)
27
+ concurrent-ruby (1.1.5)
27
28
  diff-lcs (1.3)
28
- i18n (1.4.0)
29
+ i18n (1.6.0)
29
30
  concurrent-ruby (~> 1.0)
30
31
  minitest (5.11.3)
31
32
  rake (12.2.1)
@@ -46,6 +47,7 @@ GEM
46
47
  thread_safe (0.3.6)
47
48
  tzinfo (1.2.5)
48
49
  thread_safe (~> 0.1)
50
+ zeitwerk (2.1.6)
49
51
 
50
52
  PLATFORMS
51
53
  ruby
@@ -53,10 +55,10 @@ PLATFORMS
53
55
  DEPENDENCIES
54
56
  activemodel!
55
57
  appraisal
56
- bundler (~> 1.6)
58
+ bundler
57
59
  rake (~> 12.2.1)
58
60
  rspec
59
61
  validates_zipcode!
60
62
 
61
63
  BUNDLED WITH
62
- 1.17.3
64
+ 2.0.1
@@ -77,7 +77,7 @@ module ValidatesZipcode
77
77
  MX: /\A\d{5}\z/,
78
78
  MA: /\A\d{5}\z/,
79
79
  NZ: /\A\d{4}\z/,
80
- NI: /\A((\d{4}-)?\d{3}-\d{3}(-\d{1})?)?\z/,
80
+ NI: /\A\d{5}\z/,
81
81
  NG: /\A(\d{6})?\z/,
82
82
  OM: /\A(PC )?\d{3}\z/,
83
83
  PK: /\A\d{5}\z/,
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module ValidatesZipcode
3
- VERSION = '0.2.0'
3
+ VERSION = '0.2.1'
4
4
  end
@@ -324,6 +324,23 @@ describe ValidatesZipcode, '#validate_each' do
324
324
  end
325
325
  end
326
326
 
327
+ context 'Nicaragua' do
328
+ it 'validates with a valid zipcode' do
329
+ # @see https://en.wikipedia.org/wiki/Postal_codes_in_Nicaragua
330
+ ['11002', '11034'].each do |zipcode|
331
+ record = build_record(zipcode, 'NI')
332
+ zipcode_should_be_valid(record)
333
+ end
334
+ end
335
+
336
+ it 'does not validate with an invalid zipcode' do
337
+ ['1002', '111034'].each do |zipcode|
338
+ record = build_record(zipcode, 'NI')
339
+ zipcode_should_be_invalid(record, zipcode)
340
+ end
341
+ end
342
+ end
343
+
327
344
  context 'unknown country' do
328
345
  it 'does not add errors with a any zipcode' do
329
346
  record = build_record('A1J2Z9', 'ZZ')
@@ -24,7 +24,7 @@ Gem::Specification.new do |s|
24
24
  s.add_dependency 'activemodel', '>= 3.2.0'
25
25
 
26
26
  s.add_development_dependency 'appraisal'
27
- s.add_development_dependency 'bundler', '~> 1.6'
27
+ s.add_development_dependency 'bundler'
28
28
  s.add_development_dependency 'rake', '~> 12.2.1'
29
29
  s.add_development_dependency 'rspec'
30
30
  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.2.0
4
+ version: 0.2.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: 2019-01-06 00:00:00.000000000 Z
11
+ date: 2019-05-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel
@@ -42,16 +42,16 @@ dependencies:
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: '1.6'
47
+ version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: '1.6'
54
+ version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rake
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -135,7 +135,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
135
135
  - !ruby/object:Gem::Version
136
136
  version: '0'
137
137
  requirements: []
138
- rubygems_version: 3.0.2
138
+ rubygems_version: 3.0.3
139
139
  signing_key:
140
140
  specification_version: 4
141
141
  summary: Localizable zipcode validation for Rails.