validates_zipcode 0.2.2 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +9 -11
- data/Appraisals +4 -0
- data/CHANGELOG.md +4 -0
- data/README.md +1 -1
- data/gemfiles/rails_4.2.gemfile.lock +1 -1
- data/gemfiles/rails_5.2.gemfile.lock +1 -1
- data/gemfiles/rails_6.0.gemfile +7 -0
- data/gemfiles/rails_6.0.gemfile.lock +57 -0
- data/lib/validates_zipcode/cldr_regex_collection.rb +1 -1
- data/lib/validates_zipcode/version.rb +1 -1
- data/spec/validates_zipcode_spec.rb +16 -0
- metadata +5 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 343e69c647725f0880b8f407077fd94f5447eaed7d0cb04fe243d3014d96f7c5
|
|
4
|
+
data.tar.gz: 3bc68a4ef43157358344a855ab852694a00dc1885296103fbec60a9babff49f1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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.
|
|
17
|
-
- 2.
|
|
18
|
-
- 2.5
|
|
19
|
-
- 2.
|
|
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.
|
|
33
|
-
gemfile: gemfiles/
|
|
34
|
-
- rvm: 2.
|
|
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
data/CHANGELOG.md
CHANGED
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``
|
|
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
|
|
|
@@ -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
|
|
@@ -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.
|
|
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:
|
|
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.
|
|
140
|
+
rubygems_version: 3.0.6
|
|
139
141
|
signing_key:
|
|
140
142
|
specification_version: 4
|
|
141
143
|
summary: Localizable zipcode validation for Rails.
|