chartmogul-ruby 1.6.2 → 1.6.3

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: '08fe9cbc3ec7071bb35a489da5996c3a029ba6b78205fee4d824327951efa491'
4
- data.tar.gz: cd1f5597219b881df4a19619fae2de8daa599015bb8e65829c2d5b0ed5003f5a
3
+ metadata.gz: 83402594bbba60922432b2e9edc066b9400a97547a0b18d1540415f2f292fdc0
4
+ data.tar.gz: 7acfebd47ad66ccfa0786472c5c4e753383ce1510fe3eeee492139580d40533c
5
5
  SHA512:
6
- metadata.gz: ec8e502004838ba41f47c61caf5fef16315d10a90ccd1c9cd4d761382c3499225749cee94fbd582d0ad1e997f2ffaa24a9abb6b6e8751b1228cb69f88fed1992
7
- data.tar.gz: 5e21bf5afced99d731e23566306032875c21b5292807ca5ffc873e13abd3f7187d8a4cb77c375de7840a93f2d3d8ef114c8a8f94bc8fa47a5e34689b80e9d455
6
+ metadata.gz: 1605da872fc1b8b175c00bc5dd424f084d537e468cc621e4711e0267662d13c214fc4ade38e6eae7dfdefbe0c15cc393499034664a49260d53f1f7e357d15ef9
7
+ data.tar.gz: f87374a1d5107528f077c8b9ebf0d9f2904a4941727adf1479ebee008c0e4a99a80193beca74c372330dbdd65db93e6de8c4848f4b9dfd478c2cb653367a1c0c
@@ -5,22 +5,23 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
5
  require 'chartmogul/version'
6
6
 
7
7
  Gem::Specification.new do |spec|
8
- spec.name = 'chartmogul-ruby'
9
- spec.version = ChartMogul::VERSION
10
- spec.authors = ['Petr Kopac']
11
- spec.email = ['petr@chartmogul.com']
8
+ spec.name = 'chartmogul-ruby'
9
+ spec.version = ChartMogul::VERSION
10
+ spec.authors = ['Petr Kopac']
11
+ spec.email = ['petr@chartmogul.com']
12
12
 
13
- spec.summary = 'Chartmogul API Ruby Client'
14
- spec.description = 'Official Ruby client for ChartMogul\'s API'
15
- spec.homepage = 'https://github.com/chartmogul/chartmogul-ruby'
16
- spec.license = 'MIT'
13
+ spec.summary = 'Chartmogul API Ruby Client'
14
+ spec.description = 'Official Ruby client for ChartMogul\'s API'
15
+ spec.homepage = 'https://github.com/chartmogul/chartmogul-ruby'
16
+ spec.license = 'MIT'
17
+ spec.required_ruby_version = '>= 2.3'
17
18
 
18
- spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
19
- spec.bindir = 'exe'
20
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
21
- spec.require_paths = ['lib']
19
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
20
+ spec.bindir = 'exe'
21
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
22
+ spec.require_paths = ['lib']
22
23
 
23
- spec.add_dependency 'faraday', '~> 0.17.3'
24
+ spec.add_dependency 'faraday', '~> 1.0.0'
24
25
 
25
26
  spec.add_development_dependency 'bundler', '~> 2'
26
27
  spec.add_development_dependency 'pry', '~> 0.12.2'
@@ -73,11 +73,11 @@ require 'chartmogul/enrichment/customer'
73
73
  module ChartMogul
74
74
  API_BASE = 'https://api.chartmogul.com'
75
75
  MAX_RETRIES = 20
76
+ CONFIG_THREAD_KEY = 'chartmogul_ruby.config'
76
77
 
77
78
  class << self
78
79
  extend ConfigAttributes
79
80
 
80
- CONFIG_THREAD_KEY = 'chartmogul_ruby.config'
81
81
 
82
82
  def config
83
83
  Thread.current[CONFIG_THREAD_KEY] = ChartMogul::Configuration.new if Thread.current[CONFIG_THREAD_KEY].nil?
@@ -87,5 +87,6 @@ module ChartMogul
87
87
  config_accessor :account_token
88
88
  config_accessor :secret_key
89
89
  config_accessor :max_retries, MAX_RETRIES
90
+ config_accessor :api_base, API_BASE
90
91
  end
91
92
  end
@@ -37,7 +37,7 @@ module ChartMogul
37
37
 
38
38
  def self.handling_errors
39
39
  yield
40
- rescue Faraday::ClientError => e
40
+ rescue Faraday::ClientError, Faraday::ServerError => e
41
41
  e.response ? handle_request_error(e) : handle_other_error(e)
42
42
  rescue StandardError => e
43
43
  handle_other_error(e)
@@ -80,13 +80,13 @@ module ChartMogul
80
80
  private
81
81
 
82
82
  def self.build_connection
83
- Faraday.new(url: ChartMogul::API_BASE) do |faraday|
83
+ Faraday.new(url: ChartMogul.api_base) do |faraday|
84
84
  faraday.use Faraday::Request::BasicAuthentication, ChartMogul.account_token, ChartMogul.secret_key
85
85
  faraday.use Faraday::Response::RaiseError
86
86
  faraday.request :retry, max: ChartMogul.max_retries, retry_statuses: RETRY_STATUSES,
87
87
  max_interval: MAX_INTERVAL, backoff_factor: BACKOFF_FACTOR,
88
88
  interval_randomness: INTERVAL_RANDOMNESS, interval: INTERVAL, exceptions: RETRY_EXCEPTIONS
89
- faraday.use Faraday::Adapter::NetHttp
89
+ faraday.adapter Faraday::Adapter::NetHttp
90
90
  end
91
91
  end
92
92
  end
@@ -5,5 +5,6 @@ module ChartMogul
5
5
  attr_accessor :account_token
6
6
  attr_accessor :secret_key
7
7
  attr_accessor :max_retries
8
+ attr_accessor :api_base
8
9
  end
9
10
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ChartMogul
4
- VERSION = '1.6.2'
4
+ VERSION = '1.6.3'
5
5
  end
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: 1.6.2
4
+ version: 1.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Petr Kopac
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-07-24 00:00:00.000000000 Z
11
+ date: 2020-08-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.17.3
19
+ version: 1.0.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.17.3
26
+ version: 1.0.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -327,14 +327,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
327
327
  requirements:
328
328
  - - ">="
329
329
  - !ruby/object:Gem::Version
330
- version: '0'
330
+ version: '2.3'
331
331
  required_rubygems_version: !ruby/object:Gem::Requirement
332
332
  requirements:
333
333
  - - ">="
334
334
  - !ruby/object:Gem::Version
335
335
  version: '0'
336
336
  requirements: []
337
- rubygems_version: 3.0.8
337
+ rubygems_version: 3.1.4
338
338
  signing_key:
339
339
  specification_version: 4
340
340
  summary: Chartmogul API Ruby Client