chartmogul-ruby 3.3.1 → 4.0.0

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: 21d9a4cf92007310afc20b247902c00c7f8b9ff72af318b68f2ead99d684e883
4
- data.tar.gz: 21839b81aa52218acbc90283dd41da929bf5e3962c3beb14fc3002a8b7b80ed2
3
+ metadata.gz: 66ebd465c81aa14f0e68e406fd7a4b29137d3d019d6ceb4e1da1aaf1d40b0ef4
4
+ data.tar.gz: 7380c7be4a87d8d8822702eeed51d50dbf36fabbb727d4469239d023282c14eb
5
5
  SHA512:
6
- metadata.gz: 936baf5615aca48e08be7dca9d6cee0af52742ee4514d8a17300891cd192f857c99be4e12809932b808e2e2c2c7ed1116b577f6d5968a94e1ce1782555e42465
7
- data.tar.gz: f27864dd15a8ab31d0faa8ccf9dd66b04a45da59d703b523437b84b632677b7396f6d23b1266629754452df12116c761e95139df3c33e2df68d005a06c136a01
6
+ metadata.gz: 20c35e5c04d023dce1487916c10a543afe6773c2781ffe10b324045e9c6cad1c7e9b7521d16007fae4ce7345c1f34d06dfd40ed98dd8941ead4f435728ffda06
7
+ data.tar.gz: fd0be8d9cee2c624e945f33f55effcea1825d7f72913f0d765b97e70084a1ba3fc0561ad0b922f4691e3b2daa3a70a82b87b8d7b44ec72bb69a107e528bfb332
@@ -9,7 +9,7 @@ jobs:
9
9
  runs-on: ubuntu-latest
10
10
  strategy:
11
11
  matrix:
12
- ruby-version: [2.6, 2.7, 3.0, 3.1, 3.2]
12
+ ruby-version: [2.7, 3.0, 3.1, 3.2]
13
13
  steps:
14
14
  - uses: actions/checkout@v2
15
15
  - name: Set up Ruby ${{ matrix.ruby-version }}
data/README.md CHANGED
@@ -47,7 +47,7 @@ Or install it yourself as:
47
47
  $ gem install chartmogul-ruby
48
48
 
49
49
  ### Supported Ruby Versions
50
- This gem supports Ruby 2.3 and above.
50
+ This gem supports Ruby 2.7 and above.
51
51
 
52
52
  ## Configuration
53
53
 
data/changelog.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # chartmogul-ruby Change Log
2
2
 
3
+ ## Version 4.0.0 - November 1 2023
4
+ - Remove support for old pagination using `page` parameter.
5
+ - Drop support for Ruby versions below 2.7.
6
+
3
7
  ## Version 3.3.1 - October 27 2023
4
8
  - Add support for cursor based pagination to `.all` endpoints.
5
9
  - Add `.next` pagination method for all supported cursor based endpoints.
@@ -14,7 +14,7 @@ Gem::Specification.new do |spec|
14
14
  spec.description = 'Official Ruby client for ChartMogul\'s API'
15
15
  spec.homepage = 'https://github.com/chartmogul/chartmogul-ruby'
16
16
  spec.license = 'MIT'
17
- spec.required_ruby_version = '>= 2.3'
17
+ spec.required_ruby_version = '>= 2.7'
18
18
 
19
19
  spec.post_install_message = %q{
20
20
  Starting October 29 2021, we are updating our developer libraries to support the enhanced API Access Management. Please use the same API Key for both API Token and Secret Key.
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ChartMogul
4
+ class DeprecatedParameterError < ChartMogulError
5
+ end
6
+ end
@@ -9,6 +9,8 @@ module ChartMogul
9
9
 
10
10
  class RequiredParameterMissing < StandardError; end
11
11
 
12
+ DEPRECATED_PARAMETER = 'page'
13
+
12
14
  def initialize(path)
13
15
  @path = path
14
16
  @named_params = path.scan(/:\w+/).each_with_object({}) do |named_param, hash|
@@ -22,7 +24,6 @@ module ChartMogul
22
24
 
23
25
  # For path = '/hello/:hello_id/say' & params = { hello_id: 1, search: 'cat' }
24
26
  # it will return '/hello/1/say?search=cat'
25
-
26
27
  def apply_with_get_params(params = {})
27
28
  base_path = apply_named_params(params)
28
29
  get_params = params.reject { |param_name| named_params.values.include?(param_name) }
@@ -33,6 +34,10 @@ module ChartMogul
33
34
  private
34
35
 
35
36
  def apply_named_params(params)
37
+ if params.keys.map(&:to_s).include?(DEPRECATED_PARAMETER)
38
+ raise(ChartMogul::DeprecatedParameterError, "#{DEPRECATED_PARAMETER} is deprecated.")
39
+ end
40
+
36
41
  path.dup.tap do |path|
37
42
  named_params.each do |named_param, param_key|
38
43
  unless params.key?(param_key)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ChartMogul
4
- VERSION = '3.3.1'
4
+ VERSION = '4.0.0'
5
5
  end
data/lib/chartmogul.rb CHANGED
@@ -18,6 +18,7 @@ require 'chartmogul/errors/resource_invalid_error'
18
18
  require 'chartmogul/errors/schema_invalid_error'
19
19
  require 'chartmogul/errors/server_error'
20
20
  require 'chartmogul/errors/unauthorized_error'
21
+ require 'chartmogul/errors/deprecated_parameter_error'
21
22
 
22
23
  require 'chartmogul/config_attributes'
23
24
  require 'chartmogul/configuration'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chartmogul-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.1
4
+ version: 4.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Petr Kopac
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-10-30 00:00:00.000000000 Z
11
+ date: 2023-11-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -223,6 +223,7 @@ files:
223
223
  - lib/chartmogul/enrichment/customer.rb
224
224
  - lib/chartmogul/errors/chartmogul_error.rb
225
225
  - lib/chartmogul/errors/configuration_error.rb
226
+ - lib/chartmogul/errors/deprecated_parameter_error.rb
226
227
  - lib/chartmogul/errors/forbidden_error.rb
227
228
  - lib/chartmogul/errors/not_found_error.rb
228
229
  - lib/chartmogul/errors/resource_invalid_error.rb
@@ -279,7 +280,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
279
280
  requirements:
280
281
  - - ">="
281
282
  - !ruby/object:Gem::Version
282
- version: '2.3'
283
+ version: '2.7'
283
284
  required_rubygems_version: !ruby/object:Gem::Requirement
284
285
  requirements:
285
286
  - - ">="