postal_code 0.3.6 → 0.4.0
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/README.rdoc +9 -7
- data/Rakefile +1 -1
- data/lib/postal_code.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c75a3ecabf2745b7ac5a972b2d202a55c8f5cdcb57801054530fa8adb5abd749
|
4
|
+
data.tar.gz: 115410baecfbf654bfd90a6f6d21161f607cf8050b5087a4e43a7e98bdbca51c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 60635e64f5f2e697a9b3ccc98f7755124df5fd6c593db56a5efff7df1bc62b2047729e4908ac0bcc2ac50e09b966f96e8d32797380824dfdb04a75aec2beef8f
|
7
|
+
data.tar.gz: d447a5030d95546cefa897486be29b92407edf20c87e1c443705e0512c2e6938168670072bae94bf7e74693031a5aac1b2647735353e298c52bcf964be474244
|
data/README.rdoc
CHANGED
@@ -5,8 +5,8 @@ This library resolves a postal code to a corresponding city or state.
|
|
5
5
|
|
6
6
|
== Modes of operation
|
7
7
|
|
8
|
-
The library was designed to
|
9
|
-
|
8
|
+
The library was designed to use minimal resources and be responsive; therefore
|
9
|
+
one of the following data retrieval modes can be selected.
|
10
10
|
|
11
11
|
1. <b>Fetch from file with reactive caching (default).</b>
|
12
12
|
|
@@ -31,13 +31,13 @@ transparent modes of operation.
|
|
31
31
|
== Postal code data source
|
32
32
|
|
33
33
|
PostalCode uses a minimum required set of data (i.e., postal code, city, state)
|
34
|
-
from the {GeoNames.org}[
|
34
|
+
from the {GeoNames.org}[https://www.geonames.org] geographical database.
|
35
35
|
|
36
36
|
Currently, the implementation is US only. As of January 15, 2015, the database
|
37
37
|
contains 43,629 US postal code records.
|
38
38
|
|
39
39
|
Please give credit to GeoNames when you use this library. See their {terms &
|
40
|
-
conditions}[
|
40
|
+
conditions}[https://www.geonames.org/export/#terms] for details.
|
41
41
|
|
42
42
|
|
43
43
|
== The genesis
|
@@ -112,9 +112,9 @@ is returned.
|
|
112
112
|
|
113
113
|
To put this in perspective, if the entire population was evenly distributed
|
114
114
|
among all the postal codes and every single person used this library to find
|
115
|
-
his or her city, it would be incorrect for less than 0.
|
115
|
+
his or her city, it would be incorrect for less than 0.1% of the population.
|
116
116
|
|
117
|
-
Furthermore, {GeoNames.org}[
|
117
|
+
Furthermore, {GeoNames.org}[https://www.geonames.org] does not guarantee the
|
118
118
|
completeness or accuracy of their data.
|
119
119
|
|
120
120
|
|
@@ -157,10 +157,12 @@ Bug Tracker :: https://bitbucket.org/pachl/postal_code/issues
|
|
157
157
|
* Update US database. (515 additions and 7 deletions)
|
158
158
|
|
159
159
|
9. 2020-02-19, v0.3.6
|
160
|
+
* Update US database. (66 additions and 37 deletions)
|
161
|
+
|
162
|
+
10. 2020-02-20, v0.4.0
|
160
163
|
* Add API method PostalCode.valid\_format?
|
161
164
|
* Raise TypeError when a postal code parameter is not a string.
|
162
165
|
* Clean up validation tests.
|
163
|
-
* Update US database. (66 additions and 37 deletions)
|
164
166
|
|
165
167
|
|
166
168
|
== License
|
data/Rakefile
CHANGED
@@ -31,7 +31,7 @@ task :update_db do
|
|
31
31
|
|
32
32
|
for country_db in db/*.tsv
|
33
33
|
do country=`basename $country_db .tsv`
|
34
|
-
ftp -Vo $tmp
|
34
|
+
ftp -Vo $tmp https://download.geonames.org/export/zip/$country.zip
|
35
35
|
unzip -p $tmp $country.txt | cut -s -f2,3,5 | sort > $country_db
|
36
36
|
done
|
37
37
|
|
data/lib/postal_code.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: postal_code
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Clint Pachl
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-10-10 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Resolve a postal (ZIP) code to a corresponding city or state.
|
14
14
|
email: pachl@ecentryx.com
|