geo_point 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/geo_point.gemspec +1 -1
- data/lib/geo_point.rb +1 -0
- data/spec/geo_point_spec.rb +48 -0
- metadata +14 -14
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.2.0
|
data/geo_point.gemspec
CHANGED
data/lib/geo_point.rb
CHANGED
data/spec/geo_point_spec.rb
CHANGED
@@ -2,6 +2,54 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
# - www.movable-type.co.uk/scripts/latlong.html
|
4
4
|
describe GeoPoint do
|
5
|
+
|
6
|
+
describe 'macros on Core objects' do
|
7
|
+
describe 'Array' do
|
8
|
+
it '#geo_point macro' do
|
9
|
+
point = [1, 2].geo_point
|
10
|
+
point.should be_a(GeoPoint)
|
11
|
+
point.lat.should == 1
|
12
|
+
point.lng.should == 2
|
13
|
+
end
|
14
|
+
|
15
|
+
it 'should enable #to_coords' do
|
16
|
+
coords = [1, 2].to_coords
|
17
|
+
coords.should be_a(Array)
|
18
|
+
coords.should == [1, 2]
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
describe 'String' do
|
23
|
+
it 'should enable #geo_point macro' do
|
24
|
+
point = "1, 2".geo_point
|
25
|
+
point.should be_a(GeoPoint)
|
26
|
+
point.lat.should == 1
|
27
|
+
point.lng.should == 2
|
28
|
+
end
|
29
|
+
|
30
|
+
it 'should enable #to_coords' do
|
31
|
+
coords = "1, 2".to_coords
|
32
|
+
coords.should be_a(Array)
|
33
|
+
coords.should == [1, 2]
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
describe 'Hash' do
|
38
|
+
it 'should enable #geo_point macro' do
|
39
|
+
point = {:lat => 1, :lng => 2}.geo_point
|
40
|
+
point.should be_a(GeoPoint)
|
41
|
+
point.lat.should == 1
|
42
|
+
point.lng.should == 2
|
43
|
+
end
|
44
|
+
|
45
|
+
it 'should enable #to_coords' do
|
46
|
+
coords = {:lat => 1, :lng => 2}.to_coords
|
47
|
+
coords.should be_a(Array)
|
48
|
+
coords.should == [1, 2]
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
5
53
|
describe '#reverse_point' do
|
6
54
|
before :each do
|
7
55
|
@p = GeoPoint.new -2, 5
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: geo_point
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2011-06-13 00:00:00.000000000Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: geo_calc
|
16
|
-
requirement: &
|
16
|
+
requirement: &2153026520 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 0.7.3
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *2153026520
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: geo_units
|
27
|
-
requirement: &
|
27
|
+
requirement: &2153024900 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 0.2.0
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *2153024900
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rspec
|
38
|
-
requirement: &
|
38
|
+
requirement: &2153023220 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: 2.6.0
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *2153023220
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: bundler
|
49
|
-
requirement: &
|
49
|
+
requirement: &2153021760 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: 1.0.6
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *2153021760
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: jeweler
|
60
|
-
requirement: &
|
60
|
+
requirement: &2153019700 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ~>
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: 1.6.2
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *2153019700
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rcov
|
71
|
-
requirement: &
|
71
|
+
requirement: &2153018380 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ! '>='
|
@@ -76,7 +76,7 @@ dependencies:
|
|
76
76
|
version: '0'
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *2153018380
|
80
80
|
description: Allows for easy parsing of Strings, Hashes and Arrays into a GeoPoint
|
81
81
|
with lat/long
|
82
82
|
email: kmandrup@gmail.com
|
@@ -119,7 +119,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
119
119
|
version: '0'
|
120
120
|
segments:
|
121
121
|
- 0
|
122
|
-
hash:
|
122
|
+
hash: 1472290565497148887
|
123
123
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
124
124
|
none: false
|
125
125
|
requirements:
|