mqproxy 1.0 → 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.
- data/lib/mqproxy.rb +2 -5
- metadata +18 -4
data/lib/mqproxy.rb
CHANGED
@@ -37,10 +37,7 @@ class MQProxy
|
|
37
37
|
|
38
38
|
# Generic function to send data to MapQuest and handle response
|
39
39
|
def send_to_map_quest(xmlInputString, options)
|
40
|
-
options
|
41
|
-
options[:port] ||= 80
|
42
|
-
options[:name] ||= 'www.mapquestapi.com'
|
43
|
-
options[:path] ||= 'geocoding/v1/address'
|
40
|
+
options = {:method => 'POST', :port => 80,:name => 'www.mapquestapi.com',:path => 'geocoding/v1/address'}.merge(options)
|
44
41
|
url = URI.parse("http://"+options[:name]+"/"+options[:path] +"?key=#{APP_KEY}")
|
45
42
|
headers = {"Content-Type" => "text/json; charset=utf-8"}
|
46
43
|
http = Net::HTTP.new(url.host, url.port)
|
@@ -50,7 +47,7 @@ class MQProxy
|
|
50
47
|
}
|
51
48
|
doc = JSON.parse(response.body)
|
52
49
|
if doc['info']['statuscode'] != 0
|
53
|
-
raise StandardError, "There was an error with your request: #{doc['info']['
|
50
|
+
raise StandardError, "There was an error with your request: #{doc['info']['messages']}"
|
54
51
|
end
|
55
52
|
doc
|
56
53
|
end
|
metadata
CHANGED
@@ -1,8 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mqproxy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
|
4
|
+
hash: 19
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 1
|
8
|
+
- 1
|
9
|
+
- 0
|
10
|
+
version: 1.1.0
|
6
11
|
platform: ruby
|
7
12
|
authors:
|
8
13
|
- Christopher Brady
|
@@ -21,11 +26,14 @@ dependencies:
|
|
21
26
|
requirements:
|
22
27
|
- - ">="
|
23
28
|
- !ruby/object:Gem::Version
|
29
|
+
hash: 3
|
30
|
+
segments:
|
31
|
+
- 0
|
24
32
|
version: "0"
|
25
33
|
type: :runtime
|
26
34
|
version_requirements: *id001
|
27
35
|
description: A wrapper for the MapQuest API, provides ability to get route and to geocode an address
|
28
|
-
email:
|
36
|
+
email: chris@bradynet.net
|
29
37
|
executables: []
|
30
38
|
|
31
39
|
extensions: []
|
@@ -53,17 +61,23 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
53
61
|
requirements:
|
54
62
|
- - ">="
|
55
63
|
- !ruby/object:Gem::Version
|
64
|
+
hash: 3
|
65
|
+
segments:
|
66
|
+
- 0
|
56
67
|
version: "0"
|
57
68
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
58
69
|
none: false
|
59
70
|
requirements:
|
60
71
|
- - ">="
|
61
72
|
- !ruby/object:Gem::Version
|
73
|
+
hash: 3
|
74
|
+
segments:
|
75
|
+
- 0
|
62
76
|
version: "0"
|
63
77
|
requirements: []
|
64
78
|
|
65
79
|
rubyforge_project:
|
66
|
-
rubygems_version: 1.
|
80
|
+
rubygems_version: 1.3.7
|
67
81
|
signing_key:
|
68
82
|
specification_version: 3
|
69
83
|
summary: A wrapper for the MapQuest API, provides ability to get route and to geocode an address
|