distance_fox 0.1.4 → 0.1.5

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2afe2b7e3b59d3047f7b2ce181169f2a4fb3bcc882572ee66856468909f08ee3
4
- data.tar.gz: 7e1c0b16d8c0d3fa05afc4ff02b2850ea40c231b9cd69c9e571a2094b7affd2a
3
+ metadata.gz: 3482b2639db7abb94e287131976731cb735d6a00a9e4ee1a59baedabbc225d5c
4
+ data.tar.gz: 85e0ff5dc5060e139881d4999459eda4f1ad49c50410a6106e8f5020a9b68104
5
5
  SHA512:
6
- metadata.gz: 7b56bd1db29afdd6e1f681b66c350c530e278ff750652a75d7f75dafbcd8bffba6b343d8109161fecbef15ff794a1951c0f99f5dcfab4e5ac9e35e287d7960f6
7
- data.tar.gz: 6ce540bc79a13fa41a33f72926652925391f33f22de984a8800dda0d5278a98374fa20df1281052ed1a2a226a512413dfa561f6fd778077855fd699d60c96cce
6
+ metadata.gz: bc7bae93bca18e0f510cd4bec4d3bf24122c870d2e6236118af132136f0815e997aa495266ba106355ffa09837777be18763f52da2f76f97cf8db2c9301547b3
7
+ data.tar.gz: 3d120db76f035a238e979e455a5dad137659da57643c6ca1e19235d7cca1062cb1ca43abf80a3a5100bce0596eafa726ed53762aa4aaf41e87642de881d8a2cc
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- distance_fox (0.1.4)
4
+ distance_fox (0.1.5)
5
5
  httparty (~> 0.13.7)
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -20,7 +20,9 @@ Or install it yourself as:
20
20
 
21
21
  ## Configuration
22
22
 
23
- Set up DistanceFox with your Google Distance Matrix API Key:
23
+ Activate "Distance Matrix API" & "Geocoding API" in your Google Developers Console.
24
+
25
+ Set up DistanceFox with your API Key:
24
26
 
25
27
  ```ruby
26
28
  DistanceFox.configure do |config|
@@ -37,7 +39,7 @@ end
37
39
  # * a geocodable address (string)
38
40
  #
39
41
  # Destinations can be:
40
- # * a hash of arrays ({['city' => 'City', 'coordinates' => ['lat','lon']]})
42
+ # * an array of hashes ([{'city' => 'City', 'coordinates' => ['lat','lon']}])
41
43
  DistanceFox::Calculations.nearest_driving_distance(origin_coordinates, destinations)
42
44
 
43
45
  # Origin can be:
@@ -45,7 +47,7 @@ DistanceFox::Calculations.nearest_driving_distance(origin_coordinates, destinati
45
47
  # * an array of string coordinates (['lat','lon'])
46
48
  #
47
49
  # Destinations can be:
48
- # * a hash of arrays ({['city' => 'City', 'coordinates' => ['lat','lon']]})
50
+ # * an array of hashes ([{'city' => 'City', 'coordinates' => ['lat','lon']}])
49
51
  DistanceFox::Calculations.nearest_linear_distance(origin, destinations)
50
52
 
51
53
  # Origin and destination can be:
data/distance_fox.gemspec CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
10
10
 
11
11
  spec.summary = 'Calculate the driving distance from a destination to the nearest of multiple locations'
12
12
  spec.license = 'MIT'
13
- spec.required_ruby_version = '>= 2.0.0'
13
+ spec.required_ruby_version = '>= 2.5.0'
14
14
 
15
15
  # Specify which files should be added to the gem when it is released.
16
16
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
@@ -35,7 +35,7 @@ module DistanceFox
35
35
  # * an array of string coordinates (['lat','lon'])
36
36
  #
37
37
  # Destinations can be:
38
- # * a hash of arrays ({['city' => 'City', 'coordinates' => ['lat','lon']]})
38
+ # * an array of hashes ([{'city' => 'City', 'coordinates' => ['lat','lon']}])
39
39
  def self.nearest_linear_distance(origin, destinations)
40
40
  origins_with_distance = []
41
41
  origin_coordinates = extract_coordinates origin
@@ -76,7 +76,7 @@ module DistanceFox
76
76
  # * a geocodable address (string)
77
77
  #
78
78
  # Destinations can be:
79
- # * a hash of arrays ({['city' => 'City', 'coordinates' => ['lat','lon']]})
79
+ # * an array of hashes ([{'city' => 'City', 'coordinates' => ['lat','lon']}])
80
80
  def self.nearest_driving_distance(origin, destinations)
81
81
  origin = origin.join(',')
82
82
  destination = nearest_linear_distance(origin, destinations)['coordinates']['destination'].join(',')
@@ -1,3 +1,3 @@
1
1
  module DistanceFox
2
- VERSION = '0.1.4'.freeze
2
+ VERSION = '0.1.5'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: distance_fox
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - danielwollen
@@ -101,7 +101,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
101
101
  requirements:
102
102
  - - ">="
103
103
  - !ruby/object:Gem::Version
104
- version: 2.0.0
104
+ version: 2.5.0
105
105
  required_rubygems_version: !ruby/object:Gem::Requirement
106
106
  requirements:
107
107
  - - ">="