Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

remove dumb files

  • Loading branch information...
commit f980dbd269359b4d4ec390bb364d9ed002050406 1 parent 5915ee2
Josh Crews authored
View
3  .gitignore
@@ -0,0 +1,3 @@
+Manifest
+pkg
+doc
View
9 Manifest
@@ -1,9 +0,0 @@
-README.textile
-Rakefile
-init.rb
-lib/mapquest_directions.rb
-spec/lib/mapquest_directions.xml
-spec/lib/mapquest_directions_fail.xml
-spec/lib/mapquest_directions_spec.rb
-spec/spec_helper.rb
-Manifest
View
BIN  pkg/mapquest_directions-0.1.0.gem
Binary file not shown
View
BIN  pkg/mapquest_directions-0.1.0.tar.gz
Binary file not shown
View
9 pkg/mapquest_directions-0.1.0/Manifest
@@ -1,9 +0,0 @@
-README.textile
-Rakefile
-init.rb
-lib/mapquest_directions.rb
-spec/lib/mapquest_directions.xml
-spec/lib/mapquest_directions_fail.xml
-spec/lib/mapquest_directions_spec.rb
-spec/spec_helper.rb
-Manifest
View
70 pkg/mapquest_directions-0.1.0/README.textile
@@ -1,70 +0,0 @@
-h2. Usage
-
-Get a MapQuest API key, and store in your app under MAPQUEST_KEY
-<pre>MAPQUEST_KEY = 'your_api_key'</pre>
-
-<pre>directions = MapQuestDirections.new(origin, destination)</pre>
-where _origin_ and _destination_ are strings of addresses or places that MapQuest can find an address for. Example: "816 Meridian St., 37207"
-
-Get drive time or distance of whole trip
-<pre>
-drive_time_in_minutes = directions.drive_time_in_minutes
-distance_in_miles = directions.distance_in_miles
-</pre>
-
-Get the XML MapQuest returns with every turn, or the API call URL
-<pre>
-xml = directions.xml
-xml_call = directions.xml_call
-</pre>
-
-h3. Error situations
-
-<pre>directions.status</pre> shows you the status code returned by MapQuest. 0 means worked. Other codes (500, 403) mean problem.
-
-If MapQuest can't recognize your places or gives an error, the distance_in_miles and drive_time_in_minutes will each return 0. You can call <pre>directions.status</pre> and it should tell you a number code for the problem. You can call <pre>directions.xml</pre> to read the full text.
-
-h2. Installation
-
-h3. gem
-
-rails 2.3
-# gem install mapquest_directions
-# add config.gem "mapquest_directions" to your environment.rb file
-
-rails 3.0
-# gem 'mapquest_directions' in your Gemfile
-# <pre>bundle install</pre> from command line
-
-h3. Rails plugin
-
-Rails 2.3
-<pre>script/plugin install git://github.com/joshcrews/mapquest-directions-ruby.git</pre>
-
-Rails 3.0
-<pre>rails plugin install git://github.com/joshcrews/mapquest-directions-ruby.git</pre>
-
-h3. Compatibility
-
-Tested on Rails 2.3.8
-
-Not yet tested on Rails 3. It probably is Rails 3 compatible, because it's just a single class with a few methods. It's probably compatible with every ruby project ever.
-
-h3. MapQuest maps API key
-
-You'll need a MapQuest Map API key
-
-http://developer.mapquest.com/
-
-Include it as the constant MAPQUEST_KEY in an app configuration file (environment.rb, config/initializers/api_keys.rb)
-
-h3. Need turn-by-turn directions?
-
-Not yet included in this gem, but you can do it with nokogiri to parse the XML that comes back when you do
-<pre>MapQuestDirections.new(origin, destination).xml</pre>
-And then nokogiri can cycle through each <maneuver> and you can pick out what you need.
-
-h2. License
-
-Anyone can use this code in any way.
-
View
15 pkg/mapquest_directions-0.1.0/Rakefile
@@ -1,15 +0,0 @@
-# Rakefile
-require 'rubygems'
-require 'rake'
-require 'echoe'
-
-Echoe.new('mapquest_directions', '0.1.0') do |p|
- p.description = "Ruby-wrapper for MapQuest Directions API. Can return the drive time and driving distance between two places"
- p.url = "http://github.com/joshcrews/MapQuest-Directions-Ruby"
- p.author = "Josh Crews"
- p.email = "josh@joshcrews.com"
- p.ignore_pattern = ["tmp/*", "script/*"]
- p.development_dependencies = ['nokogiri >=1.4.1']
-end
-
-Dir["#{File.dirname(__FILE__)}/tasks/*.rake"].sort.each { |ext| load ext }
View
1  pkg/mapquest_directions-0.1.0/init.rb
@@ -1 +0,0 @@
-require 'mapquest_directions'
View
69 pkg/mapquest_directions-0.1.0/lib/mapquest_directions.rb
@@ -1,69 +0,0 @@
-require 'net/http'
-require 'nokogiri'
-
-class MapQuestDirections
-
- def initialize(location_1, location_2)
- @base_url = "http://www.mapquestapi.com/directions/v1/route?key=#{MAPQUEST_KEY}&outFormat=xml&"
- @location_1 = location_1
- @location_2 = location_2
- options = "from=#{transcribe(@location_1)}&to=#{transcribe(@location_2)}"
- @xml_call = @base_url + options
- @status = find_status
- end
-
- def find_status
- doc = Nokogiri::XML(xml)
- doc.css("statusCode").text
- end
-
- def xml
- unless @xml.nil?
- @xml
- else
- @xml ||= get_url(@xml_call)
- end
- end
-
- def xml_call
- @xml_call
- end
-
- def drive_time_in_minutes
- if @status != "0"
- drive_time = 0
- else
- doc = Nokogiri::XML(xml)
- drive_time = doc.css("time").first.text
- convert_to_minutes(drive_time)
- end
- end
-
- def distance_in_miles
- if @status != "0"
- distance_in_miles = 0
- else
- doc = Nokogiri::XML(xml)
- distance_in_miles = doc.css("distance").first.text.to_i
- end
- end
-
- def status
- @status
- end
-
- private
-
- def convert_to_minutes(text)
- (text.to_i / 60).ceil
- end
-
- def transcribe(location)
- location.gsub(" ", "+")
- end
-
- def get_url(url)
- Net::HTTP.get(::URI.parse(url))
- end
-
-end
View
33 pkg/mapquest_directions-0.1.0/mapquest_directions.gemspec
@@ -1,33 +0,0 @@
-# -*- encoding: utf-8 -*-
-
-Gem::Specification.new do |s|
- s.name = %q{mapquest_directions}
- s.version = "0.1.0"
-
- s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
- s.authors = ["Josh Crews"]
- s.date = %q{2010-08-19}
- s.description = %q{Ruby-wrapper for MapQuest Directions API. Can return the drive time and driving distance between two places}
- s.email = %q{josh@joshcrews.com}
- s.extra_rdoc_files = ["README.textile", "lib/mapquest_directions.rb"]
- s.files = ["README.textile", "Rakefile", "init.rb", "lib/mapquest_directions.rb", "spec/lib/mapquest_directions.xml", "spec/lib/mapquest_directions_fail.xml", "spec/lib/mapquest_directions_spec.rb", "spec/spec_helper.rb", "Manifest", "mapquest_directions.gemspec"]
- s.homepage = %q{http://github.com/joshcrews/MapQuest-Directions-Ruby}
- s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Mapquest_directions", "--main", "README.textile"]
- s.require_paths = ["lib"]
- s.rubyforge_project = %q{mapquest_directions}
- s.rubygems_version = %q{1.3.7}
- s.summary = %q{Ruby-wrapper for MapQuest Directions API. Can return the drive time and driving distance between two places}
-
- if s.respond_to? :specification_version then
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
- s.specification_version = 3
-
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
- s.add_development_dependency(%q<nokogiri>, [">= 1.4.1"])
- else
- s.add_dependency(%q<nokogiri>, [">= 1.4.1"])
- end
- else
- s.add_dependency(%q<nokogiri>, [">= 1.4.1"])
- end
-end
View
2  pkg/mapquest_directions-0.1.0/spec/lib/mapquest_directions.xml
@@ -1,2 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<response><info><statusCode>0</statusCode><messages/><copyright><imageUrl>http://tile21.mqcdn.com/res/mqlogo.gif</imageUrl><imageAltText>© 2010 MapQuest, Inc.</imageAltText><text>© 2010 MapQuest, Inc.</text></copyright></info><route><sessionId>4c6c8e89-019b-0001-02b7-4979-0024e83e3993</sessionId><options><shapeFormat>raw</shapeFormat><generalize>-1.0</generalize><maxLinkId>0</maxLinkId><narrativeType>text</narrativeType><stateBoundaryDisplay>true</stateBoundaryDisplay><countryBoundaryDisplay>true</countryBoundaryDisplay><sideOfStreetDisplay>true</sideOfStreetDisplay><destinationManeuverDisplay>true</destinationManeuverDisplay><avoidTimedConditions>false</avoidTimedConditions><enhancedNarrative>false</enhancedNarrative><timeType>0</timeType><routeType>FASTEST</routeType><locale>en_US</locale><unit>M</unit><tryAvoidLinkIds></tryAvoidLinkIds><mustAvoidLinkIds></mustAvoidLinkIds><manmaps>true</manmaps></options><boundingBox><ul><lat>36.185138</lat><lng>-86.940116</lng></ul><lr><lat>32.554519</lat><lng>-85.481231</lng></lr></boundingBox><distance>310.2900085449219</distance><time>18209</time><formattedTime>05:03:29</formattedTime><legs><leg><distance>310.29</distance><time>18209</time><formattedTime>05:03:29</formattedTime><index>0</index><maneuvers><maneuver><startPoint><lat>36.185138</lat><lng>-86.768287</lng></startPoint><maneuverNotes/><distance>0.093</distance><time>22</time><formattedTime>00:00:22</formattedTime><attributes>0</attributes><turnType>2</turnType><direction>4</direction><narrative>Start out going SOUTH on MERIDIAN ST toward ARRINGTON ST.</narrative><directionName>South</directionName><index>0</index><streets><street>MERIDIAN ST</street></streets><signs/><iconUrl><![CDATA[http://content.mapquest.com/mqsite/turnsigns/rs_right_sm.gif]]></iconUrl><linkIds/><mapUrl><![CDATA[http://www.mapquestapi.com/staticmap/v3/getmap?type=map&size=225,160&pois=purple-2,36.185138,-86.768287,0,0|purple-3,36.183811,-86.768478,0,0|&center=36.1844745,-86.7683825&zoom=13&key=Dmjtd|luu725uyn5,2x=o5-5zb0d&rand=1965438145&session=4c6c8e89-019b-0001-02b7-4979-0024e83e3993]]></mapUrl></maneuver><maneuver><startPoint><lat>36.183811</lat><lng>-86.768478</lng></startPoint><maneuverNotes/><distance>0.296</distance><time>73</time><formattedTime>00:01:13</formattedTime><attributes>0</attributes><turnType>2</turnType><direction>7</direction><narrative>Turn RIGHT onto HANCOCK ST.</narrative><directionName>West</directionName><index>1</index><streets><street>HANCOCK ST</street></streets><signs/><iconUrl><![CDATA[http://content.mapquest.com/mqsite/turnsigns/rs_right_sm.gif]]></iconUrl><linkIds/><mapUrl><![CDATA[http://www.mapquestapi.com/staticmap/v3/getmap?type=map&size=225,160&pois=purple-3,36.183811,-86.768478,0,0|purple-4,36.184398,-86.773712,0,0|&center=36.184104500000004,-86.771095&zoom=12&key=Dmjtd|luu725uyn5,2x=o5-5zb0d&rand=1965438145&session=4c6c8e89-019b-0001-02b7-4979-0024e83e3993]]></mapUrl></maneuver><maneuver><startPoint><lat>36.184398</lat><lng>-86.773712</lng></startPoint><maneuverNotes/><distance>0.522</distance><time>75</time><formattedTime>00:01:15</formattedTime><attributes>0</attributes><turnType>6</turnType><direction>4</direction><narrative>Turn LEFT onto N 1ST ST/US-31W/US-41/US-431/TN-11. Continue to follow N 1ST ST.</narrative><directionName>South</directionName><index>2</index><streets><street>N 1ST ST</street></streets><signs/><iconUrl><![CDATA[http://content.mapquest.com/mqsite/turnsigns/rs_left_sm.gif]]></iconUrl><linkIds/><mapUrl><![CDATA[http://www.mapquestapi.com/staticmap/v3/getmap?type=map&size=225,160&pois=purple-4,36.184398,-86.773712,0,0|purple-5,36.17691,-86.774551,0,0|&center=36.180654000000004,-86.77413150000001&zoom=10&key=Dmjtd|luu725uyn5,2x=o5-5zb0d&rand=1965438145&session=4c6c8e89-019b-0001-02b7-4979-0024e83e3993]]></mapUrl></maneuver><maneuver><startPoint><lat>36.17691</lat><lng>-86.774551</lng></startPoint><maneuverNotes/><distance>0.03</distance><time>6</time><formattedTime>00:00:06</formattedTime><attributes>0</attributes><turnType>6</turnType><direction>8</direction><narrative>Turn LEFT onto SPRING ST.</narrative><directionName>East</directionName><index>3</index><streets><street>SPRING ST</street></streets><signs/><iconUrl><![CDATA[http://content.mapquest.com/mqsite/turnsigns/rs_left_sm.gif]]></iconUrl><linkIds/><mapUrl><![CDATA[http://www.mapquestapi.com/staticmap/v3/getmap?type=map&size=225,160&pois=purple-5,36.17691,-86.774551,0,0|purple-6,36.176799,-86.774032,0,0|&center=36.176854500000005,-86.7742915&zoom=15&key=Dmjtd|luu725uyn5,2x=o5-5zb0d&rand=1965438145&session=4c6c8e89-019b-0001-02b7-4979-0024e83e3993]]></mapUrl></maneuver><maneuver><startPoint><lat>36.176799</lat><lng>-86.774032</lng></startPoint><maneuverNotes/><distance>1.584</distance><time>134</time><formattedTime>00:02:14</formattedTime><attributes>128</attributes><turnType>10</turnType><direction>8</direction><narrative>Merge onto I-24 E.</narrative><directionName>East</directionName><index>4</index><streets><street>INTERSTATE 24 E</street></streets><signs><sign><type>1</type><direction>8</direction><text>24</text><extraText></extraText><url><![CDATA[http://api-signs.mqcdn.com/?s=rs&t=RS00001CO_SM&n=24&d=EAST]]></url></sign></signs><iconUrl><![CDATA[http://content.mapquest.com/mqsite/turnsigns/rs_merge_right_sm.gif]]></iconUrl><linkIds/><mapUrl><![CDATA[http://www.mapquestapi.com/staticmap/v3/getmap?type=map&size=225,160&pois=purple-6,36.176799,-86.774032,0,0|purple-7,36.157688,-86.760406,0,0|&center=36.1672435,-86.76721900000001&zoom=9&key=Dmjtd|luu725uyn5,2x=o5-5zb0d&rand=1965438145&session=4c6c8e89-019b-0001-02b7-4979-0024e83e3993]]></mapUrl></maneuver><maneuver><startPoint><lat>36.157688</lat><lng>-86.760406</lng></startPoint><maneuverNotes/><distance>1.047</distance><time>92</time><formattedTime>00:01:32</formattedTime><attributes>128</attributes><turnType>10</turnType><direction>7</direction><narrative>Merge onto I-40 W via EXIT 50B toward I-65 S/MEMPHIS/HUNTSVILLE.</narrative><directionName>West</directionName><index>5</index><streets><street>INTERSTATE 40 W</street></streets><signs><sign><type>1</type><direction>7</direction><text>40</text><extraText></extraText><url><![CDATA[http://api-signs.mqcdn.com/?s=rs&t=RS00001CO_SM&n=40&d=WEST]]></url></sign><sign><type>1001</type><direction>0</direction><text>50B</text><extraText></extraText><url><![CDATA[http://api-signs.mqcdn.com/?s=rs&t=RSEXITRIGHTNUM_SM&n=50B&d=]]></url></sign></signs><iconUrl><![CDATA[http://content.mapquest.com/mqsite/turnsigns/rs_merge_right_sm.gif]]></iconUrl><linkIds/><mapUrl><![CDATA[http://www.mapquestapi.com/staticmap/v3/getmap?type=map&size=225,160&pois=purple-7,36.157688,-86.760406,0,0|purple-8,36.149211,-86.774963,0,0|&center=36.1534495,-86.7676845&zoom=10&key=Dmjtd|luu725uyn5,2x=o5-5zb0d&rand=1965438145&session=4c6c8e89-019b-0001-02b7-4979-0024e83e3993]]></mapUrl></maneuver><maneuver><startPoint><lat>36.149211</lat><lng>-86.774963</lng></startPoint><maneuverNotes/><distance>188.83301</distance><time>10207</time><formattedTime>02:50:07</formattedTime><attributes>128</attributes><turnType>11</turnType><direction>4</direction><narrative>Merge onto I-65 S via EXIT 210B on the LEFT toward HUNTSVILLE (Crossing into ALABAMA).</narrative><directionName>South</directionName><index>6</index><streets><street>INTERSTATE 65 S</street></streets><signs><sign><type>1</type><direction>4</direction><text>65</text><extraText></extraText><url><![CDATA[http://api-signs.mqcdn.com/?s=rs&t=RS00001CO_SM&n=65&d=SOUTH]]></url></sign><sign><type>1001</type><direction>0</direction><text>210B</text><extraText></extraText><url><![CDATA[http://api-signs.mqcdn.com/?s=rs&t=RSEXITLEFTNUM_SM&n=210B&d=]]></url></sign></signs><iconUrl><![CDATA[http://content.mapquest.com/mqsite/turnsigns/rs_merge_left_sm.gif]]></iconUrl><linkIds/><mapUrl><![CDATA[http://www.mapquestapi.com/staticmap/v3/getmap?type=map&size=225,160&pois=purple-8,36.149211,-86.774963,0,0|purple-9,33.523189,-86.826721,0,0|&center=34.836200000000005,-86.852096&zoom=2&key=Dmjtd|luu725uyn5,2x=o5-5zb0d&rand=1965438145&session=4c6c8e89-019b-0001-02b7-4979-0024e83e3993]]></mapUrl></maneuver><maneuver><startPoint><lat>33.523189</lat><lng>-86.826721</lng></startPoint><maneuverNotes/><distance>1.234</distance><time>94</time><formattedTime>00:01:34</formattedTime><attributes>128</attributes><turnType>11</turnType><direction>8</direction><narrative>Merge onto I-20 E/I-59 N via EXIT 261A on the LEFT toward ATLANTA/GADSDEN.</narrative><directionName>East</directionName><index>7</index><streets><street>INTERSTATE 20 E</street><street>INTERSTATE 59 N</street></streets><signs><sign><type>1</type><direction>8</direction><text>20</text><extraText></extraText><url><![CDATA[http://api-signs.mqcdn.com/?s=rs&t=RS00001CO_SM&n=20&d=EAST]]></url></sign><sign><type>1</type><direction>1</direction><text>59</text><extraText></extraText><url><![CDATA[http://api-signs.mqcdn.com/?s=rs&t=RS00001CO_SM&n=59&d=NORTH]]></url></sign><sign><type>1001</type><direction>0</direction><text>261A</text><extraText></extraText><url><![CDATA[http://api-signs.mqcdn.com/?s=rs&t=RSEXITLEFTNUM_SM&n=261A&d=]]></url></sign></signs><iconUrl><![CDATA[http://content.mapquest.com/mqsite/turnsigns/rs_merge_left_sm.gif]]></iconUrl><linkIds/><mapUrl><![CDATA[http://www.mapquestapi.com/staticmap/v3/getmap?type=map&size=225,160&pois=purple-9,33.523189,-86.826721,0,0|purple-10,33.52423,-86.807746,0,0|&center=33.522014,-86.8172335&zoom=10&key=Dmjtd|luu725uyn5,2x=o5-5zb0d&rand=1965438145&session=4c6c8e89-019b-0001-02b7-4979-0024e83e3993]]></mapUrl></maneuver><maneuver><startPoint><lat>33.52423</lat><lng>-86.807746</lng></startPoint><maneuverNotes/><distance>3.204</distance><time>247</time><formattedTime>00:04:07</formattedTime><attributes>128</attributes><turnType>10</turnType><direction>8</direction><narrative>Merge onto US-280 E/US-31 S/ELTON B STEPHENS EXPY/AL-3 S via EXIT 126A.</narrative><directionName>East</directionName><index>8</index><streets><street>US HIGHWAY 280 E</street><street>US HIGHWAY 31 S</street><street>ELTON B STEPHENS EXPY</street><street>STATE ROUTE 3 S</street></streets><signs><sign><type>2</type><direction>8</direction><text>280</text><extraText></extraText><url><![CDATA[http://api-signs.mqcdn.com/?s=rs&t=RS00002BW_SM&n=280&d=EAST]]></url></sign><sign><type>2</type><direction>4</direction><text>31</text><extraText></extraText><url><![CDATA[http://api-signs.mqcdn.com/?s=rs&t=RS00002BW_SM&n=31&d=SOUTH]]></url></sign><sign><type>3</type><direction>4</direction><text>3</text><extraText></extraText><url><![CDATA[http://api-signs.mqcdn.com/?s=rs&t=RS00003BW_SM&n=3&d=SOUTH]]></url></sign><sign><type>1001</type><direction>0</direction><text>126A</text><extraText></extraText><url><![CDATA[http://api-signs.mqcdn.com/?s=rs&t=RSEXITRIGHTNUM_SM&n=126A&d=]]></url></sign></signs><iconUrl><![CDATA[http://content.mapquest.com/mqsite/turnsigns/rs_merge_right_sm.gif]]></iconUrl><linkIds/><mapUrl><![CDATA[http://www.mapquestapi.com/staticmap/v3/getmap?type=map&size=225,160&pois=purple-10,33.52423,-86.807746,0,0|purple-11,33.48822,-86.786872,0,0|&center=33.506994,-86.797309&zoom=8&key=Dmjtd|luu725uyn5,2x=o5-5zb0d&rand=1975826365&session=4c6c8e89-019b-0001-02b7-4979-0024e83e3993]]></mapUrl></maneuver><maneuver><startPoint><lat>33.48822</lat><lng>-86.786872</lng></startPoint><maneuverNotes/><distance>101.94401</distance><time>6238</time><formattedTime>01:43:58</formattedTime><attributes>0</attributes><turnType>10</turnType><direction>8</direction><narrative>Merge onto US-280 E/AL-38 E toward SYLACAUGA/ZOO-GARDENS.</narrative><directionName>East</directionName><index>9</index><streets><street>US HIGHWAY 280 E</street><street>STATE ROUTE 38 E</street></streets><signs><sign><type>2</type><direction>8</direction><text>280</text><extraText></extraText><url><![CDATA[http://api-signs.mqcdn.com/?s=rs&t=RS00002BW_SM&n=280&d=EAST]]></url></sign><sign><type>3</type><direction>8</direction><text>38</text><extraText></extraText><url><![CDATA[http://api-signs.mqcdn.com/?s=rs&t=RS00003BW_SM&n=38&d=EAST]]></url></sign></signs><iconUrl><![CDATA[http://content.mapquest.com/mqsite/turnsigns/rs_merge_right_sm.gif]]></iconUrl><linkIds/><mapUrl><![CDATA[http://www.mapquestapi.com/staticmap/v3/getmap?type=map&size=225,160&pois=purple-11,33.48822,-86.786872,0,0|purple-12,32.6763,-85.486328,0,0|&center=33.08226,-86.1366&zoom=4&key=Dmjtd|luu725uyn5,2x=o5-5zb0d&rand=1975826365&session=4c6c8e89-019b-0001-02b7-4979-0024e83e3993]]></mapUrl></maneuver><maneuver><startPoint><lat>32.6763</lat><lng>-85.486328</lng></startPoint><maneuverNotes/><distance>2.857</distance><time>214</time><formattedTime>00:03:34</formattedTime><attributes>0</attributes><turnType>2</turnType><direction>4</direction><narrative>Turn RIGHT onto AL-147.</narrative><directionName>South</directionName><index>10</index><streets><street>STATE ROUTE 147</street></streets><signs><sign><type>3</type><direction>0</direction><text>147</text><extraText></extraText><url><![CDATA[http://api-signs.mqcdn.com/?s=rs&t=RS00003BW_SM&n=147]]></url></sign></signs><iconUrl><![CDATA[http://content.mapquest.com/mqsite/turnsigns/rs_right_sm.gif]]></iconUrl><linkIds/><mapUrl><![CDATA[http://www.mapquestapi.com/staticmap/v3/getmap?type=map&size=225,160&pois=purple-12,32.6763,-85.486328,0,0|purple-13,32.637149,-85.481666,0,0|&center=32.656724499999996,-85.48603750000001&zoom=8&key=Dmjtd|luu725uyn5,2x=o5-5zb0d&rand=1975826365&session=4c6c8e89-019b-0001-02b7-4979-0024e83e3993]]></mapUrl></maneuver><maneuver><startPoint><lat>32.637149</lat><lng>-85.481666</lng></startPoint><maneuverNotes/><distance>5.052</distance><time>386</time><formattedTime>00:06:26</formattedTime><attributes>0</attributes><turnType>1</turnType><direction>6</direction><narrative>Turn SLIGHT RIGHT onto AL-267/SHUG JORDAN PKWY.</narrative><directionName>Southwest</directionName><index>11</index><streets><street>STATE ROUTE 267</street><street>SHUG JORDAN PKWY</street></streets><signs><sign><type>3</type><direction>0</direction><text>267</text><extraText></extraText><url><![CDATA[http://api-signs.mqcdn.com/?s=rs&t=RS00003BW_SM&n=267]]></url></sign></signs><iconUrl><![CDATA[http://content.mapquest.com/mqsite/turnsigns/rs_slight_right_sm.gif]]></iconUrl><linkIds/><mapUrl><![CDATA[http://www.mapquestapi.com/staticmap/v3/getmap?type=map&size=225,160&pois=purple-13,32.637149,-85.481666,0,0|purple-14,32.57796,-85.498443,0,0|&center=32.6075545,-85.49468949999999&zoom=7&key=Dmjtd|luu725uyn5,2x=o5-5zb0d&rand=1975826365&session=4c6c8e89-019b-0001-02b7-4979-0024e83e3993]]></mapUrl></maneuver><maneuver><startPoint><lat>32.57796</lat><lng>-85.498443</lng></startPoint><maneuverNotes/><distance>1.706</distance><time>155</time><formattedTime>00:02:35</formattedTime><attributes>0</attributes><turnType>1</turnType><direction>6</direction><narrative>Turn SLIGHT RIGHT onto S COLLEGE ST/AL-147. Continue to follow S COLLEGE ST.</narrative><directionName>Southwest</directionName><index>12</index><streets><street>S COLLEGE ST</street></streets><signs/><iconUrl><![CDATA[http://content.mapquest.com/mqsite/turnsigns/rs_slight_right_sm.gif]]></iconUrl><linkIds/><mapUrl><![CDATA[http://www.mapquestapi.com/staticmap/v3/getmap?type=map&size=225,160&pois=purple-14,32.57796,-85.498443,0,0|purple-15,32.55513,-85.508186,0,0|&center=32.566545,-85.503116&zoom=8&key=Dmjtd|luu725uyn5,2x=o5-5zb0d&rand=1975826365&session=4c6c8e89-019b-0001-02b7-4979-0024e83e3993]]></mapUrl></maneuver><maneuver><startPoint><lat>32.55513</lat><lng>-85.508186</lng></startPoint><maneuverNotes/><distance>1.021</distance><time>129</time><formattedTime>00:02:09</formattedTime><attributes>0</attributes><turnType>6</turnType><direction>8</direction><narrative>Turn LEFT onto CR-863/SHELL TOOMER PKWY.</narrative><directionName>East</directionName><index>13</index><streets><street>COUNTY ROUTE 863</street><street>SHELL TOOMER PKWY</street></streets><signs><sign><type>4</type><direction>0</direction><text>863</text><extraText></extraText></sign></signs><iconUrl><![CDATA[http://content.mapquest.com/mqsite/turnsigns/rs_left_sm.gif]]></iconUrl><linkIds/><mapUrl><![CDATA[http://www.mapquestapi.com/staticmap/v3/getmap?type=map&size=225,160&pois=purple-15,32.55513,-85.508186,0,0|purple-16,32.55466,-85.490821,0,0|&center=32.554824499999995,-85.4995035&zoom=10&key=Dmjtd|luu725uyn5,2x=o5-5zb0d&rand=1975826365&session=4c6c8e89-019b-0001-02b7-4979-0024e83e3993]]></mapUrl></maneuver><maneuver><startPoint><lat>32.55466</lat><lng>-85.490821</lng></startPoint><maneuverNotes/><distance>0.818</distance><time>130</time><formattedTime>00:02:10</formattedTime><attributes>0</attributes><turnType>6</turnType><direction>1</direction><narrative>Turn LEFT onto CANARY DR.</narrative><directionName>North</directionName><index>14</index><streets><street>CANARY DR</street></streets><signs/><iconUrl><![CDATA[http://content.mapquest.com/mqsite/turnsigns/rs_left_sm.gif]]></iconUrl><linkIds/><mapUrl><![CDATA[http://www.mapquestapi.com/staticmap/v3/getmap?type=map&size=225,160&pois=purple-16,32.55466,-85.490821,0,0|purple-17,32.566139,-85.489463,0,0|&center=32.5603995,-85.49039400000001&zoom=9&key=Dmjtd|luu725uyn5,2x=o5-5zb0d&rand=1975826365&session=4c6c8e89-019b-0001-02b7-4979-0024e83e3993]]></mapUrl></maneuver><maneuver><startPoint><lat>32.566139</lat><lng>-85.489463</lng></startPoint><maneuverNotes/><distance>0.049</distance><time>7</time><formattedTime>00:00:07</formattedTime><attributes>0</attributes><turnType>2</turnType><direction>3</direction><narrative>Turn RIGHT to stay on CANARY DR.</narrative><directionName>Northeast</directionName><index>15</index><streets><street>CANARY DR</street></streets><signs/><iconUrl><![CDATA[http://content.mapquest.com/mqsite/turnsigns/rs_right_sm.gif]]></iconUrl><linkIds/><mapUrl><![CDATA[http://www.mapquestapi.com/staticmap/v3/getmap?type=map&size=225,160&pois=purple-17,32.566139,-85.489463,0,0|purple-18,32.566478,-85.488723,0,0|&center=32.5663085,-85.489093&zoom=15&key=Dmjtd|luu725uyn5,2x=o5-5zb0d&rand=1975826365&session=4c6c8e89-019b-0001-02b7-4979-0024e83e3993]]></mapUrl></maneuver><maneuver><startPoint/><maneuverNotes/><distance>0.0</distance><time>0</time><formattedTime>00:00:00</formattedTime><attributes>0</attributes><turnType>-1</turnType><direction>0</direction><narrative>1963 CANARY DR is on the RIGHT.</narrative><directionName></directionName><index>16</index><streets/><signs/><linkIds/><mapUrl><![CDATA[]]></mapUrl></maneuver></maneuvers><hasTollRoad>false</hasTollRoad><hasFerry>false</hasFerry><hasHighway>true</hasHighway><hasSeasonalClosure>false</hasSeasonalClosure><hasUnpaved>false</hasUnpaved><hasCountryCross>false</hasCountryCross></leg></legs><hasTollRoad>false</hasTollRoad><hasFerry>false</hasFerry><hasHighway>true</hasHighway><hasSeasonalClosure>false</hasSeasonalClosure><hasUnpaved>false</hasUnpaved><hasCountryCross>false</hasCountryCross><locations><location><street>816 Meridian St</street><adminArea5 type="City">Nashville</adminArea5><adminArea3 type="State">TN</adminArea3><adminArea4 type="County">Davidson County</adminArea4><postalCode>37207-5850</postalCode><adminArea1 type="Country">US</adminArea1><geocodeQuality>POINT</geocodeQuality><geocodeQualityCode>P1AAA</geocodeQualityCode><dragPoint>false</dragPoint><sideOfStreet>L</sideOfStreet><displayLatLng><latLng><lat>36.185138</lat><lng>-86.76828</lng></latLng></displayLatLng><linkId>31393483</linkId><type>s</type><latLng><lat>36.18514</lat><lng>-86.76828</lng></latLng></location><location><street>1963 Canary Dr</street><adminArea5 type="City">Auburn</adminArea5><adminArea3 type="State">AL</adminArea3><adminArea4 type="County">Lee County</adminArea4><postalCode>36830-6901</postalCode><adminArea1 type="Country">US</adminArea1><geocodeQuality>POINT</geocodeQuality><geocodeQualityCode>P1AAA</geocodeQualityCode><dragPoint>false</dragPoint><sideOfStreet>R</sideOfStreet><displayLatLng><latLng><lat>32.566478</lat><lng>-85.488723</lng></latLng></displayLatLng><linkId>105113616</linkId><type>s</type><latLng><lat>32.56648</lat><lng>-85.48872</lng></latLng></location></locations><locationSequence>0,1</locationSequence></route></response>
View
2  pkg/mapquest_directions-0.1.0/spec/lib/mapquest_directions_fail.xml
@@ -1,2 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<response><info><statusCode>500</statusCode><messages><message>Server is not configured to authorize geocode requests from this client</message></messages><copyright><imageUrl>http://tile21.mqcdn.com/res/mqlogo.gif</imageUrl><imageAltText>© 2010 MapQuest, Inc.</imageAltText><text>© 2010 MapQuest, Inc.</text></copyright></info><collections/></response>
View
58 pkg/mapquest_directions-0.1.0/spec/lib/mapquest_directions_spec.rb
@@ -1,58 +0,0 @@
-require 'spec_helper'
-
-context "Mapquest API" do
- before(:all) do
- @origin = "816 Meridian St., 37207"
- @destination = "1963 Canary Dr., 36830"
- end
-
- context "API working" do
-
- describe "directions work" do
-
- before(:each) do
- MapQuestDirections.any_instance.stubs(:xml).returns(File.read("spec/lib/mapquest_directions.xml"))
- @directions = MapQuestDirections.new(@origin, @destination)
- end
-
- it "should return distance in miles" do
- @directions.distance_in_miles.should == 310
- end
-
- it "should return drive time in minutes" do
- @directions.drive_time_in_minutes.should == 303
- end
-
- it "should have a status code of 0" do
- @directions.status.should == "0"
- end
-
- end #describe
- end # API working
-
- context "API not working" do
-
- describe "Geocode distance estimation work" do
-
- before(:each) do
- MapQuestDirections.any_instance.stubs(:xml).returns(File.read("spec/lib/mapquest_directions_fail.xml"))
- @directions = MapQuestDirections.new(@origin, @destination)
- end
-
- it "should return distance in miles" do
- @directions.distance_in_miles.should == 0
- end
-
- it "should return drive time in minutes" do
- @directions.drive_time_in_minutes.should == 0
- end
-
- it "should have a status code other than 0" do
- @directions.status.should_not == "0"
- end
-
- end #describe
- end # API not working
-
-
-end
View
13 pkg/mapquest_directions-0.1.0/spec/spec_helper.rb
@@ -1,13 +0,0 @@
-require 'rubygems'
-require 'mocha'
-require 'ruby-debug'
-
-$:.unshift File.expand_path('../lib', __FILE__)
-require 'mapquest_directions'
-
-MAPQUEST_KEY = "replace_me"
-# http://developer.mapquest.com/
-
-Spec::Runner.configure do |config|
- config.mock_with :mocha
-end
Please sign in to comment.
Something went wrong with that request. Please try again.