google_distance_matrix 0.6.7 → 0.7.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fd7b57fa45392b8c5efbb5aac1c78785a1b6ebee87cf6dad1e9d1b6e46343ffb
4
- data.tar.gz: 65f7561df069c5a95704c18573ddffee4f3244ffe31fc5a6f3c41eac439b1ce5
3
+ metadata.gz: 8295057a710e9ca9f73a0ced34192a21b0e1ccf2487bf061a0cf9dc473091757
4
+ data.tar.gz: 73b1a6ba855941037f21c6a7e268c3d1df7ba6e8915f3b0f151002ce5814cc9a
5
5
  SHA512:
6
- metadata.gz: 045bece3efd707661135fc7d53ce7177b52d430ad7f3dc0a7d61146bcf459749faa36fc45fb38d5f3d433c74ecf75a67ac8c4b39f20f8d29f11fe66c9482141f
7
- data.tar.gz: 846634a14851b622021bba17927730c9ec9c256dcc5533d0348b4e819c69fd89cc4e912fa0eaf68419ba6ecfb04a1d661888d94eb2bc203bfcfc74274cda8662
6
+ metadata.gz: 533e808c1086db29504b181f310568d69222a9e2b90d8aa4ad43d2154f0b0503ce363942f55b4b6d6d37806497dc334bc714c70472b270b52aee65781c6f30bb
7
+ data.tar.gz: aa9bd7acc3c2826afa14558d8999410975774dc85012ddcc6e23225dcadc419ee61955459ac31ed8d63ade4b3a637d9eec3698274dc7053d0c63d7dc3107fd9a
@@ -0,0 +1,11 @@
1
+ # To get started with Dependabot version updates, you'll need to specify which
2
+ # package ecosystems to update and where the package manifests are located.
3
+ # Please see the documentation for all configuration options:
4
+ # https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
5
+
6
+ version: 2
7
+ updates:
8
+ - package-ecosystem: "bundler" # See documentation for possible values
9
+ directory: "/" # Location of package manifests
10
+ schedule:
11
+ interval: "weekly"
@@ -13,17 +13,14 @@ jobs:
13
13
  strategy:
14
14
  matrix:
15
15
  ruby-version:
16
- - '2.6'
17
- - '2.7'
18
- - '3.0'
16
+ - '3.1'
17
+ - '3.2'
18
+ - '3.3'
19
19
 
20
20
  steps:
21
- - uses: actions/checkout@v2
21
+ - uses: actions/checkout@v4
22
22
  - name: Set up Ruby
23
- # To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
24
- # change this to (see https://github.com/ruby/setup-ruby#versioning):
25
- # uses: ruby/setup-ruby@v1
26
- uses: ruby/setup-ruby@473e4d8fe5dd94ee328fdfca9f8c9c7afc9dae5e
23
+ uses: ruby/setup-ruby@v1
27
24
  with:
28
25
  ruby-version: ${{ matrix.ruby-version }}
29
26
  bundler-cache: true # runs 'bundle install' and caches installed gems automatically
data/.rubocop.yml CHANGED
@@ -1,6 +1,9 @@
1
- Metrics/LineLength:
1
+ AllCops:
2
+ NewCops: disable
3
+
4
+ Layout/LineLength:
2
5
  Max: 100
3
-
6
+
4
7
  Metrics/BlockLength:
5
8
  Exclude:
6
9
  - 'spec/**/*_spec.rb'
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.5.5
1
+ 3.0.7
data/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ ## v.0.7.1
2
+
3
+ * added support for Rails 8, dropped upper version constraint (#64)
4
+
5
+ ## v.0.7.0
6
+
7
+ * chore: bumped dependency support up to Rails 7.2 (by yenshirak)
8
+ * dropped support for Ruby 2.x
9
+
1
10
  ## v.0.6.7
2
11
 
3
12
  * chore: bumped dependency support up to Rails 7.1 (by justisb)
data/Gemfile CHANGED
@@ -4,3 +4,9 @@ source 'https://rubygems.org'
4
4
 
5
5
  # Specify your gem's dependencies in google_distance_matrix.gemspec
6
6
  gemspec
7
+
8
+ gem 'rake'
9
+ gem 'rspec', '~> 3.13.0'
10
+ gem 'rubocop', '~> 0.93.1'
11
+ gem 'shoulda-matchers', '~> 6.0'
12
+ gem 'webmock', '~> 3.24.0'
data/README.md CHANGED
@@ -103,7 +103,7 @@ routes in your result set for the called method are ok.
103
103
  Add this line to your application's Gemfile:
104
104
 
105
105
  ```ruby
106
- gem 'google_distance_matrix'
106
+ gem 'google_distance_matrix'‚ '~> 0.7.0'
107
107
  ```
108
108
  And then execute:
109
109
 
@@ -114,6 +114,15 @@ Or install it yourself as:
114
114
  $ gem install google_distance_matrix
115
115
 
116
116
 
117
+ ### Ruby 2.x support
118
+
119
+ Legacy systems that needs to run on unsupported rubies can depend on `v0.6.7`, which is the last supported version for Ruby 2.
120
+
121
+ ```ruby
122
+ gem 'google_distance_matrix', '0.6.7'
123
+ ```
124
+
125
+
117
126
  ## Configuration
118
127
 
119
128
  Configuration is done directly on a matrix or via `GoogleDistanceMatrix.configure_defaults`.
@@ -19,14 +19,9 @@ Gem::Specification.new do |spec|
19
19
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
20
20
  spec.require_paths = ['lib']
21
21
 
22
- spec.add_dependency 'activemodel', '>= 3.2.13', '< 7.2'
23
- spec.add_dependency 'activesupport', '>= 3.2.13', '< 7.2'
24
- spec.add_dependency 'google_business_api_url_signer', '~> 0.1.3'
22
+ spec.required_ruby_version = '>= 3.0'
25
23
 
26
- spec.add_development_dependency 'bundler'
27
- spec.add_development_dependency 'rake'
28
- spec.add_development_dependency 'rspec', '~> 3.12.0'
29
- spec.add_development_dependency 'rubocop', '~> 0.59.2'
30
- spec.add_development_dependency 'shoulda-matchers', '~> 4.0.0.rc1'
31
- spec.add_development_dependency 'webmock', '~> 3.4.2'
24
+ spec.add_dependency 'activemodel', '>= 3.2.13'
25
+ spec.add_dependency 'activesupport', '>= 3.2.13'
26
+ spec.add_dependency 'google_business_api_url_signer', '~> 0.1.3'
32
27
  end
@@ -32,8 +32,8 @@ module GoogleDistanceMatrix
32
32
  end
33
33
 
34
34
  handle response, url
35
- rescue Timeout::Error => error
36
- raise ServerError, error
35
+ rescue Timeout::Error => e
36
+ raise ServerError, e
37
37
  end
38
38
 
39
39
  private
@@ -95,8 +95,6 @@ module GoogleDistanceMatrix
95
95
  @lng = attributes[:lng]
96
96
  end
97
97
 
98
- # rubocop:disable Metrics/AbcSize
99
- # rubocop:disable Metrics/CyclomaticComplexity
100
98
  # rubocop:disable Style/GuardClause
101
99
  def validate_attributes
102
100
  unless address.present? || (lat.present? && lng.present?)
@@ -107,8 +105,6 @@ module GoogleDistanceMatrix
107
105
  raise ArgumentError, 'Cannot provide address, lat and lng.'
108
106
  end
109
107
  end
110
- # rubocop:enable Metrics/AbcSize
111
- # rubocop:enable Metrics/CyclomaticComplexity
112
108
  # rubocop:enable Style/GuardClause
113
109
  end
114
110
  end
@@ -14,6 +14,7 @@ module GoogleDistanceMatrix
14
14
  class ValueEncoder
15
15
  # rubocop:disable Metrics/MethodLength
16
16
  # rubocop:disable Metrics/AbcSize
17
+ # rubocop:disable Metrics/CyclomaticComplexity
17
18
  def encode(value)
18
19
  negative = value < 0
19
20
  value = value.abs
@@ -49,6 +50,7 @@ module GoogleDistanceMatrix
49
50
  # step 11: Convert to ASCII
50
51
  chunks_of_5_bits.map(&:chr)
51
52
  end
53
+ # rubocop:enable Metrics/CyclomaticComplexity
52
54
  # rubocop:enable Metrics/MethodLength
53
55
  # rubocop:enable Metrics/AbcSize
54
56
 
@@ -81,7 +81,6 @@ module GoogleDistanceMatrix
81
81
  end
82
82
 
83
83
  # rubocop:disable Metrics/MethodLength
84
- # rubocop:disable Metrics/AbcSize
85
84
  def places_to_param(places)
86
85
  places_to_param_config = { lat_lng_scale: configuration.lat_lng_scale }
87
86
 
@@ -102,7 +101,6 @@ module GoogleDistanceMatrix
102
101
  out.join(DELIMITER)
103
102
  end
104
103
  # rubocop:enable Metrics/MethodLength
105
- # rubocop:enable Metrics/AbcSize
106
104
 
107
105
  def protocol
108
106
  configuration.protocol + '://'
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GoogleDistanceMatrix
4
- VERSION = '0.6.7'
4
+ VERSION = '0.7.1'
5
5
  end
@@ -12,7 +12,7 @@ describe GoogleDistanceMatrix::ClientCache do
12
12
 
13
13
  subject { described_class.new client, cache }
14
14
 
15
- # rubocop:disable Metrics/LineLength
15
+ # rubocop:disable Layout/LineLength
16
16
  describe '::key' do
17
17
  it 'returns a digest of given URL' do
18
18
  key = described_class.key 'some url with secret parts', config
@@ -29,7 +29,7 @@ describe GoogleDistanceMatrix::ClientCache do
29
29
 
30
30
  expect(subject.get(url, options)).to eq 'cached-data'
31
31
  end
32
- # rubocop:enable Metrics/LineLength
32
+ # rubocop:enable Layout/LineLength
33
33
 
34
34
  it 'asks client when cache miss' do
35
35
  expect(client).to receive(:get).with(url, options).and_return 'api-data'
@@ -91,12 +91,12 @@ describe GoogleDistanceMatrix::Configuration do
91
91
  it { expect(subject.logger).to be_nil }
92
92
  it { expect(subject.cache).to be_nil }
93
93
 
94
- # rubocop:disable Metrics/LineLength
94
+ # rubocop:disable Layout/LineLength
95
95
  it 'has a default expected cache_key_transform' do
96
96
  key = subject.cache_key_transform.call('foo')
97
97
  expect(key).to eq 'f7fbba6e0636f890e56fbbf3283e524c6fa3204ae298382d624741d0dc6638326e282c41be5e4254d8820772c5518a2c5a8c0c7f7eda19594a7eb539453e1ed7'
98
98
  end
99
- # rubocop:enable Metrics/LineLength
99
+ # rubocop:enable Layout/LineLength
100
100
  end
101
101
 
102
102
  describe '#to_param' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google_distance_matrix
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.7
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thorbjørn Hermansen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-10-21 00:00:00.000000000 Z
11
+ date: 2024-12-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel
@@ -17,9 +17,6 @@ dependencies:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: 3.2.13
20
- - - "<"
21
- - !ruby/object:Gem::Version
22
- version: '7.2'
23
20
  type: :runtime
24
21
  prerelease: false
25
22
  version_requirements: !ruby/object:Gem::Requirement
@@ -27,9 +24,6 @@ dependencies:
27
24
  - - ">="
28
25
  - !ruby/object:Gem::Version
29
26
  version: 3.2.13
30
- - - "<"
31
- - !ruby/object:Gem::Version
32
- version: '7.2'
33
27
  - !ruby/object:Gem::Dependency
34
28
  name: activesupport
35
29
  requirement: !ruby/object:Gem::Requirement
@@ -37,9 +31,6 @@ dependencies:
37
31
  - - ">="
38
32
  - !ruby/object:Gem::Version
39
33
  version: 3.2.13
40
- - - "<"
41
- - !ruby/object:Gem::Version
42
- version: '7.2'
43
34
  type: :runtime
44
35
  prerelease: false
45
36
  version_requirements: !ruby/object:Gem::Requirement
@@ -47,9 +38,6 @@ dependencies:
47
38
  - - ">="
48
39
  - !ruby/object:Gem::Version
49
40
  version: 3.2.13
50
- - - "<"
51
- - !ruby/object:Gem::Version
52
- version: '7.2'
53
41
  - !ruby/object:Gem::Dependency
54
42
  name: google_business_api_url_signer
55
43
  requirement: !ruby/object:Gem::Requirement
@@ -64,90 +52,6 @@ dependencies:
64
52
  - - "~>"
65
53
  - !ruby/object:Gem::Version
66
54
  version: 0.1.3
67
- - !ruby/object:Gem::Dependency
68
- name: bundler
69
- requirement: !ruby/object:Gem::Requirement
70
- requirements:
71
- - - ">="
72
- - !ruby/object:Gem::Version
73
- version: '0'
74
- type: :development
75
- prerelease: false
76
- version_requirements: !ruby/object:Gem::Requirement
77
- requirements:
78
- - - ">="
79
- - !ruby/object:Gem::Version
80
- version: '0'
81
- - !ruby/object:Gem::Dependency
82
- name: rake
83
- requirement: !ruby/object:Gem::Requirement
84
- requirements:
85
- - - ">="
86
- - !ruby/object:Gem::Version
87
- version: '0'
88
- type: :development
89
- prerelease: false
90
- version_requirements: !ruby/object:Gem::Requirement
91
- requirements:
92
- - - ">="
93
- - !ruby/object:Gem::Version
94
- version: '0'
95
- - !ruby/object:Gem::Dependency
96
- name: rspec
97
- requirement: !ruby/object:Gem::Requirement
98
- requirements:
99
- - - "~>"
100
- - !ruby/object:Gem::Version
101
- version: 3.12.0
102
- type: :development
103
- prerelease: false
104
- version_requirements: !ruby/object:Gem::Requirement
105
- requirements:
106
- - - "~>"
107
- - !ruby/object:Gem::Version
108
- version: 3.12.0
109
- - !ruby/object:Gem::Dependency
110
- name: rubocop
111
- requirement: !ruby/object:Gem::Requirement
112
- requirements:
113
- - - "~>"
114
- - !ruby/object:Gem::Version
115
- version: 0.59.2
116
- type: :development
117
- prerelease: false
118
- version_requirements: !ruby/object:Gem::Requirement
119
- requirements:
120
- - - "~>"
121
- - !ruby/object:Gem::Version
122
- version: 0.59.2
123
- - !ruby/object:Gem::Dependency
124
- name: shoulda-matchers
125
- requirement: !ruby/object:Gem::Requirement
126
- requirements:
127
- - - "~>"
128
- - !ruby/object:Gem::Version
129
- version: 4.0.0.rc1
130
- type: :development
131
- prerelease: false
132
- version_requirements: !ruby/object:Gem::Requirement
133
- requirements:
134
- - - "~>"
135
- - !ruby/object:Gem::Version
136
- version: 4.0.0.rc1
137
- - !ruby/object:Gem::Dependency
138
- name: webmock
139
- requirement: !ruby/object:Gem::Requirement
140
- requirements:
141
- - - "~>"
142
- - !ruby/object:Gem::Version
143
- version: 3.4.2
144
- type: :development
145
- prerelease: false
146
- version_requirements: !ruby/object:Gem::Requirement
147
- requirements:
148
- - - "~>"
149
- - !ruby/object:Gem::Version
150
- version: 3.4.2
151
55
  description: Ruby client for The Google Distance Matrix API
152
56
  email:
153
57
  - thhermansen@gmail.com
@@ -156,6 +60,7 @@ extensions: []
156
60
  extra_rdoc_files: []
157
61
  files:
158
62
  - ".editorconfig"
63
+ - ".github/dependabot.yml"
159
64
  - ".github/workflows/ruby.yml"
160
65
  - ".gitignore"
161
66
  - ".rubocop.yml"
@@ -214,14 +119,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
214
119
  requirements:
215
120
  - - ">="
216
121
  - !ruby/object:Gem::Version
217
- version: '0'
122
+ version: '3.0'
218
123
  required_rubygems_version: !ruby/object:Gem::Requirement
219
124
  requirements:
220
125
  - - ">="
221
126
  - !ruby/object:Gem::Version
222
127
  version: '0'
223
128
  requirements: []
224
- rubygems_version: 3.4.10
129
+ rubygems_version: 3.5.11
225
130
  signing_key:
226
131
  specification_version: 4
227
132
  summary: Ruby client for The Google Distance Matrix API