postcodeapi 2.0.0 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.txt +4 -0
- data/README.md +8 -5
- data/lib/postcodeapi/api.rb +1 -0
- data/lib/postcodeapi/version.rb +1 -1
- data/spec/postcodeapi/api_spec.rb +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9e8522ce391a4e92ccf96988eee2fa108b4fa35f
|
4
|
+
data.tar.gz: 35a66615e0b3f50f8adad99ee3b70372b7dba863
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e0f55f8c0f53909c8370758e17cbb731acb820a1a0f0a343b0a0d2fd846a3f029b86d6c285c08f9014018ca92843f68781cf06ccfac083b1fe16c0bcd32e823c
|
7
|
+
data.tar.gz: ca6d63b7371935a7885083461069d7442750d2ba3b121e19548d32131323594ba742ac95a5cf777a0f81f8ee74ee6b1578fdaf03b3565d3f707b76e62bbb08a2
|
data/CHANGELOG.txt
CHANGED
data/README.md
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
# Postcodeapi [![Build Status](https://travis-ci.org/ariejan/postcodeapi.png?branch=master)](https://travis-ci.org/ariejan/postcodeapi)
|
2
2
|
|
3
|
-
This is a small Ruby wrapper around the postcodeapi.nu API, which allows you
|
3
|
+
This is a small Ruby wrapper around the postcodeapi.nu API, which allows you
|
4
4
|
to resolve Dutch postcodes to street and city names.
|
5
5
|
|
6
|
-
**postcodeapi-2.x is only compatible with PostcodeAPI v2. PostcodeAPI v1 is
|
6
|
+
**postcodeapi-2.x is only compatible with PostcodeAPI v2. PostcodeAPI v1 is
|
7
7
|
deprecated and will be taken offline on 2016-03-01.**
|
8
8
|
|
9
9
|
## Installation
|
@@ -24,6 +24,7 @@ Or install it yourself as:
|
|
24
24
|
|
25
25
|
Firstly, sign up for a free API key at http://postcodeapi.nu, then use this gem like this:
|
26
26
|
|
27
|
+
require 'net/https'
|
27
28
|
require 'pp'
|
28
29
|
require 'postcodeapi'
|
29
30
|
|
@@ -61,7 +62,7 @@ Firstly, sign up for a free API key at http://postcodeapi.nu, then use this gem
|
|
61
62
|
{"self"=>
|
62
63
|
{"href"=>
|
63
64
|
"https://postcode-api.apiwise.nl/v2/addresses/0848200000005576/"}}}]}
|
64
|
-
|
65
|
+
|
65
66
|
There is also `#simple_addresses` to retrieve a minimal set of data:
|
66
67
|
|
67
68
|
irb> pp api.simple_addresses("5694AJ", 1)
|
@@ -69,11 +70,12 @@ There is also `#simple_addresses` to retrieve a minimal set of data:
|
|
69
70
|
[{"latitude"=>51.5131728171,
|
70
71
|
"longitude"=>5.50767699298,
|
71
72
|
"municipality"=>"Son en Breugel",
|
73
|
+
"city"=>"Son en Breugel",
|
72
74
|
"postcode"=>"5694AJ",
|
73
75
|
"province"=>"Noord-Brabant",
|
74
76
|
"street"=>"Sint Catharinastraat"}]}
|
75
77
|
|
76
|
-
Please note that the house number is optional.
|
78
|
+
Please note that the house number is optional.
|
77
79
|
|
78
80
|
## Contributing
|
79
81
|
|
@@ -88,12 +90,13 @@ specs will not be merged.
|
|
88
90
|
|
89
91
|
## Contributors
|
90
92
|
|
91
|
-
Original author:
|
93
|
+
Original author:
|
92
94
|
|
93
95
|
* Ariejan de Vroom, https://ariejan.net
|
94
96
|
|
95
97
|
Github contributors
|
96
98
|
|
99
|
+
* lucianleustean
|
97
100
|
* pedrocatalao
|
98
101
|
* martijn
|
99
102
|
* WvanLelyveld
|
data/lib/postcodeapi/api.rb
CHANGED
@@ -44,6 +44,7 @@ module Postcode
|
|
44
44
|
{ latitude: entry.geo.center.wgs84.coordinates.last,
|
45
45
|
longitude: entry.geo.center.wgs84.coordinates.first,
|
46
46
|
municipality: entry.municipality.label,
|
47
|
+
city: entry.city.label,
|
47
48
|
postcode: entry.postcode,
|
48
49
|
province: entry.province.label,
|
49
50
|
street: entry.street
|
data/lib/postcodeapi/version.rb
CHANGED
@@ -46,6 +46,7 @@ describe Postcode::API do
|
|
46
46
|
expect(result.addresses).to_not be_empty
|
47
47
|
expect(result.addresses.first.street).to eq("Wilhelminapark")
|
48
48
|
expect(result.addresses.first.postcode).to eq("5041EB")
|
49
|
+
expect(result.addresses.first.city.label).to eq("Tilburg")
|
49
50
|
expect(result.addresses.first.municipality.label).to eq("Tilburg")
|
50
51
|
expect(result.addresses.first.geo.center.wgs84.coordinates.last).to eq(51.5666652242)
|
51
52
|
expect(result.addresses.first.geo.center.wgs84.coordinates.first).to eq(5.07699118186)
|
@@ -59,6 +60,7 @@ describe Postcode::API do
|
|
59
60
|
expect(result.addresses).not_to be_empty
|
60
61
|
expect(result.addresses.first.street).to eq("Wilhelminapark")
|
61
62
|
expect(result.addresses.first.postcode).to eq("5041EB")
|
63
|
+
expect(result.addresses.first.city).to eq("Tilburg")
|
62
64
|
expect(result.addresses.first.municipality).to eq("Tilburg")
|
63
65
|
expect(result.addresses.first.latitude).to eq(51.5666652242)
|
64
66
|
expect(result.addresses.first.longitude).to eq(5.07699118186)
|
@@ -89,6 +91,7 @@ describe Postcode::API do
|
|
89
91
|
expect(result.addresses).to_not be_empty
|
90
92
|
expect(result.addresses.first.street).to eq("Wilhelminapark")
|
91
93
|
expect(result.addresses.first.postcode).to eq("5041EB")
|
94
|
+
expect(result.addresses.first.city).to eq("Tilburg")
|
92
95
|
expect(result.addresses.first.municipality).to eq("Tilburg")
|
93
96
|
expect(result.addresses.first.latitude).to eq(51.566414786)
|
94
97
|
expect(result.addresses.first.longitude).to eq(5.07717893166)
|
@@ -96,6 +99,3 @@ describe Postcode::API do
|
|
96
99
|
end
|
97
100
|
end
|
98
101
|
end
|
99
|
-
|
100
|
-
|
101
|
-
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: postcodeapi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ariejan de Vroom
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-04-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: hashie
|