geocoder 1.3.6 → 1.3.7

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of geocoder might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ecdca12fbe77e4b7e7be4d77e5bef171b6bd086c
4
- data.tar.gz: baec95fcf55991a8171c27db97f4b8d3e28b513e
3
+ metadata.gz: b3ba97fb2510ac5e0f739b4f7a11825f9d9bf277
4
+ data.tar.gz: d69a73fd1c4a6536170ac28563475def5ffed69e
5
5
  SHA512:
6
- metadata.gz: c49ad883eafa6c57b7d228e04a64bb9d090d53751ee75d5bebba9077844c8beb84a9954359f938538aedb9bcb6cc5809ab02a47f2d943eb4d9f850345bc1f974
7
- data.tar.gz: 1bcbbdf40dd1ec76e368eb28a100715685061cdc36091f2d418cdfc91123207dad7a86471cb14aafdff51c597e5e3476d528e1e7ee9bd40d6bb265adfbbbf673
6
+ metadata.gz: a09fa3752902e9422511ea4b30b038e8b91f6a6c6ad37aad0d979864ca610b0c5e5ab80fc9b0aff94dca4bcf493056e8d84a9d1433abc3b4a6385fd1fced6ea5
7
+ data.tar.gz: 77e358b416b3862952f8210f9a5752e0b1e11dc8247ed3f13966fe79c64af98fd7ef31a2b5310fb9fc36bfc98bde3330cf96baca1949229e99d159d724807856
@@ -3,6 +3,12 @@ Changelog
3
3
 
4
4
  Major changes to Geocoder for each release. Please see the Git log for complete list of changes.
5
5
 
6
+ 1.3.7 (2016 Jun 9)
7
+ -------------------
8
+ * Fix Ruby 1.9, 2.0 incompatibility (thanks github.com/ebouchut).
9
+ * Update SmartyStreets zipcode API endpoint (thanks github.com/jeffects).
10
+ * Catch network errors (thanks github.com/sas1ni69).
11
+
6
12
  1.3.6 (2016 May 31)
7
13
  -------------------
8
14
  * Fix Sinatra support broken in 1.3.5.
@@ -34,4 +34,7 @@ module Geocoder
34
34
  class LookupTimeout < ::Timeout::Error
35
35
  end
36
36
 
37
+ class NetworkError < Error
38
+ end
39
+
37
40
  end
@@ -286,6 +286,8 @@ module Geocoder
286
286
  end
287
287
  rescue Timeout::Error
288
288
  raise Geocoder::LookupTimeout
289
+ rescue Errno::EHOSTUNREACH, Errno::ETIMEDOUT, Errno::ENETUNREACH
290
+ raise Geocoder::NetworkError
289
291
  end
290
292
 
291
293
  def use_ssl?
@@ -12,8 +12,11 @@ module Geocoder::Lookup
12
12
  end
13
13
 
14
14
  def query_url(query)
15
- path = zipcode_only?(query) ? "zipcode" : "street-address"
16
- "#{protocol}://api.smartystreets.com/#{path}?#{url_query_string(query)}"
15
+ if zipcode_only?(query)
16
+ "#{protocol}://us-zipcode.api.smartystreets.com/lookup?#{url_query_string(query)}"
17
+ else
18
+ "#{protocol}://api.smartystreets.com/street-address?#{url_query_string(query)}"
19
+ end
17
20
  end
18
21
 
19
22
  # required by API as of 26 March 2015
@@ -79,7 +79,7 @@ module Geocoder
79
79
  end
80
80
 
81
81
  if defined?(ActionDispatch::Request)
82
- ActionDispatch::Request.include Geocoder::Request
82
+ ActionDispatch::Request.__send__(:include, Geocoder::Request)
83
83
  elsif defined?(Rack::Request)
84
- Rack::Request.include Geocoder::Request
84
+ Rack::Request.__send__(:include, Geocoder::Request)
85
85
  end
@@ -1,3 +1,3 @@
1
1
  module Geocoder
2
- VERSION = "1.3.6"
2
+ VERSION = "1.3.7"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: geocoder
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.6
4
+ version: 1.3.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Reisner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-31 00:00:00.000000000 Z
11
+ date: 2016-06-09 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Provides object geocoding (by street or IP address), reverse geocoding
14
14
  (coordinates to street address), distance queries for ActiveRecord and Mongoid,