geo_calc 0.6.0.1 → 0.6.1

Sign up to get free protection for your applications and to get access to all the features.
data/Changelog.textile CHANGED
@@ -1,6 +1,7 @@
1
1
  h3. May 31, 2011
2
2
 
3
3
  * Refactored String#concat
4
+ * Added GeoPoint#to_lng_lat method to play nice with mongoid_geo fields
4
5
 
5
6
  h3. May 24, 2011
6
7
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.0.1
1
+ 0.6.1
data/geo_calc.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{geo_calc}
8
- s.version = "0.6.0.1"
8
+ s.version = "0.6.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = [%q{Kristian Mandrup}]
@@ -94,6 +94,10 @@ class GeoPoint
94
94
  [lat, lng]
95
95
  end
96
96
 
97
+ def to_lng_lat
98
+ [lng, lat]
99
+ end
100
+
97
101
  def to_arr
98
102
  a = to_lat_lng
99
103
  reverse_arr? ? a.reverse : a
@@ -346,4 +346,24 @@ describe GeoPoint do
346
346
  end
347
347
  end
348
348
  end
349
+
350
+ describe '#to_lat_lng' do
351
+ before :each do
352
+ @p1 = GeoPoint.new 50, 5
353
+ end
354
+
355
+ it 'should return GeoPoint as an array of [lat, lng]' do
356
+ @p1.to_lat_lng.should == [50, 5]
357
+ end
358
+ end
359
+
360
+ describe '#to_lng_lat' do
361
+ before :each do
362
+ @p1 = GeoPoint.new 50, 5
363
+ end
364
+
365
+ it 'should return GeoPoint as an array of [lng, lat]' do
366
+ @p1.to_lng_lat.should == [5, 50]
367
+ end
368
+ end
349
369
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: geo_calc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0.1
4
+ version: 0.6.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2011-05-31 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
16
- requirement: &2157295980 !ruby/object:Gem::Requirement
16
+ requirement: &2154539880 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 2.5.0
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *2157295980
24
+ version_requirements: *2154539880
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: bundler
27
- requirement: &2157291880 !ruby/object:Gem::Requirement
27
+ requirement: &2154539000 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '1'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *2157291880
35
+ version_requirements: *2154539000
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: jeweler
38
- requirement: &2157290880 !ruby/object:Gem::Requirement
38
+ requirement: &2154537680 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 1.5.2
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *2157290880
46
+ version_requirements: *2154537680
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rcov
49
- requirement: &2157289760 !ruby/object:Gem::Requirement
49
+ requirement: &2154536760 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *2157289760
57
+ version_requirements: *2154536760
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: rake
60
- requirement: &2157288820 !ruby/object:Gem::Requirement
60
+ requirement: &2154535520 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,7 +65,7 @@ dependencies:
65
65
  version: '0.9'
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *2157288820
68
+ version_requirements: *2154535520
69
69
  description: Geo calculations in ruby and javascript
70
70
  email: kmandrup@gmail.com
71
71
  executables: []
@@ -120,7 +120,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
120
120
  version: '0'
121
121
  segments:
122
122
  - 0
123
- hash: -1272758931873192495
123
+ hash: -1394595154528736354
124
124
  required_rubygems_version: !ruby/object:Gem::Requirement
125
125
  none: false
126
126
  requirements: