maptp-service 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +4 -0
- data/Manifest.txt +19 -0
- data/PostInstall.txt +7 -0
- data/README.rdoc +77 -0
- data/Rakefile +28 -0
- data/lib/maptp-service.rb +45 -0
- data/lib/maptp-service/parser/route.rb +85 -0
- data/lib/maptp-service/routing.rb +95 -0
- data/nbproject/private/private.properties +2 -0
- data/nbproject/private/rake-d.txt +48 -0
- data/nbproject/project.properties +7 -0
- data/nbproject/project.xml +15 -0
- data/script/console +10 -0
- data/script/destroy +14 -0
- data/script/generate +14 -0
- data/spec/maptp-service_spec.rb +42 -0
- data/spec/spec.opts +1 -0
- data/spec/spec_helper.rb +19 -0
- data/tasks/rspec.rake +21 -0
- metadata +133 -0
data/History.txt
ADDED
data/Manifest.txt
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
History.txt
|
2
|
+
Manifest.txt
|
3
|
+
PostInstall.txt
|
4
|
+
README.rdoc
|
5
|
+
Rakefile
|
6
|
+
lib/maptp-service.rb
|
7
|
+
lib/maptp-service/parser/route.rb
|
8
|
+
lib/maptp-service/routing.rb
|
9
|
+
nbproject/private/private.properties
|
10
|
+
nbproject/private/rake-d.txt
|
11
|
+
nbproject/project.properties
|
12
|
+
nbproject/project.xml
|
13
|
+
script/console
|
14
|
+
script/destroy
|
15
|
+
script/generate
|
16
|
+
spec/maptp-service_spec.rb
|
17
|
+
spec/spec.opts
|
18
|
+
spec/spec_helper.rb
|
19
|
+
tasks/rspec.rake
|
data/PostInstall.txt
ADDED
data/README.rdoc
ADDED
@@ -0,0 +1,77 @@
|
|
1
|
+
= maptp-service
|
2
|
+
|
3
|
+
== FINALLY, A RUBY CLIENT FOR MAP TP!
|
4
|
+
|
5
|
+
Rpository: http://github.com/ffwdme/maptp-service
|
6
|
+
|
7
|
+
== DESCRIPTION:
|
8
|
+
|
9
|
+
This gem provides access to the MapTP web services.
|
10
|
+
|
11
|
+
In order to use them, you need your MapTP credentials aka your Map24 id.
|
12
|
+
|
13
|
+
For more information head over to http://www.nn4d.com
|
14
|
+
|
15
|
+
*Note*: This is *not* an official client of MapTP or NAVTEQ, but a private project. :)
|
16
|
+
|
17
|
+
== FEATURES/PROBLEMS:
|
18
|
+
|
19
|
+
* At this point, only a very simple routing request is implemented.
|
20
|
+
* more to come...
|
21
|
+
|
22
|
+
== SYNOPSIS:
|
23
|
+
|
24
|
+
First of all you need to provide your MapTP credentials.
|
25
|
+
For example if your Map24 id is "123ABC" and bound to the server maptp12.map24.com you'll enter
|
26
|
+
|
27
|
+
MapTP.set_credentials '123ABC', 'maptp12'
|
28
|
+
|
29
|
+
Given, you have two coordinates to create a route for:
|
30
|
+
|
31
|
+
start_coordinate = { :lat => 49.945589, :lng => 8.845563 }
|
32
|
+
destination_coordinate = { :lat => 49.936982, :lng => 8.911113 }
|
33
|
+
|
34
|
+
Just create a new routing object:
|
35
|
+
|
36
|
+
routing = MapTP::Routing.new
|
37
|
+
|
38
|
+
And try to find the matching route:
|
39
|
+
|
40
|
+
route = routing.find_route_by_coordinates start_coordinate, destination_coordinate
|
41
|
+
|
42
|
+
== REQUIREMENTS:
|
43
|
+
|
44
|
+
* The savon SOAP client (http://github.com/rubiii/savon)
|
45
|
+
|
46
|
+
== INSTALL:
|
47
|
+
|
48
|
+
sudo gem install maptp-service
|
49
|
+
|
50
|
+
== TESTING:
|
51
|
+
|
52
|
+
In order to run the tests properly, make sure you provided your MapTP credentials as shown above.
|
53
|
+
|
54
|
+
== LICENSE:
|
55
|
+
|
56
|
+
(The MIT License)
|
57
|
+
|
58
|
+
Copyright (c) 2010 Christian Bäuerlein
|
59
|
+
|
60
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
61
|
+
a copy of this software and associated documentation files (the
|
62
|
+
'Software'), to deal in the Software without restriction, including
|
63
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
64
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
65
|
+
permit persons to whom the Software is furnished to do so, subject to
|
66
|
+
the following conditions:
|
67
|
+
|
68
|
+
The above copyright notice and this permission notice shall be
|
69
|
+
included in all copies or substantial portions of the Software.
|
70
|
+
|
71
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
72
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
73
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
74
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
75
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
76
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
77
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
gem 'hoe', '>= 2.1.0'
|
3
|
+
require 'hoe'
|
4
|
+
require 'fileutils'
|
5
|
+
require './lib/maptp-service'
|
6
|
+
|
7
|
+
Hoe.plugin :newgem
|
8
|
+
# Hoe.plugin :website
|
9
|
+
# Hoe.plugin :cucumberfeatures
|
10
|
+
|
11
|
+
# Generate all the Rake tasks
|
12
|
+
# Run 'rake -T' to see list of generated tasks (from gem root directory)
|
13
|
+
$hoe = Hoe.spec 'maptp-service' do
|
14
|
+
self.developer 'Christian Bäuerlein', 'christian@ffwdme.com'
|
15
|
+
self.post_install_message = 'PostInstall.txt' # TODO remove if post-install message not required
|
16
|
+
self.rubyforge_name = self.name # TODO this is default value
|
17
|
+
self.extra_deps = [['savon','>= 0.7.6']]
|
18
|
+
|
19
|
+
end
|
20
|
+
|
21
|
+
require 'newgem/tasks'
|
22
|
+
# In Netbeans the next lines causes every rspec test to run twice.
|
23
|
+
# If you're not using Netbeans and having problem with testing - try to disable it.
|
24
|
+
#Dir['tasks/**/*.rake'].each { |t| load t }
|
25
|
+
|
26
|
+
# TODO - want other tests/tasks run by default? Add them to the list
|
27
|
+
# remove_task :default
|
28
|
+
# task :default => [:spec, :features]
|
@@ -0,0 +1,45 @@
|
|
1
|
+
require "rubygems"
|
2
|
+
require "savon"
|
3
|
+
#require "pp"
|
4
|
+
|
5
|
+
$:.unshift(File.dirname(__FILE__)) unless
|
6
|
+
$:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
|
7
|
+
|
8
|
+
require "maptp-service/routing"
|
9
|
+
require "maptp-service/parser/route"
|
10
|
+
|
11
|
+
# = A ruby client for MapTP services.
|
12
|
+
#
|
13
|
+
# This gem provides access to the MapTP web services.
|
14
|
+
#
|
15
|
+
# In order to use them, you need your MapTP credentials
|
16
|
+
# aka your Map24 id.
|
17
|
+
#
|
18
|
+
# For more information head over to http://www.nn4d.com
|
19
|
+
#
|
20
|
+
# *Note*: This is *not* an official client of MapTP or NAVTEQ, but a private project.
|
21
|
+
#
|
22
|
+
#
|
23
|
+
|
24
|
+
module MapTP
|
25
|
+
|
26
|
+
VERSION = '0.0.1'
|
27
|
+
|
28
|
+
|
29
|
+
def self.set_credentials( map24id, maptp_server )
|
30
|
+
@map24_id = map24id
|
31
|
+
@maptp_server = maptp_server
|
32
|
+
end
|
33
|
+
|
34
|
+
protected
|
35
|
+
|
36
|
+
def self.map24_id
|
37
|
+
@map24_id
|
38
|
+
end
|
39
|
+
|
40
|
+
def self.maptp_server
|
41
|
+
@maptp_server
|
42
|
+
end
|
43
|
+
|
44
|
+
|
45
|
+
end
|
@@ -0,0 +1,85 @@
|
|
1
|
+
module MapTP
|
2
|
+
|
3
|
+
# = Namespace for parsers handling the result.
|
4
|
+
module Parser
|
5
|
+
|
6
|
+
# Parses the results of a calculate route response.
|
7
|
+
module Route
|
8
|
+
|
9
|
+
# Parses the response to a hash
|
10
|
+
# and strips all unneccessary data
|
11
|
+
def self.to_hash(response)
|
12
|
+
|
13
|
+
resp = response.to_hash
|
14
|
+
|
15
|
+
route = resp[:calculate_route_response][:calculate_route_response][:route]
|
16
|
+
|
17
|
+
output = Hash.new
|
18
|
+
|
19
|
+
summary = Hash.new
|
20
|
+
summary[:duration] = route[:total_time].to_i
|
21
|
+
summary[:distance] = route[:total_length].to_i
|
22
|
+
|
23
|
+
output[:summary] = summary
|
24
|
+
|
25
|
+
|
26
|
+
directions = Array.new
|
27
|
+
|
28
|
+
route[:segments][:item].each do |direction|
|
29
|
+
|
30
|
+
direction.delete(:type)
|
31
|
+
direction.delete(:descriptions)
|
32
|
+
direction[:start].delete(:type)
|
33
|
+
direction[:start][:lng] = direction[:start][:longitude].to_f / 60
|
34
|
+
direction[:start].delete(:longitude)
|
35
|
+
direction[:start][:lat] = direction[:start][:latitude].to_f / 60
|
36
|
+
direction[:start].delete(:latitude)
|
37
|
+
|
38
|
+
direction[:heading] = direction[:direction][:value].to_i
|
39
|
+
direction.delete(:direction)
|
40
|
+
|
41
|
+
if direction[:coordinates]
|
42
|
+
|
43
|
+
direction[:path] = {}
|
44
|
+
direction[:path][:lng] = direction[:coordinates][:longitudes].split("|").map { |item| item.to_f / 60 }
|
45
|
+
direction[:path][:lat] = direction[:coordinates][:latitudes].split("|").map { |item| item.to_f / 60 }
|
46
|
+
|
47
|
+
direction.delete(:coordinates)
|
48
|
+
|
49
|
+
end
|
50
|
+
|
51
|
+
if direction[:roundabout_exit_number]
|
52
|
+
direction[:roundabout_exit_number] = direction[:roundabout_exit_number].to_i
|
53
|
+
end
|
54
|
+
|
55
|
+
if direction[:exit_number]
|
56
|
+
direction[:exit_number] = direction[:exit_number].to_i
|
57
|
+
end
|
58
|
+
|
59
|
+
# really?!
|
60
|
+
direction.delete(:via)
|
61
|
+
|
62
|
+
direction[:duration] = direction[:time].to_i
|
63
|
+
direction.delete(:time)
|
64
|
+
|
65
|
+
direction[:distance] = direction[:segment_length].to_i
|
66
|
+
direction.delete(:segment_length)
|
67
|
+
|
68
|
+
|
69
|
+
directions << direction
|
70
|
+
|
71
|
+
end
|
72
|
+
|
73
|
+
output[:directions] = directions
|
74
|
+
|
75
|
+
output
|
76
|
+
|
77
|
+
end
|
78
|
+
|
79
|
+
|
80
|
+
end
|
81
|
+
|
82
|
+
|
83
|
+
end
|
84
|
+
|
85
|
+
end
|
@@ -0,0 +1,95 @@
|
|
1
|
+
module MapTP
|
2
|
+
|
3
|
+
# Provides a Ruby client to the SOAP interface of the
|
4
|
+
# MapTP routing services.
|
5
|
+
#
|
6
|
+
# Should be initialized for every new routing request.
|
7
|
+
class Routing
|
8
|
+
|
9
|
+
def initialize
|
10
|
+
|
11
|
+
# Disable log output
|
12
|
+
Savon::Request.log = false
|
13
|
+
|
14
|
+
@client = Savon::Client.new "http://#{MapTP::maptp_server}.map24.com/map24/webservices1.5?soap=Map24Routing"
|
15
|
+
|
16
|
+
end
|
17
|
+
|
18
|
+
# Requests a route description for the given coordinates
|
19
|
+
#
|
20
|
+
# Parameters:
|
21
|
+
#
|
22
|
+
# [+start+] A hash containing, longitude and latitude, e.g. { :lng => 123, :lat => 465}
|
23
|
+
#
|
24
|
+
# [+destination+] A hash containing, longitude and latitude, e.g. { :lng => 123, :lat => 465}
|
25
|
+
#
|
26
|
+
# Returns either a hash containing the informations or a hash with a key +:ERROR+ containing
|
27
|
+
# the error message.
|
28
|
+
def find_route_by_coordinates(start, destination)
|
29
|
+
|
30
|
+
begin
|
31
|
+
|
32
|
+
response = @client.calculate_route! do |soap|
|
33
|
+
|
34
|
+
soap.namespaces["xmlns:SOAP-ENV"] = "http://schemas.xmlsoap.org/soap/envelope/"
|
35
|
+
soap.namespaces["xmlns:xsd"] = "http://www.w3.org/2001/XMLSchema"
|
36
|
+
soap.namespaces["xmlns:xsi"] = "http://www.w3.org/2001/XMLSchema-instance"
|
37
|
+
soap.namespaces["xmlns:wsdl"] = "Map24Routing"
|
38
|
+
soap.action = 'calculateRoute'
|
39
|
+
soap.input = 'calculateRoute'
|
40
|
+
|
41
|
+
soap.body = {
|
42
|
+
|
43
|
+
"RequestHeader" => {
|
44
|
+
"Map24ID" => MapTP::map24_id
|
45
|
+
|
46
|
+
},
|
47
|
+
"CalculateRouteRequest" => {
|
48
|
+
"Start" => {
|
49
|
+
"Coordinate" => {
|
50
|
+
"Longitude" => start[:lng] * 60,
|
51
|
+
"Latitude" => start[:lat] * 60
|
52
|
+
}
|
53
|
+
|
54
|
+
},
|
55
|
+
"Destination" => {
|
56
|
+
"Coordinate" => {
|
57
|
+
"Longitude" => destination[:lng] * 60,
|
58
|
+
"Latitude" => destination[:lat] * 60
|
59
|
+
}
|
60
|
+
}
|
61
|
+
#,"IgnoreDescription" => true
|
62
|
+
|
63
|
+
}
|
64
|
+
|
65
|
+
|
66
|
+
}
|
67
|
+
|
68
|
+
end
|
69
|
+
|
70
|
+
MapTP::Parser::Route.to_hash(response)
|
71
|
+
|
72
|
+
rescue Savon::SOAPFault => e
|
73
|
+
|
74
|
+
{ :ERROR => e.message }
|
75
|
+
|
76
|
+
|
77
|
+
rescue Savon::HTTPError => e
|
78
|
+
|
79
|
+
{ :ERROR => "HTTP Error" }
|
80
|
+
|
81
|
+
rescue SocketError
|
82
|
+
|
83
|
+
{ :ERROR => "No HTTP Connection" }
|
84
|
+
|
85
|
+
rescue
|
86
|
+
|
87
|
+
{ :ERROR => "Unknown Error" }
|
88
|
+
|
89
|
+
end
|
90
|
+
|
91
|
+
end
|
92
|
+
|
93
|
+
end
|
94
|
+
|
95
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
announce=Announce your release.
|
2
|
+
audit=Run ZenTest against the package.
|
3
|
+
check_extra_deps=Install missing dependencies.
|
4
|
+
check_manifest=Verify the manifest.
|
5
|
+
check_version=
|
6
|
+
clean=Clean up all the extras.
|
7
|
+
clobber=
|
8
|
+
clobber_docs=Remove rdoc products
|
9
|
+
clobber_package=Remove package products
|
10
|
+
clobber_rcov=
|
11
|
+
config_hoe=Create a fresh ~/.hoerc file.
|
12
|
+
debug_email=Generate email announcement file.
|
13
|
+
debug_gem=Show information about the gem.
|
14
|
+
default=Run the default task(s).
|
15
|
+
deps\:email=Print a contact list for gems dependent on this gem
|
16
|
+
deps\:fetch=Fetch all the dependent gems of this gem into tarballs
|
17
|
+
deps\:list=List all the dependent gems of this gem
|
18
|
+
doc=
|
19
|
+
doc/index.html=
|
20
|
+
docs=Build the RDOC HTML Files
|
21
|
+
gem=Build the gem file maptp-service-0.0.1.gem
|
22
|
+
gemspec=Generate a maptp-service.gemspec file
|
23
|
+
generate_key=Generate a key for signing your gems.
|
24
|
+
install_gem=Install the package as a gem.
|
25
|
+
install_gem_no_doc=Install the package as a gem, without generating documentation(ri/rdoc)
|
26
|
+
manifest=Recreate Manifest.txt to include ALL files to be deployed
|
27
|
+
newb=Install deps, generate docs, run tests/specs.
|
28
|
+
package=Build all the packages
|
29
|
+
pkg=
|
30
|
+
pkg/maptp-service-0.0.1=
|
31
|
+
pkg/maptp-service-0.0.1.gem=
|
32
|
+
pkg/maptp-service-0.0.1.tgz=
|
33
|
+
post_blog=Post announcement to blog.
|
34
|
+
post_news=Post announcement to rubyforge.
|
35
|
+
postrelease=
|
36
|
+
prerelease=
|
37
|
+
publish_docs=Publish RDoc to wherever you want.
|
38
|
+
publish_on_announce=
|
39
|
+
redocs=Force a rebuild of the RDOC files
|
40
|
+
release=Package and upload the release.
|
41
|
+
release_sanity=Sanity checks for release
|
42
|
+
release_to=
|
43
|
+
release_to_gemcutter=Push gem to gemcutter.
|
44
|
+
release_to_rubyforge=Release to rubyforge.
|
45
|
+
repackage=Force a rebuild of the package files
|
46
|
+
ridocs=Generate ri locally for testing.
|
47
|
+
ruby_env=
|
48
|
+
spec=Run all specifications
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<project xmlns="http://www.netbeans.org/ns/project/1">
|
3
|
+
<type>org.netbeans.modules.ruby.rubyproject</type>
|
4
|
+
<configuration>
|
5
|
+
<data xmlns="http://www.netbeans.org/ns/ruby-project/1">
|
6
|
+
<name>maptp-service</name>
|
7
|
+
<source-roots>
|
8
|
+
<root id="src.dir"/>
|
9
|
+
</source-roots>
|
10
|
+
<test-roots>
|
11
|
+
<root id="test.src.dir"/>
|
12
|
+
</test-roots>
|
13
|
+
</data>
|
14
|
+
</configuration>
|
15
|
+
</project>
|
data/script/console
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# File: script/console
|
3
|
+
irb = RUBY_PLATFORM =~ /(:?mswin|mingw)/ ? 'irb.bat' : 'irb'
|
4
|
+
|
5
|
+
libs = " -r irb/completion"
|
6
|
+
# Perhaps use a console_lib to store any extra methods I may want available in the cosole
|
7
|
+
# libs << " -r #{File.dirname(__FILE__) + '/../lib/console_lib/console_logger.rb'}"
|
8
|
+
libs << " -r #{File.dirname(__FILE__) + '/../lib/maptp-service.rb'}"
|
9
|
+
puts "Loading maptp-service gem"
|
10
|
+
exec "#{irb} #{libs} --simple-prompt"
|
data/script/destroy
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
|
3
|
+
|
4
|
+
begin
|
5
|
+
require 'rubigen'
|
6
|
+
rescue LoadError
|
7
|
+
require 'rubygems'
|
8
|
+
require 'rubigen'
|
9
|
+
end
|
10
|
+
require 'rubigen/scripts/destroy'
|
11
|
+
|
12
|
+
ARGV.shift if ['--help', '-h'].include?(ARGV[0])
|
13
|
+
RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme, :test_unit]
|
14
|
+
RubiGen::Scripts::Destroy.new.run(ARGV)
|
data/script/generate
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
|
3
|
+
|
4
|
+
begin
|
5
|
+
require 'rubigen'
|
6
|
+
rescue LoadError
|
7
|
+
require 'rubygems'
|
8
|
+
require 'rubigen'
|
9
|
+
end
|
10
|
+
require 'rubigen/scripts/generate'
|
11
|
+
|
12
|
+
ARGV.shift if ['--help', '-h'].include?(ARGV[0])
|
13
|
+
RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme, :test_unit]
|
14
|
+
RubiGen::Scripts::Generate.new.run(ARGV)
|
@@ -0,0 +1,42 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/spec_helper.rb'
|
2
|
+
|
3
|
+
|
4
|
+
|
5
|
+
describe "MapTP" do
|
6
|
+
|
7
|
+
|
8
|
+
before(:each) do
|
9
|
+
|
10
|
+
|
11
|
+
@start_coordinate = { :lat => 49.945589, :lng => 8.845563 }
|
12
|
+
@destination_coordinate = { :lat => 49.936982, :lng => 8.911113 }
|
13
|
+
|
14
|
+
@wrong_start_coordinate = { :lat => 1234657890, :lng => 1234657890 }
|
15
|
+
@wrong_destination_coordinate = { :lat => 987654321, :lng => 987654321 }
|
16
|
+
|
17
|
+
@routing = MapTP::Routing.new
|
18
|
+
|
19
|
+
end
|
20
|
+
|
21
|
+
it "should calculate a route and return it as a hash" do
|
22
|
+
|
23
|
+
@route = @routing.find_route_by_coordinates @start_coordinate, @destination_coordinate
|
24
|
+
|
25
|
+
@route.should be_kind_of(Hash)
|
26
|
+
|
27
|
+
#puts @route
|
28
|
+
|
29
|
+
end
|
30
|
+
|
31
|
+
it "should wrong route" do
|
32
|
+
|
33
|
+
@wrong_route = @routing.find_route_by_coordinates @wrong_start_coordinate, @wrong_destination_coordinate
|
34
|
+
|
35
|
+
@wrong_route.should be_kind_of(Hash)
|
36
|
+
|
37
|
+
@wrong_route[:ERROR].should be_instance_of(String)
|
38
|
+
|
39
|
+
end
|
40
|
+
|
41
|
+
|
42
|
+
end
|
data/spec/spec.opts
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--colour
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
begin
|
2
|
+
require 'spec'
|
3
|
+
rescue LoadError
|
4
|
+
require 'rubygems' unless ENV['NO_RUBYGEMS']
|
5
|
+
gem 'rspec'
|
6
|
+
require 'spec'
|
7
|
+
end
|
8
|
+
|
9
|
+
$:.unshift(File.dirname(__FILE__) + '/../lib')
|
10
|
+
require 'maptp-service'
|
11
|
+
|
12
|
+
# In order to perform the rspec tests properly
|
13
|
+
# you have to provide your MapTP credentials.
|
14
|
+
#
|
15
|
+
# e.g. if your Map24 id is "123ABC" and bound
|
16
|
+
# to the server maptp12.map24.com you'll enter
|
17
|
+
#
|
18
|
+
# MapTP.set_credentials '123ABC', 'maptp12'
|
19
|
+
|
data/tasks/rspec.rake
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
begin
|
2
|
+
require 'spec'
|
3
|
+
rescue LoadError
|
4
|
+
require 'rubygems' unless ENV['NO_RUBYGEMS']
|
5
|
+
require 'spec'
|
6
|
+
end
|
7
|
+
begin
|
8
|
+
require 'spec/rake/spectask'
|
9
|
+
rescue LoadError
|
10
|
+
puts <<-EOS
|
11
|
+
To use rspec for testing you must install rspec gem:
|
12
|
+
gem install rspec
|
13
|
+
EOS
|
14
|
+
exit(0)
|
15
|
+
end
|
16
|
+
|
17
|
+
desc "Run the specs under spec/models"
|
18
|
+
Spec::Rake::SpecTask.new do |t|
|
19
|
+
t.spec_opts = ['--options', "spec/spec.opts"]
|
20
|
+
t.spec_files = FileList['spec/**/*_spec.rb']
|
21
|
+
end
|
metadata
ADDED
@@ -0,0 +1,133 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: maptp-service
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 0
|
8
|
+
- 1
|
9
|
+
version: 0.0.1
|
10
|
+
platform: ruby
|
11
|
+
authors:
|
12
|
+
- "Christian B\xC3\xA4uerlein"
|
13
|
+
autorequire:
|
14
|
+
bindir: bin
|
15
|
+
cert_chain: []
|
16
|
+
|
17
|
+
date: 2010-05-03 00:00:00 +02:00
|
18
|
+
default_executable:
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
21
|
+
name: savon
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - ">="
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
segments:
|
28
|
+
- 0
|
29
|
+
- 7
|
30
|
+
- 6
|
31
|
+
version: 0.7.6
|
32
|
+
type: :runtime
|
33
|
+
version_requirements: *id001
|
34
|
+
- !ruby/object:Gem::Dependency
|
35
|
+
name: rubyforge
|
36
|
+
prerelease: false
|
37
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - ">="
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
segments:
|
42
|
+
- 2
|
43
|
+
- 0
|
44
|
+
- 4
|
45
|
+
version: 2.0.4
|
46
|
+
type: :development
|
47
|
+
version_requirements: *id002
|
48
|
+
- !ruby/object:Gem::Dependency
|
49
|
+
name: hoe
|
50
|
+
prerelease: false
|
51
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - ">="
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
segments:
|
56
|
+
- 2
|
57
|
+
- 6
|
58
|
+
- 0
|
59
|
+
version: 2.6.0
|
60
|
+
type: :development
|
61
|
+
version_requirements: *id003
|
62
|
+
description: |-
|
63
|
+
This gem provides access to the MapTP web services.
|
64
|
+
|
65
|
+
In order to use them, you need your MapTP credentials aka your Map24 id.
|
66
|
+
|
67
|
+
For more information head over to http://www.nn4d.com
|
68
|
+
|
69
|
+
*Note*: This is *not* an official client of MapTP or NAVTEQ, but a private project. :)
|
70
|
+
email:
|
71
|
+
- christian@ffwdme.com
|
72
|
+
executables: []
|
73
|
+
|
74
|
+
extensions: []
|
75
|
+
|
76
|
+
extra_rdoc_files:
|
77
|
+
- History.txt
|
78
|
+
- Manifest.txt
|
79
|
+
- PostInstall.txt
|
80
|
+
- nbproject/private/rake-d.txt
|
81
|
+
files:
|
82
|
+
- History.txt
|
83
|
+
- Manifest.txt
|
84
|
+
- PostInstall.txt
|
85
|
+
- README.rdoc
|
86
|
+
- Rakefile
|
87
|
+
- lib/maptp-service.rb
|
88
|
+
- lib/maptp-service/parser/route.rb
|
89
|
+
- lib/maptp-service/routing.rb
|
90
|
+
- nbproject/private/private.properties
|
91
|
+
- nbproject/private/rake-d.txt
|
92
|
+
- nbproject/project.properties
|
93
|
+
- nbproject/project.xml
|
94
|
+
- script/console
|
95
|
+
- script/destroy
|
96
|
+
- script/generate
|
97
|
+
- spec/maptp-service_spec.rb
|
98
|
+
- spec/spec.opts
|
99
|
+
- spec/spec_helper.rb
|
100
|
+
- tasks/rspec.rake
|
101
|
+
has_rdoc: true
|
102
|
+
homepage:
|
103
|
+
licenses: []
|
104
|
+
|
105
|
+
post_install_message: PostInstall.txt
|
106
|
+
rdoc_options:
|
107
|
+
- --main
|
108
|
+
- README.rdoc
|
109
|
+
require_paths:
|
110
|
+
- lib
|
111
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
112
|
+
requirements:
|
113
|
+
- - ">="
|
114
|
+
- !ruby/object:Gem::Version
|
115
|
+
segments:
|
116
|
+
- 0
|
117
|
+
version: "0"
|
118
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
119
|
+
requirements:
|
120
|
+
- - ">="
|
121
|
+
- !ruby/object:Gem::Version
|
122
|
+
segments:
|
123
|
+
- 0
|
124
|
+
version: "0"
|
125
|
+
requirements: []
|
126
|
+
|
127
|
+
rubyforge_project: maptp-service
|
128
|
+
rubygems_version: 1.3.6
|
129
|
+
signing_key:
|
130
|
+
specification_version: 3
|
131
|
+
summary: This gem provides access to the MapTP web services
|
132
|
+
test_files: []
|
133
|
+
|