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 +4 -4
- data/lib/geomash/geonames.rb +5 -1
- data/lib/geomash/version.rb +1 -1
- 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: 83306d315da162bf4ed9e305effda2ec568aaeb9
|
4
|
+
data.tar.gz: 68d5865eca8797f33c1ef634c3abf34defa1c461
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 709129ca2ac3efa45e0a20c3df051d8459d87d2e95a7248f41e329f26023c906a17ef7fc17915924953e1087f582062bf145806a0d45334aef7e921d1ab0e03a
|
7
|
+
data.tar.gz: 57fbd79e91d2d3bded69d4801e298151697069c85e977a5c9bcfc81859c2c9a32df890d478e78c47141f8c7760a1648d95b43af68f469bea215557042625fbcd
|
data/lib/geomash/geonames.rb
CHANGED
@@ -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
|
-
|
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
|
|
data/lib/geomash/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2016-06-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|