shipment 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -10,6 +10,7 @@ module BrighterPlanet
10
10
  has :segment_count
11
11
  has :origin_zip_code
12
12
  has :destination_zip_code
13
+ has :mapquest_api_key, :display => lambda { |key| "secret key" }
13
14
  end
14
15
  end
15
16
  end
data/lib/shipment/data.rb CHANGED
@@ -11,6 +11,7 @@ module BrighterPlanet
11
11
  integer 'segment_count'
12
12
  string 'origin_zip_code_name'
13
13
  string 'destination_zip_code_name'
14
+ string 'mapquest_api_key'
14
15
  end
15
16
 
16
17
  process :run_data_miner_on_belongs_to_associations
@@ -1,5 +1,6 @@
1
1
  require 'net/http'
2
2
  require 'nokogiri'
3
+ require 'uri'
3
4
 
4
5
  class MapQuestDirections
5
6
  class Failure < StandardError; end
@@ -7,7 +8,7 @@ class MapQuestDirections
7
8
  attr_accessor :location_1, :location_2, :xml_call, :doc
8
9
 
9
10
  def initialize(location_1, location_2, api_key)
10
- @base_url = "http://www.mapquestapi.com/directions/v1/route?key=#{api_key}&outFormat=xml&"
11
+ @base_url = "http://www.mapquestapi.com/directions/v1/route?key=#{URI.escape(api_key)}&outFormat=xml&"
11
12
  @location_1 = location_1
12
13
  @location_2 = location_2
13
14
  options = "from=#{transcribe(@location_1)}&to=#{transcribe(@location_2)}"
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 4
9
- version: 0.0.4
8
+ - 5
9
+ version: 0.0.5
10
10
  platform: ruby
11
11
  authors:
12
12
  - Andy Rossmeissl
@@ -151,7 +151,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
151
151
  requirements:
152
152
  - - ">="
153
153
  - !ruby/object:Gem::Version
154
- hash: 774422413
154
+ hash: 682105265
155
155
  segments:
156
156
  - 0
157
157
  version: "0"