From f8d1f05e4f9ecba6ab65156a649a73ce81951915 Mon Sep 17 00:00:00 2001 From: Afian Date: Wed, 27 Nov 2019 09:36:01 +0800 Subject: [PATCH 1/7] increase version to 1.7.3 --- routific.gemspec | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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') From 15fc6b3a38e75d9c7b8f28d2971f8e2b7a559e43 Mon Sep 17 00:00:00 2001 From: Afian Date: Wed, 27 Nov 2019 09:36:39 +0800 Subject: [PATCH 2/7] add polylines --- lib/routific/options.rb | 2 +- lib/routific/route.rb | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) 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 From 82463b011002cbde46862aa8dcbfc16ad2d937d1 Mon Sep 17 00:00:00 2001 From: Afian Date: Wed, 27 Nov 2019 09:37:09 +0800 Subject: [PATCH 3/7] update README --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 2d277ba..87a19fd 100644 --- a/README.md +++ b/README.md @@ -65,6 +65,7 @@ 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 From 8c430d70f594d632ee6352a24c0376dc49753157 Mon Sep 17 00:00:00 2001 From: Afian Date: Thu, 28 Nov 2019 12:03:33 -0800 Subject: [PATCH 4/7] Fixed failing tests by increasing sleep to 10 --- spec/routific_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From 699e7ffb1e6eb91577f04c742b722d25a41bbf17 Mon Sep 17 00:00:00 2001 From: Afian Date: Thu, 28 Nov 2019 16:00:24 -0800 Subject: [PATCH 5/7] Added polylines to options example in readme.md --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 87a19fd..c457627 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,10 @@ routific.set_vehicle("vehicle_1", { "shift_end" => "12:00", }) +routific.set_options({ + "polylines" => true +}) + route = routific.get_route() From 86b3a2584b2adf874d10da5cb5fb44a49618d178 Mon Sep 17 00:00:00 2001 From: Afian Anwar Date: Thu, 28 Nov 2019 16:00:24 -0800 Subject: [PATCH 6/7] Added polylines to options example in readme.md --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 87a19fd..c457627 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,10 @@ routific.set_vehicle("vehicle_1", { "shift_end" => "12:00", }) +routific.set_options({ + "polylines" => true +}) + route = routific.get_route() From 31aaa1d8292ef13fc3809c0ffa6c876837ea2513 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CAfian?= Date: Thu, 28 Nov 2019 22:25:47 -0800 Subject: [PATCH 7/7] Fixed readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c457627..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