cin7_api 1.0.4 → 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/cin7_api/errors.rb +12 -0
- data/lib/cin7_api/resource.rb +2 -2
- data/lib/cin7_api/version.rb +1 -1
- data/lib/cin7_api.rb +6 -1
- metadata +3 -3
- data/lib/cin7_api/error.rb +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0553e1a9d4db6501e28ed87aa824a5e58ce79171917f04f7d3c9fb72cb35454e
|
4
|
+
data.tar.gz: d71205d4103dc6eecaaf6fa6b4b1465e8ff14e3e4b017edfa0d9daa24e7452d6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a19008caf61d33c068423f9aa656d5eba3348d2b262bdc044f7914a395385bf9465244a281b5173c0272170c556acb20ea287f24acd02bc48f2af6608424f476
|
7
|
+
data.tar.gz: 69a986ad34adda010c8075166e031ef3e1a56411d7e904498f2c4bee318fb0250b4fd36b77773b4c4f0cf6bdc5bdff5a8297c3f3d1ee9b877fed6c9ad674d2ba
|
data/Gemfile.lock
CHANGED
data/lib/cin7_api/resource.rb
CHANGED
@@ -35,9 +35,9 @@ module Cin7API
|
|
35
35
|
when 404
|
36
36
|
raise Error, "The resource you have specified cannot be found. #{error_message}"
|
37
37
|
when 429
|
38
|
-
raise
|
38
|
+
raise RateLimitError, "The API rate limit for your application has been exceeded. #{error_message}"
|
39
39
|
when 500
|
40
|
-
raise
|
40
|
+
raise ServerError,
|
41
41
|
"An unhandled error with the Cin7 API. Contact the Cin7 API team if problems persist. #{error_message}"
|
42
42
|
when 503
|
43
43
|
raise Error,
|
data/lib/cin7_api/version.rb
CHANGED
data/lib/cin7_api.rb
CHANGED
@@ -7,7 +7,12 @@ loader = Zeitwerk::Loader.for_gem
|
|
7
7
|
loader.inflector.inflect("cin7_api" => "Cin7API")
|
8
8
|
loader.collapse("#{__dir__}/cin7_api/objects")
|
9
9
|
loader.collapse("#{__dir__}/cin7_api/resources")
|
10
|
-
|
10
|
+
# Zeitwerk doesn't support multiple classes in a single file
|
11
|
+
# https://edgeguides.rubyonrails.org/upgrading_ruby_on_rails.html#one-file-one-constant-at-the-same-top-level
|
12
|
+
loader.ignore("#{__dir__}/cin7_api/errors.rb")
|
13
|
+
loader.setup
|
14
|
+
|
15
|
+
require "cin7_api/errors"
|
11
16
|
|
12
17
|
module Cin7API
|
13
18
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cin7_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Wei Zhe Heng
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-10-
|
11
|
+
date: 2022-10-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -113,7 +113,7 @@ files:
|
|
113
113
|
- Rakefile
|
114
114
|
- lib/cin7_api.rb
|
115
115
|
- lib/cin7_api/client.rb
|
116
|
-
- lib/cin7_api/
|
116
|
+
- lib/cin7_api/errors.rb
|
117
117
|
- lib/cin7_api/object.rb
|
118
118
|
- lib/cin7_api/objects/credit_note.rb
|
119
119
|
- lib/cin7_api/objects/payment.rb
|