geocodio 2.1.0 → 3.0.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/lib/geocodio/address.rb +5 -5
- data/lib/geocodio/address_set.rb +7 -3
- data/lib/geocodio/client.rb +4 -4
- data/lib/geocodio/congressional_district.rb +9 -0
- data/lib/geocodio/legislator.rb +69 -0
- data/lib/geocodio/state_legislative_district.rb +2 -1
- data/lib/geocodio/utils.rb +5 -3
- data/lib/geocodio/version.rb +2 -2
- data/spec/address_spec.rb +17 -15
- data/spec/client_spec.rb +9 -3
- data/spec/congressional_district_spec.rb +16 -3
- data/spec/legislator_spec.rb +116 -0
- data/spec/spec_helper.rb +2 -0
- data/spec/vcr_cassettes/alaska_geocode_with_fields.yml +21 -7
- data/spec/vcr_cassettes/batch_geocode.yml +32 -23
- data/spec/vcr_cassettes/batch_geocode_with_bad_address.yml +20 -10
- data/spec/vcr_cassettes/batch_geocode_with_fields.yml +107 -40
- data/spec/vcr_cassettes/batch_reverse.yml +66 -35
- data/spec/vcr_cassettes/batch_reverse_with_fields.yml +298 -70
- data/spec/vcr_cassettes/geocode.yml +24 -14
- data/spec/vcr_cassettes/geocode_bad_address.yml +11 -5
- data/spec/vcr_cassettes/geocode_with_fields.yml +53 -21
- data/spec/vcr_cassettes/geocode_with_postdirectional.yml +13 -9
- data/spec/vcr_cassettes/invalid_key.yml +12 -6
- data/spec/vcr_cassettes/parse.yml +17 -7
- data/spec/vcr_cassettes/reverse.yml +33 -17
- data/spec/vcr_cassettes/reverse_with_fields.yml +108 -28
- data/spec/vcr_cassettes/reverse_with_fields_no_house_info.yml +62 -0
- metadata +6 -1
@@ -0,0 +1,62 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://api.geocod.io/v1/reverse?api_key=secret_api_key&fields=cd,stateleg,school,timezone&q=41.25,-96.00
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Accept:
|
11
|
+
- application/json
|
12
|
+
Accept-Encoding:
|
13
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
14
|
+
User-Agent:
|
15
|
+
- Ruby
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message: OK
|
20
|
+
headers:
|
21
|
+
Server:
|
22
|
+
- nginx/1.10.2
|
23
|
+
Content-Type:
|
24
|
+
- application/json
|
25
|
+
Transfer-Encoding:
|
26
|
+
- chunked
|
27
|
+
Cache-Control:
|
28
|
+
- no-cache
|
29
|
+
Date:
|
30
|
+
- Fri, 28 Jul 2017 19:34:00 GMT
|
31
|
+
Request-Handler:
|
32
|
+
- api19
|
33
|
+
Access-Control-Allow-Origin:
|
34
|
+
- "*"
|
35
|
+
Access-Control-Allow-Methods:
|
36
|
+
- GET, POST
|
37
|
+
Access-Control-Allow-Headers:
|
38
|
+
- Content-Type
|
39
|
+
body:
|
40
|
+
encoding: UTF-8
|
41
|
+
string: '{"results":[{"address_components":{"number":"5599","street":"Mayberry","suffix":"St","formatted_street":"Mayberry
|
42
|
+
St","city":"Omaha","county":"Douglas County","state":"NE","zip":"68106","country":"US"},"formatted_address":"5599
|
43
|
+
Mayberry St, Omaha, NE 68106","location":{"lat":41.250585,"lng":-95.997945},"accuracy":1,"accuracy_type":"nearest_street","source":"TIGER\/Line\u00ae
|
44
|
+
dataset from the US Census Bureau","fields":{"congressional_district":{"name":"Congressional
|
45
|
+
District 2","district_number":2,"congress_number":"115th","congress_years":"2017-2019"},"state_legislative_districts":{"senate":{"name":"State
|
46
|
+
Senate District 9","district_number":"9"}},"school_districts":{"unified":{"name":"Omaha
|
47
|
+
Public Schools","lea_code":"3174820","grade_low":"PK","grade_high":"12"}},"timezone":{"name":"CST","utc_offset":-6,"observes_dst":true}}},{"address_components":{"number":"975","predirectional":"S","street":"57th","suffix":"St","formatted_street":"S
|
48
|
+
57th St","city":"Omaha","county":"Douglas County","state":"NE","zip":"68106","country":"US"},"formatted_address":"975
|
49
|
+
S 57th St, Omaha, NE 68106","location":{"lat":41.250211,"lng":-96.001138},"accuracy":0.51,"accuracy_type":"nearest_street","source":"TIGER\/Line\u00ae
|
50
|
+
dataset from the US Census Bureau","fields":{"congressional_district":{"name":"Congressional
|
51
|
+
District 2","district_number":2,"congress_number":"115th","congress_years":"2017-2019"},"state_legislative_districts":{"senate":{"name":"State
|
52
|
+
Senate District 9","district_number":"9"}},"school_districts":{"unified":{"name":"Omaha
|
53
|
+
Public Schools","lea_code":"3174820","grade_low":"PK","grade_high":"12"}},"timezone":{"name":"CST","utc_offset":-6,"observes_dst":true}}},{"address_components":{"number":"5700","street":"Mason","suffix":"St","formatted_street":"Mason
|
54
|
+
St","city":"Omaha","county":"Douglas County","state":"NE","zip":"68106","country":"US"},"formatted_address":"5700
|
55
|
+
Mason St, Omaha, NE 68106","location":{"lat":41.250211,"lng":-96.001138},"accuracy":0.5,"accuracy_type":"nearest_street","source":"TIGER\/Line\u00ae
|
56
|
+
dataset from the US Census Bureau","fields":{"congressional_district":{"name":"Congressional
|
57
|
+
District 2","district_number":2,"congress_number":"115th","congress_years":"2017-2019"},"state_legislative_districts":{"senate":{"name":"State
|
58
|
+
Senate District 9","district_number":"9"}},"school_districts":{"unified":{"name":"Omaha
|
59
|
+
Public Schools","lea_code":"3174820","grade_low":"PK","grade_high":"12"}},"timezone":{"name":"CST","utc_offset":-6,"observes_dst":true}}}]}'
|
60
|
+
http_version:
|
61
|
+
recorded_at: Fri, 28 Jul 2017 19:34:00 GMT
|
62
|
+
recorded_with: VCR 3.0.3
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: geocodio
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Celis
|
@@ -96,6 +96,7 @@ files:
|
|
96
96
|
- lib/geocodio/client/error.rb
|
97
97
|
- lib/geocodio/client/response.rb
|
98
98
|
- lib/geocodio/congressional_district.rb
|
99
|
+
- lib/geocodio/legislator.rb
|
99
100
|
- lib/geocodio/school_district.rb
|
100
101
|
- lib/geocodio/state_legislative_district.rb
|
101
102
|
- lib/geocodio/timezone.rb
|
@@ -105,6 +106,7 @@ files:
|
|
105
106
|
- spec/address_spec.rb
|
106
107
|
- spec/client_spec.rb
|
107
108
|
- spec/congressional_district_spec.rb
|
109
|
+
- spec/legislator_spec.rb
|
108
110
|
- spec/school_district_spec.rb
|
109
111
|
- spec/spec_helper.rb
|
110
112
|
- spec/state_legislative_district_spec.rb
|
@@ -123,6 +125,7 @@ files:
|
|
123
125
|
- spec/vcr_cassettes/parse.yml
|
124
126
|
- spec/vcr_cassettes/reverse.yml
|
125
127
|
- spec/vcr_cassettes/reverse_with_fields.yml
|
128
|
+
- spec/vcr_cassettes/reverse_with_fields_no_house_info.yml
|
126
129
|
homepage: https://github.com/davidcelis/geocodio
|
127
130
|
licenses:
|
128
131
|
- MIT
|
@@ -165,8 +168,10 @@ test_files:
|
|
165
168
|
- spec/vcr_cassettes/batch_geocode_with_fields.yml
|
166
169
|
- spec/vcr_cassettes/reverse_with_fields.yml
|
167
170
|
- spec/vcr_cassettes/batch_reverse.yml
|
171
|
+
- spec/vcr_cassettes/reverse_with_fields_no_house_info.yml
|
168
172
|
- spec/vcr_cassettes/batch_geocode_with_bad_address.yml
|
169
173
|
- spec/vcr_cassettes/invalid_key.yml
|
170
174
|
- spec/vcr_cassettes/batch_geocode.yml
|
171
175
|
- spec/state_legislative_district_spec.rb
|
176
|
+
- spec/legislator_spec.rb
|
172
177
|
- spec/address_spec.rb
|