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 +4 -4
- data/chartmogul-ruby.gemspec +14 -13
- data/lib/chartmogul.rb +2 -1
- data/lib/chartmogul/api_resource.rb +3 -3
- data/lib/chartmogul/configuration.rb +1 -0
- data/lib/chartmogul/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 83402594bbba60922432b2e9edc066b9400a97547a0b18d1540415f2f292fdc0
|
4
|
+
data.tar.gz: 7acfebd47ad66ccfa0786472c5c4e753383ce1510fe3eeee492139580d40533c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1605da872fc1b8b175c00bc5dd424f084d537e468cc621e4711e0267662d13c214fc4ade38e6eae7dfdefbe0c15cc393499034664a49260d53f1f7e357d15ef9
|
7
|
+
data.tar.gz: f87374a1d5107528f077c8b9ebf0d9f2904a4941727adf1479ebee008c0e4a99a80193beca74c372330dbdd65db93e6de8c4848f4b9dfd478c2cb653367a1c0c
|
data/chartmogul-ruby.gemspec
CHANGED
@@ -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
|
9
|
-
spec.version
|
10
|
-
spec.authors
|
11
|
-
spec.email
|
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
|
14
|
-
spec.description
|
15
|
-
spec.homepage
|
16
|
-
spec.license
|
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
|
19
|
-
spec.bindir
|
20
|
-
spec.executables
|
21
|
-
spec.require_paths
|
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.
|
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'
|
data/lib/chartmogul.rb
CHANGED
@@ -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
|
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.
|
89
|
+
faraday.adapter Faraday::Adapter::NetHttp
|
90
90
|
end
|
91
91
|
end
|
92
92
|
end
|
data/lib/chartmogul/version.rb
CHANGED
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.
|
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-
|
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.
|
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.
|
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: '
|
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.
|
337
|
+
rubygems_version: 3.1.4
|
338
338
|
signing_key:
|
339
339
|
specification_version: 4
|
340
340
|
summary: Chartmogul API Ruby Client
|