geomash 0.3.5 → 0.3.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 92cf0c994109a517cd8243c00a52a886c2b1ea14
4
- data.tar.gz: 3d868abd6b3334950fa9c69a00aa452497ba60cc
3
+ metadata.gz: 83306d315da162bf4ed9e305effda2ec568aaeb9
4
+ data.tar.gz: 68d5865eca8797f33c1ef634c3abf34defa1c461
5
5
  SHA512:
6
- metadata.gz: 22cddf085958b18cfb4ded544255edad4dd2db3e5ef549a43e43307b128958173e23ff6e50be6dc2116c4c38c3ec03f6c7e7c203c907a260bd28d23dfd483e46
7
- data.tar.gz: 6c86d48511dc735ea4d0b3079df8bd0d7ccbba5433bc3a2869eaebf2ea19ac971ee6af36c00fa066e6bfdf8ef140a27d3b3caca7953da3fefc99b911e49c3bd4
6
+ metadata.gz: 709129ca2ac3efa45e0a20c3df051d8459d87d2e95a7248f41e329f26023c906a17ef7fc17915924953e1087f582062bf145806a0d45334aef7e921d1ab0e03a
7
+ data.tar.gz: 57fbd79e91d2d3bded69d4801e298151697069c85e977a5c9bcfc81859c2c9a32df890d478e78c47141f8c7760a1648d95b43af68f469bea215557042625fbcd
@@ -103,8 +103,12 @@ module Geomash
103
103
  country_code = 'KR'
104
104
  elsif geo_hash[:country_part] == 'North Korea'
105
105
  country_code = 'KP'
106
+ elsif geo_hash[:country_part] == 'Republic of the Congo'
107
+ country_code = 'CG'
106
108
  else
107
- country_code = ISO3166::Country.find_country_by_name(geo_hash[:country_part]).alpha2
109
+ country_lookup = ISO3166::Country.find_country_by_name(geo_hash[:country_part])
110
+ raise "Could not find Country in geonames for: #{geo_hash[:country_part]}" if country_lookup.blank?
111
+ country_code = country_lookup.alpha2
108
112
  end
109
113
  geonames_response = Typhoeus::Request.get("http://api.geonames.org/search?username=#{self.geonames_username}&lang=en&style=FULL&q=#{CGI.escape(geonames_search_string)}&name_equals=#{CGI.escape(exact_name_term)}&country=#{country_code}")
110
114
 
@@ -1,3 +1,3 @@
1
1
  module Geomash
2
- VERSION = "0.3.5"
2
+ VERSION = "0.3.6"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: geomash
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.5
4
+ version: 0.3.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Boston Public Library
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-02 00:00:00.000000000 Z
11
+ date: 2016-06-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport