diff --git a/README.md b/README.md index 2d277ba..ffa5ccb 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ Routific Ruby Gem [![Build Status](https://travis-ci.org/routific/routific-gem.svg?branch=master)](https://travis-ci.org/routific/routific-gem) -This Ruby Gem assists users to easily access the [Routific API][1], which is a practical and scalable solution to the Vehicle Routing Problem. +This Ruby Gem assists users to easily access the [Routific API][1], which is a practical and scalable solution to the Vehicle Routing Problem and Traveling Salesman Problem. [1]: https://routific.com/developers @@ -60,11 +60,16 @@ routific.set_vehicle("vehicle_1", { "shift_end" => "12:00", }) +routific.set_options({ + "polylines" => true +}) + route = routific.get_route() puts route.status # => "success" puts route.total_travel_time # => 29 +puts route.polylines["vehicle_1"] # => s`i}|AbxswiFnn@gdBvG?vVf@jC?nZRb[f@j\z@nZRnZRj\f@nZz vehicle_routes = route.vehicle_routes diff --git a/lib/routific/options.rb b/lib/routific/options.rb index 6574155..2f947a4 100644 --- a/lib/routific/options.rb +++ b/lib/routific/options.rb @@ -1,7 +1,7 @@ module RoutificApi # This class represents a set of options for the request class Options - VALID_PARAMS = %w{ traffic min_visits_per_vehicle balance min_vehicles shortest_distance squash_durations max_vehicle_overtime max_visit_lateness } + VALID_PARAMS = %w{ traffic min_visits_per_vehicle balance min_vehicles shortest_distance squash_durations max_vehicle_overtime max_visit_lateness polylines } attr_reader *VALID_PARAMS diff --git a/lib/routific/route.rb b/lib/routific/route.rb index f08c196..89e6c9b 100644 --- a/lib/routific/route.rb +++ b/lib/routific/route.rb @@ -8,7 +8,8 @@ class Route :total_working_time, :total_travel_time, :total_break_time, :total_idle_time, :total_visit_lateness, :num_late_visits, - :vehicle_overtime, :total_vehicle_overtime + :vehicle_overtime, :total_vehicle_overtime, + :polylines, ] attr_reader *FIELDS diff --git a/routific.gemspec b/routific.gemspec index 6ba1655..86131df 100644 --- a/routific.gemspec +++ b/routific.gemspec @@ -1,8 +1,8 @@ Gem::Specification.new do |s| s.name = 'routific' - s.version = '1.7.2' - s.date = '2017-09-25' - s.add_runtime_dependency('rest-client', '~> 1.7') + s.version = '1.7.3' + s.date = '2019-11-26' + s.add_runtime_dependency('rest-client', '~> 2.0.1') s.add_runtime_dependency('json', '~> 1.8') s.add_development_dependency('rspec', '~> 3.0') s.add_development_dependency('faker', '>= 1.6.2') diff --git a/spec/routific_spec.rb b/spec/routific_spec.rb index 9633844..769f08a 100644 --- a/spec/routific_spec.rb +++ b/spec/routific_spec.rb @@ -157,7 +157,7 @@ def set_visit_and_vehicle(routific) expect(job.id).to be_instance_of(String) expect(job.input).to be_instance_of(Hash) expect(job.status).to eq('pending') - sleep 1 + sleep 10 expect(job.fetch).to eq('finished') expect(job.route).to be_instance_of(RoutificApi::Route) end