geohashr 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- NWM2NmFjNjM4Njg5Mzk0NTI5ODc1NDdkMjdjZDQyZWEyOGJhMzNhMg==
5
- data.tar.gz: !binary |-
6
- NDI5YmY3Yjg1YTlkY2M2MmMwZjVlOWQxYmRkNjYxZTkxNzEyZDE2Yw==
2
+ SHA1:
3
+ metadata.gz: c33c4aef0a581de54764ca0e1ffe3faa26007224
4
+ data.tar.gz: 2b24273afc4923d3e761ce43352618527866de80
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- ZTY0ZWMzNjYxZmY1MzA1MWU0OTIzMzY1NGM2OWRiNTM3MzIzOTBlNGJjOTQy
10
- ZjJlNmU2YTgyYmNjZmM5NDRkYWM1ZWVjYjYyOWUxMDQwZDM2YzEwMmFkNjgy
11
- ZWIxMmExMGMyMzU0ZmY5ZmFhMjdmMTU1MzgzYmU4YzEwMTBjYjY=
12
- data.tar.gz: !binary |-
13
- MjkxYTAwNTNjYmEwNDQ5MmUwMTJkNjRjNjg3ZTk5MmFhMDYzNDdjYWZlNjZh
14
- YjI2MGM5MDE3YzMxZTljMDQ2NTE3ZjYxMjczYzQ4NTViZWI4YmY1MzEzNTQ0
15
- YTcxODEwZWI5MDdhM2ZkNjY0MWM3NDc5NWNmODg0N2VhYWQ1NGU=
6
+ metadata.gz: ba972d4b877bb934bb0e386637d3ab827cff7d12a5713ae01e3f41e994d1d78606a1964216b5f85b7976d3e2d1be003a7c63c536a8df5825efdfa3b0020e7461
7
+ data.tar.gz: 8ae51afa357ac619b36d267cf5ff94b1bcd3209659f580db68ac5c71921495e90f15f4855e78ebd9b0c9ecac37a10da69148a1f7e53289bce48599d74ed484a6
@@ -2,3 +2,5 @@
2
2
  language: ruby
3
3
  rvm:
4
4
  - 1.9.3
5
+
6
+ gemfile: Gemfile.ci
@@ -1,3 +1,13 @@
1
+ ### 0.2.0 / 2014-11-08
2
+
3
+ * 4 unknowns:
4
+
5
+ * Add Coveralls badge
6
+ * Add Gemfile.ci for travis
7
+ * Adds tests for x,y
8
+ * Remove rack/test
9
+
10
+
1
11
  ### 0.1.0 / 2014-02-14
2
12
 
3
13
  * 1 major enhancement
@@ -0,0 +1,6 @@
1
+ source 'http://rubygems.org'
2
+
3
+ gem 'rake'
4
+ gem 'hoe'
5
+ gem 'minitest'
6
+ gem 'coveralls', :require => false
@@ -3,6 +3,7 @@
3
3
  .travis.yml
4
4
  CHANGELOG.md
5
5
  CONTRIBUTING.md
6
+ Gemfile.ci
6
7
  LICENSE.txt
7
8
  Manifest.txt
8
9
  README.md
data/README.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # Geohashr
2
2
  [![Version][Version image]][Version]
3
3
  [![Build][Build image]][Build]
4
+ [![Coverage][Coverage image]][Coverage]
4
5
 
5
6
  Geohash is a latitude/longitude geocoding system. It is a hierarchical
6
7
  spatial data structure which subdivides space into buckets of grid shape.
@@ -1,14 +1,14 @@
1
1
  # -*- encoding: utf-8 -*-
2
- # stub: geohashr 0.1.0.20140214080544 ruby lib
2
+ # stub: geohashr 0.2.0.20141108200404 ruby lib
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "geohashr"
6
- s.version = "0.1.0.20140214080544"
6
+ s.version = "0.2.0.20141108200404"
7
7
 
8
8
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
9
9
  s.require_paths = ["lib"]
10
10
  s.authors = ["JohnnyT"]
11
- s.date = "2014-02-14"
11
+ s.date = "2014-11-09"
12
12
  s.description = "GeoHash - encode, decode, neighbors"
13
13
  s.email = ["ubergeek3141@gmail.com"]
14
14
  s.extra_rdoc_files = ["CHANGELOG.md", "CONTRIBUTING.md", "LICENSE.txt", "Manifest.txt", "README.md"]
@@ -16,8 +16,7 @@ Gem::Specification.new do |s|
16
16
  s.homepage = "https://github.com/johnnyt/geohashr"
17
17
  s.licenses = ["MIT"]
18
18
  s.rdoc_options = ["--main", "README.md"]
19
- s.rubyforge_project = "geohashr"
20
- s.rubygems_version = "2.2.1"
19
+ s.rubygems_version = "2.4.0"
21
20
  s.summary = "GeoHash - encode, decode, neighbors"
22
21
  s.test_files = ["test/test_geohashr.rb"]
23
22
 
@@ -27,15 +26,15 @@ Gem::Specification.new do |s|
27
26
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
28
27
  s.add_development_dependency(%q<minitest>, ["~> 5.2"])
29
28
  s.add_development_dependency(%q<coveralls>, ["~> 1.0"])
30
- s.add_development_dependency(%q<hoe>, ["~> 3.8"])
29
+ s.add_development_dependency(%q<hoe>, ["~> 3.12"])
31
30
  else
32
31
  s.add_dependency(%q<minitest>, ["~> 5.2"])
33
32
  s.add_dependency(%q<coveralls>, ["~> 1.0"])
34
- s.add_dependency(%q<hoe>, ["~> 3.8"])
33
+ s.add_dependency(%q<hoe>, ["~> 3.12"])
35
34
  end
36
35
  else
37
36
  s.add_dependency(%q<minitest>, ["~> 5.2"])
38
37
  s.add_dependency(%q<coveralls>, ["~> 1.0"])
39
- s.add_dependency(%q<hoe>, ["~> 3.8"])
38
+ s.add_dependency(%q<hoe>, ["~> 3.12"])
40
39
  end
41
40
  end
@@ -24,8 +24,8 @@ module GeoHashr
24
24
  is_lng ^= 1
25
25
  end
26
26
  end
27
- @x = positions.first.to_i(2)
28
- @y = positions.last.to_i(2)
27
+ @x = positions.last.to_i(2)
28
+ @y = positions.first.to_i(2)
29
29
  @box = box.transpose
30
30
  end
31
31
 
@@ -1,3 +1,3 @@
1
1
  module Geohashr
2
- VERSION = '0.1.0'
2
+ VERSION = '0.2.0'
3
3
  end
@@ -12,7 +12,6 @@ end
12
12
  require 'minitest'
13
13
  require 'minitest/autorun'
14
14
  require 'minitest/pride'
15
- require 'rack/test'
16
15
 
17
16
  Dir[File.expand_path('../support/*.rb', __FILE__)].each { |file| require file }
18
17
  require File.expand_path '../../lib/geohashr', __FILE__
@@ -16,6 +16,49 @@ class TestGeohashr < Minitest::Test
16
16
  end
17
17
  end
18
18
 
19
+ # bcfguvyz prxz
20
+ # 89destwx nqwy
21
+ # 2367kmqr jmtv
22
+ # 0145hjnp hksu
23
+ # 57eg
24
+ # 46df
25
+ # 139c
26
+ # 028b
27
+
28
+ def test_x_y
29
+ {
30
+ '0' => [0,0],
31
+ '1' => [1,0],
32
+ '2' => [0,1],
33
+ 'x' => [7,2],
34
+ 'y' => [6,3],
35
+ 'z' => [7,3],
36
+
37
+ '00' => [0,0],
38
+ '01' => [0,1],
39
+ '02' => [1,0],
40
+ '0x' => [2,7],
41
+ '0y' => [3,6],
42
+ '0z' => [3,7],
43
+
44
+ 'zz' => [31,31],
45
+ 'zzz' => [255, 127],
46
+ 'zzzz' => [1023,1023],
47
+ 'zzzzz' => [8191,4095],
48
+ 'zzzzzz' => [32767,32767],
49
+ 'zzzzzzz' => [262143,131071],
50
+ 'zzzzzzzz' => [1048575,1048575],
51
+ 'zzzzzzzzz' => [8388607,4194303],
52
+ 'zzzzzzzzzz' => [33554431,33554431],
53
+ 'zzzzzzzzzzz' => [268435455,134217727],
54
+ 'zzzzzzzzzzzz' => [1073741823,1073741823]
55
+
56
+ }.each do |hash, coord|
57
+ gh = GeoHashr::GeoHash.new(hash)
58
+ assert_equal [gh.x, gh.y], coord
59
+ end
60
+ end
61
+
19
62
  #def test_encode
20
63
  # {
21
64
  # [ 45.37, -121.7 ] => 'c216ne',
metadata CHANGED
@@ -1,57 +1,57 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: geohashr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - JohnnyT
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-14 00:00:00.000000000 Z
11
+ date: 2014-11-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '5.2'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '5.2'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: coveralls
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '1.0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '1.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: hoe
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ~>
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '3.8'
47
+ version: '3.12'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ~>
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '3.8'
54
+ version: '3.12'
55
55
  description: GeoHash - encode, decode, neighbors
56
56
  email:
57
57
  - ubergeek3141@gmail.com
@@ -64,12 +64,13 @@ extra_rdoc_files:
64
64
  - Manifest.txt
65
65
  - README.md
66
66
  files:
67
- - .coveralls.yml
68
- - .gemtest
69
- - .gitignore
70
- - .travis.yml
67
+ - ".coveralls.yml"
68
+ - ".gemtest"
69
+ - ".gitignore"
70
+ - ".travis.yml"
71
71
  - CHANGELOG.md
72
72
  - CONTRIBUTING.md
73
+ - Gemfile.ci
73
74
  - LICENSE.txt
74
75
  - Manifest.txt
75
76
  - README.md
@@ -87,23 +88,23 @@ licenses:
87
88
  metadata: {}
88
89
  post_install_message:
89
90
  rdoc_options:
90
- - --main
91
+ - "--main"
91
92
  - README.md
92
93
  require_paths:
93
94
  - lib
94
95
  required_ruby_version: !ruby/object:Gem::Requirement
95
96
  requirements:
96
- - - ! '>='
97
+ - - ">="
97
98
  - !ruby/object:Gem::Version
98
99
  version: '0'
99
100
  required_rubygems_version: !ruby/object:Gem::Requirement
100
101
  requirements:
101
- - - ! '>='
102
+ - - ">="
102
103
  - !ruby/object:Gem::Version
103
104
  version: '0'
104
105
  requirements: []
105
- rubyforge_project: geohashr
106
- rubygems_version: 2.2.1
106
+ rubyforge_project:
107
+ rubygems_version: 2.4.0
107
108
  signing_key:
108
109
  specification_version: 4
109
110
  summary: GeoHash - encode, decode, neighbors