google_map_directions 1.0.1 → 1.1.0
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.
@@ -25,7 +25,11 @@ module GoogleMapDirections
|
|
25
25
|
|
26
26
|
def status
|
27
27
|
return @json["status"]
|
28
|
-
end
|
28
|
+
end
|
29
|
+
|
30
|
+
def polyline
|
31
|
+
return @json["routes"][0]["overview_polyline"]["points"] unless !status_check
|
32
|
+
end
|
29
33
|
|
30
34
|
def distance_as_string
|
31
35
|
return @legs["distance"]["text"] unless !status_check
|
data/spec/direction_spec.rb
CHANGED
@@ -60,7 +60,6 @@ describe GoogleMapDirections do
|
|
60
60
|
end
|
61
61
|
it 'should correctly give the address of the origin' do
|
62
62
|
@happy_path.destination_address.should == "1600 Amphitheatre Parkway, Mountain View, CA 94043, USA"
|
63
|
-
|
64
63
|
end
|
65
64
|
it 'should correctly give the duration of the trip as a string' do
|
66
65
|
@happy_path.duration_as_string.should == "55 mins"
|
@@ -68,6 +67,11 @@ describe GoogleMapDirections do
|
|
68
67
|
it 'should correctly give the duration of the trip in minutes' do
|
69
68
|
@happy_path.duration_in_seconds.should == 3322
|
70
69
|
end
|
70
|
+
|
71
|
+
it 'should correctly give the polyline' do
|
72
|
+
@happy_path.polyline.should == "ggcfF~peiVxC`d@|A`UBZ|AKlEUdLq@tHc@lEUlCKpBP\\@xAIbAWfBQjEUzGe@|YoBrXkBnr@{EdAGzD[jAKDl@Fx@e@`CAXBn@Rh@XX`@H~BKrBBnLxAhAPjCn@pKdBfIjAxBRjDI|AHhDP|JfB|Ch@fEt@zWpEbFbAhBj@tBf@dB`@nCr@bBh@nBbAdE`DvCfDhAtARVtD~DlBdBlEnC\\T`CzAjKfGrEdCdKjFjCdAzD^|@ClB]|CyAx@s@|@cAlAwBtB_HfAeEfCkJdB{GNeA`AgDlDsLhCwI`@sA|BgGzAqCp@aApJiMpAcBrCsDvBiEj@}AjAkFrDs`@j@eErBiKbEyOhC}HhM}YzD_HvB_CfBmA~BcAlMiD|CeAfCyA`DgCrAyA~A}B~@_B|AoDtA_FlF}TtIk^t@qBnAaCfBcChBkBdHeFfJgGfGqE|KwJxPuNdTuQvVaTxE_EjVmS~N{LpOoMnRcPjHkGhPeNxN{LbJwHhRyOnNoLvE_ExN{NxQ_RdBiB|Zg[dDwDxByC`KePh[yg@ps@ckAfw@qpAtO{VRc@~FcJxXkd@hQsYrD}GpBqDzHoLlHkLrCcEfCoCdDyCdD{BjGeD~P_JbiAam@xVwMxHmEzLyHzRaMjTkNdu@ue@t~@ol@`~Ec~CpIcFzGyChE{ArMgDhTgFzRwEvDiArEmBvGyDdDeCzCsC|AeBtEeFd@KBCvAoA|DeDp@U~@IdDGhBFlB\\jBz@jCbBr@b@nDnCbDnChEfEfGrH~BlDbFzInOjZpHjLbBfChJfMn_@dj@|S`[hH~J~ErHjCvGlDjJv@rB|CtKjAbG|@rIvDdd@lA~HdAtEbBvFtD~InDbGfN|Pt[b`@zFlFrd@xYdIvFtF|EbJxJ|GjJjLxR|KpRxYtf@nEpHnBzCpGvI`E`FlIpIbIzIhKvLhc@dg@~KtMbBhCl@lA~@dCbAjEl@jFFjB@f@b@EbABTB`Df@rE|AjWhKvUpJbB`@xF?bA?hEf@fBVLPNLL\\Fd@Kj@OV]PW?[MSUK}@@QPaArAoC|MoX~GmNnQm^nTqc@p[qo@hFqK~ByDrB_DfGeH|EeFdKyKfh@ij@vkAmoAvMqNzFiHjTi\\T[xAy@h@Ib@JNJTf@FLTr@EXEDGBSDWIa@QmBq@mAi@eJaEy@o@m@w@q@yBIYRIbBq@bDsApA{@bAmAz@iB\\aBJ{AFqGB}@Bi@UAK?c@CJwE@g@"
|
73
|
+
end
|
74
|
+
|
71
75
|
it 'should correctly give distances as a string for a bad reply' do
|
72
76
|
@sad_path.distance_as_string.should == nil
|
73
77
|
end
|
@@ -85,7 +89,6 @@ describe GoogleMapDirections do
|
|
85
89
|
end
|
86
90
|
it 'should correctly give the address of the origin for a bad reply' do
|
87
91
|
@sad_path.destination_address.should == nil
|
88
|
-
|
89
92
|
end
|
90
93
|
it 'should correctly give the duration of the trip as a string for a bad reply' do
|
91
94
|
@sad_path.duration_as_string.should == nil
|
@@ -93,5 +96,8 @@ describe GoogleMapDirections do
|
|
93
96
|
it 'should correctly give the duration of the trip in minutes for a bad reply' do
|
94
97
|
@sad_path.duration_in_seconds.should == nil
|
95
98
|
end
|
99
|
+
it 'should correctly give the polyline for a bad reply' do
|
100
|
+
@sad_path.polyline.should == nil
|
101
|
+
end
|
96
102
|
end
|
97
103
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google_map_directions
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-01-
|
12
|
+
date: 2014-01-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
16
|
-
requirement: &
|
16
|
+
requirement: &18962280 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '1.3'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *18962280
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: rake
|
27
|
-
requirement: &
|
27
|
+
requirement: &18961740 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *18961740
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rspec
|
38
|
-
requirement: &
|
38
|
+
requirement: &18961100 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,7 +43,7 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *18961100
|
47
47
|
description: A wrapper gem for the google directions API
|
48
48
|
email:
|
49
49
|
- chris_h2312@yahoo.com
|