enrichment_db 0.1.7 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/enrichment_db/geo/locator.rb +1 -1
- data/lib/enrichment_db/version.rb +1 -1
- data/test/geo/locator_test.rb +7 -7
- 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: ed3f8eeeacef49594b8ea0f00704aeb7c3811264
|
4
|
+
data.tar.gz: 729c64791296348c4d968aa7bf78ca5226557176
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0c94f753bedfe284ae35e1c78da02d52fdc53d52beed85606839a683be7094b6a6aa335f44d3630f7ff8b2380388a1f21996c15fa72361a4656dbd61db196c41
|
7
|
+
data.tar.gz: 3c1972e705650dc9cb1323a6f26c6ceab96c3ff31dec4cf62342d183f5b40cc8654efe775dd21897687745147e1cb8c251560f7944dead0fef66acc4882e5995
|
data/Gemfile.lock
CHANGED
@@ -82,7 +82,7 @@ class EnrichmentDb::Geo::Locator < EnrichmentDb::DatumModel
|
|
82
82
|
|
83
83
|
fail EnrichmentDb::InvalidGeoPointFormat unless valid_geo_point?(geo)
|
84
84
|
geo_format = geo.each_with_object({}) do |(k, v), h|
|
85
|
-
h[k.to_sym] = v
|
85
|
+
h[k.to_sym] = v.to_f
|
86
86
|
end
|
87
87
|
GeoHash.encode(geo_format[:lat], geo_format[:lon])
|
88
88
|
end
|
data/test/geo/locator_test.rb
CHANGED
@@ -9,9 +9,9 @@ describe EnrichmentDb::Geo::Locator do
|
|
9
9
|
assert_equal id, result
|
10
10
|
end
|
11
11
|
|
12
|
-
it 'should
|
13
|
-
lat =
|
14
|
-
long =
|
12
|
+
it 'should break as the lat long format is incorrect' do
|
13
|
+
lat = -27.477541606
|
14
|
+
long = 153.012244888
|
15
15
|
lat_long = { 'lat' => lat, 'long' => long }
|
16
16
|
begin
|
17
17
|
geohash = EnrichmentDb::Geo::Locator.format_geo(lat_long)
|
@@ -22,12 +22,12 @@ describe EnrichmentDb::Geo::Locator do
|
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
25
|
-
it 'should
|
26
|
-
lat =
|
27
|
-
long =
|
25
|
+
it 'should correctly format a hash to a latlong' do
|
26
|
+
lat = -27.477541606
|
27
|
+
long = 153.012244888
|
28
28
|
lat_long = { 'lat' => lat, 'lon' => long }
|
29
29
|
geohash = EnrichmentDb::Geo::Locator.format_geo(lat_long)
|
30
|
-
assert_equal '
|
30
|
+
assert_equal 'r7hg9vu5ewzr', geohash
|
31
31
|
end
|
32
32
|
|
33
33
|
it 'should find region from geohash' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: enrichment_db
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aaron Wallis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-11-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: multi_json
|