proximityhash 0.1.0 → 0.1.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 314911dc4853aa613218a3c3d80c313a1c6431a3
4
- data.tar.gz: '059cc2ab6b8ec0a8b72b12c9cad499a6d878ff19'
2
+ SHA256:
3
+ metadata.gz: 5e5daa846445b2a7d64af9bb432229ac729653e0267f7882a17b00d0bdf075f7
4
+ data.tar.gz: 2b938bf962f90db65e65881a3904891bfca32230506f282a31024d1cff4f3f43
5
5
  SHA512:
6
- metadata.gz: 2d034c1225bd46fd56cf461b01e2596e0cbae75641f210b4b67d69dca17dd249fc310509b9ef7e31b25f94e384bc5e03af5b3abea2e527ab73d60aa3e0087af6
7
- data.tar.gz: f2bff2a9b0dad59c587efe16bb5c7e5456ea51ae44f675072efd1052ee0ed94abaaa3859c462e7a38059d9e58455cfc16f4ef8ad14a3c985494e507525a5d6df
6
+ metadata.gz: 6a3ac7d9cc3572eaab83eaa0bd2fbf79ba4889c8afb0eeb555eacde7d2db01d7b34f3297af1f7029262d8ec20cf9c2bdd94a3269706e8086b5b10636c1b09136
7
+ data.tar.gz: 790cf919a8a4bc04f139aaba39d55b1425e5ee202150b393434ef1bf6e16041863a88c6073b6a614bb3cb895ef64925f7d1c0887adf630921210086fbb607b66
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.1.1
@@ -6,7 +6,7 @@
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "proximityhash"
9
- s.version = "0.1.0"
9
+ s.version = "0.1.1"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
@@ -2,9 +2,14 @@ require 'spec_helper'
2
2
 
3
3
  describe 'Proximity Hash' do
4
4
 
5
+ latitude = 12.0
6
+ longitude = 77.0
7
+ distance = 20.0
8
+ precision = 8
9
+
5
10
  it 'calculates expected geohashes in distance order' do
6
11
 
7
- ph = ProximityHash.new(12.0, 77.0, 20.0, 8)
12
+ ph = ProximityHash.new(latitude, longitude, distance, precision)
8
13
  hashes = ph.calculate
9
14
 
10
15
  expected = [
@@ -18,4 +23,18 @@ describe 'Proximity Hash' do
18
23
  expect(hashes.keys).to eq(expected)
19
24
  end
20
25
 
21
- end
26
+ it 'includes source point' do
27
+ source = GeoHash.encode(latitude, longitude, precision)
28
+ expected = [
29
+ 'tdnu20tc', 'tdnu20t9',
30
+ 'tdnu20tb', 'tdnu20t8',
31
+ 'tdnu20tf', 'tdnu20td',
32
+ 'tdnu20mz', 'tdnu20mx',
33
+ 'tdnu20t3', 'tdnu20t2',
34
+ source
35
+ ]
36
+
37
+ expect(hashes.keys).to eq(expected)
38
+ end
39
+
40
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: proximityhash
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lloyd Watkin
@@ -123,7 +123,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
123
123
  version: '0'
124
124
  requirements: []
125
125
  rubyforge_project:
126
- rubygems_version: 2.5.1
126
+ rubygems_version: 2.7.6
127
127
  signing_key:
128
128
  specification_version: 4
129
129
  summary: Calculates geohashes within a radius from a point