validates_zipcode 0.2.2 → 0.2.3

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: efbbd512c20b7660b85913ef836d65599ef4dae905bc8ee75db47f38d0e56fe0
4
- data.tar.gz: 44a6e8854d5da2ba59700392508912b8e1527277b96cbbbad5055df5f1e06f4d
3
+ metadata.gz: 343e69c647725f0880b8f407077fd94f5447eaed7d0cb04fe243d3014d96f7c5
4
+ data.tar.gz: 3bc68a4ef43157358344a855ab852694a00dc1885296103fbec60a9babff49f1
5
5
  SHA512:
6
- metadata.gz: 87fd34a69803910b4a0ccc6793fa240373ebe204efc4dc69eba4d75a8cf0858ff2170efabe8e8d082f74a569604a7a2e7781921362d277db9ab2a9d2505b5e61
7
- data.tar.gz: ec114161c1e3fa3a53623bdf909e25f6301f5c358a6cd33d3cddb64b981eac841a0834109c13fd037eead3e5dc4e2dbd6eb5dcd12f612302a5e7754c2f2b5275
6
+ metadata.gz: 256bb6fec230722b189f35bf6181d62ab97be209894e10476026a031a671d2f55434ec5dad6e15db0b0b75fde1a28aa414e5686aa124642d4c45032f0ad801b5
7
+ data.tar.gz: 498fbf19b2a2eac4e684fab5d9e5e484314126ce23c42dd8ff941aa72dcfcd582a28e83a94d15d287c3e0493608ec106d99770de0cb5972f61e55336db0d3190
data/.travis.yml CHANGED
@@ -13,15 +13,17 @@ before_install:
13
13
  script: "bundle exec rake"
14
14
 
15
15
  rvm:
16
- - 2.3.7
17
- - 2.4.4
18
- - 2.5.3
19
- - 2.6.0
16
+ - 2.4.9
17
+ - 2.5.7
18
+ - 2.6.5
19
+ - 2.7.0
20
20
  - ruby-head
21
+ - truffleruby
21
22
 
22
23
  gemfile:
23
24
  - gemfiles/rails_4.2.gemfile
24
25
  - gemfiles/rails_5.2.gemfile
26
+ - gemfiles/rails_6.0.gemfile
25
27
  - gemfiles/rails_edge.gemfile
26
28
 
27
29
  matrix:
@@ -29,11 +31,7 @@ matrix:
29
31
  allow_failures:
30
32
  - rvm: ruby-head
31
33
  exclude:
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
34
+ - rvm: 2.4.9
35
+ gemfile: gemfiles/rails_6.gemfile
36
+ - rvm: 2.4.9
39
37
  gemfile: gemfiles/rails_edge.gemfile
data/Appraisals CHANGED
@@ -8,6 +8,10 @@ appraise 'rails-5.2' do
8
8
  gem 'activemodel', '~> 5.2.0'
9
9
  end
10
10
 
11
+ appraise 'rails-6.0' do
12
+ gem 'activemodel', '~> 5.2.0'
13
+ end
14
+
11
15
  appraise 'rails_edge' do
12
16
  gem 'activemodel', github: 'rails/rails'
13
17
  end
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.2.3
6
+
7
+ - Fixes MU postal code format ~ @thrasherDGK
8
+
5
9
  ## 0.2.2
6
10
 
7
11
  - Fixes LT postal code format ~ @tmeckhoff
data/README.md CHANGED
@@ -4,7 +4,7 @@ Adds zipcode / postal code validation support to Rails (ActiveModel), considerin
4
4
 
5
5
  ``ValidatesZipcode`` currently support **233 country codes**. 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
- ``ValidatesZipcode`` works for Rails >= 3.2 and Ruby >= 1.9.3.
7
+ ``ValidatesZipcode`` supports Rails >= 4.2 and Ruby >= 2.0. It could probably work unsupported in Rails 3.2 and Ruby 1.9.3 as well. Truffleruby is also tested, but no reports of working in production apps for now.
8
8
 
9
9
  ## Installation
10
10
 
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- validates_zipcode (0.2.2)
4
+ validates_zipcode (0.2.3)
5
5
  activemodel (>= 3.2.0)
6
6
 
7
7
  GEM
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- validates_zipcode (0.2.2)
4
+ validates_zipcode (0.2.3)
5
5
  activemodel (>= 3.2.0)
6
6
 
7
7
  GEM
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "activemodel", "~> 5.2.0"
6
+
7
+ gemspec path: "../"
@@ -0,0 +1,57 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ validates_zipcode (0.2.3)
5
+ activemodel (>= 3.2.0)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ activemodel (5.2.3)
11
+ activesupport (= 5.2.3)
12
+ activesupport (5.2.3)
13
+ concurrent-ruby (~> 1.0, >= 1.0.2)
14
+ i18n (>= 0.7, < 2)
15
+ minitest (~> 5.1)
16
+ tzinfo (~> 1.1)
17
+ appraisal (2.2.0)
18
+ bundler
19
+ rake
20
+ thor (>= 0.14.0)
21
+ concurrent-ruby (1.1.5)
22
+ diff-lcs (1.3)
23
+ i18n (1.6.0)
24
+ concurrent-ruby (~> 1.0)
25
+ minitest (5.11.3)
26
+ rake (12.2.1)
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.3)
34
+ diff-lcs (>= 1.2.0, < 2.0)
35
+ rspec-support (~> 3.8.0)
36
+ rspec-mocks (3.8.0)
37
+ diff-lcs (>= 1.2.0, < 2.0)
38
+ rspec-support (~> 3.8.0)
39
+ rspec-support (3.8.0)
40
+ thor (0.20.3)
41
+ thread_safe (0.3.6)
42
+ tzinfo (1.2.5)
43
+ thread_safe (~> 0.1)
44
+
45
+ PLATFORMS
46
+ ruby
47
+
48
+ DEPENDENCIES
49
+ activemodel (~> 5.2.0)
50
+ appraisal
51
+ bundler
52
+ rake (~> 12.2.1)
53
+ rspec
54
+ validates_zipcode!
55
+
56
+ BUNDLED WITH
57
+ 2.0.2
@@ -73,7 +73,7 @@ module ValidatesZipcode
73
73
  MY: /\A\d{5}\z/,
74
74
  MV: /\A\d{5}\z/,
75
75
  MT: /\A[A-Z]{3}[ ]?\d{2,4}\z/,
76
- MU: /\A(\d{3}[A-Z]{2}\d{3})?\z/,
76
+ MU: /\A[ARar1-9]\d{4}\z/,
77
77
  MX: /\A\d{5}\z/,
78
78
  MA: /\A\d{5}\z/,
79
79
  NZ: /\A\d{4}\z/,
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module ValidatesZipcode
3
- VERSION = '0.2.2'
3
+ VERSION = '0.2.3'
4
4
  end
@@ -171,6 +171,22 @@ describe ValidatesZipcode, '#validate_each' do
171
171
  end
172
172
  end
173
173
 
174
+ context 'Mauritius' do
175
+ it 'validates with a valid zipcode' do
176
+ %w[42602 A2101 r6414].each do |zipcode|
177
+ record = build_record(zipcode, 'MU')
178
+ zipcode_should_be_valid(record)
179
+ end
180
+ end
181
+
182
+ it 'does not validate with an invalid zipcode' do
183
+ %w[05678 B4242].each do |zipcode|
184
+ record = build_record(zipcode, 'MU')
185
+ zipcode_should_be_invalid(record, zipcode)
186
+ end
187
+ end
188
+ end
189
+
174
190
  context 'Moldova' do
175
191
  it 'validates with a valid zipcode' do
176
192
  record = build_record('MD2001', 'MD')
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.2
4
+ version: 0.2.3
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-08-15 00:00:00.000000000 Z
11
+ date: 2020-02-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel
@@ -104,6 +104,8 @@ files:
104
104
  - gemfiles/rails_4.2.gemfile.lock
105
105
  - gemfiles/rails_5.2.gemfile
106
106
  - gemfiles/rails_5.2.gemfile.lock
107
+ - gemfiles/rails_6.0.gemfile
108
+ - gemfiles/rails_6.0.gemfile.lock
107
109
  - gemfiles/rails_edge.gemfile
108
110
  - gemfiles/rails_edge.gemfile.lock
109
111
  - lib/validates_zipcode.rb
@@ -135,7 +137,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
135
137
  - !ruby/object:Gem::Version
136
138
  version: '0'
137
139
  requirements: []
138
- rubygems_version: 3.0.3
140
+ rubygems_version: 3.0.6
139
141
  signing_key:
140
142
  specification_version: 4
141
143
  summary: Localizable zipcode validation for Rails.