cirro-ruby-client 2.5.17 → 2.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +5 -7
- data/lib/cirro_io/client/version.rb +1 -1
- data/lib/cirro_io_v2/client.rb +2 -1
- data/lib/cirro_io_v2/errors/client_error.rb +29 -0
- data/lib/cirro_io_v2/request_clients/base.rb +2 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3648839ab1f56e097e5808947ec9c89fc0b9d8761435f7d557a6134d6982122a
|
4
|
+
data.tar.gz: eeb647f8aed3277b5ac80ac42042841a7b86d568a509bd80fef2e031684b27b3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 713cd914e95f804ed04c98bca0ef97c2d0d92ec52ba71d9be8e006a790bbdbdff9a40600b382b0e6bf734c7889b50f52f3b78dc552e6c2e339a187628748d2bb
|
7
|
+
data.tar.gz: 7589640cb2517d06a0d209e0eda8e457e8edd8ab631814971cb3584e71d9d45413633dc23eaec93f15d97baa5997b7662a6d95a81816fa60f75db0d6893c7b00
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
cirro-ruby-client (2.
|
4
|
+
cirro-ruby-client (2.6.1)
|
5
5
|
activesupport
|
6
6
|
faraday (< 1.2.0)
|
7
7
|
faraday_middleware
|
@@ -11,11 +11,9 @@ PATH
|
|
11
11
|
GEM
|
12
12
|
remote: https://rubygems.org/
|
13
13
|
specs:
|
14
|
-
activemodel (7.
|
15
|
-
activesupport (= 7.
|
16
|
-
activesupport (7.
|
17
|
-
base64
|
18
|
-
bigdecimal
|
14
|
+
activemodel (7.0.6)
|
15
|
+
activesupport (= 7.0.6)
|
16
|
+
activesupport (7.0.6)
|
19
17
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
20
18
|
connection_pool (>= 2.2.5)
|
21
19
|
drb
|
@@ -54,7 +52,7 @@ GEM
|
|
54
52
|
rack (>= 0.2)
|
55
53
|
jwt (2.7.1)
|
56
54
|
method_source (1.0.0)
|
57
|
-
minitest (5.
|
55
|
+
minitest (5.19.0)
|
58
56
|
multipart-post (2.3.0)
|
59
57
|
mutex_m (0.1.2)
|
60
58
|
parallel (1.19.2)
|
data/lib/cirro_io_v2/client.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'cirro_io/client/version'
|
2
2
|
require 'cirro_io_v2/errors/http_error'
|
3
3
|
require 'cirro_io_v2/errors/response_not_json_error'
|
4
|
+
require 'cirro_io_v2/errors/client_error'
|
4
5
|
|
5
6
|
require 'cirro_io_v2/request_clients/base'
|
6
7
|
require 'cirro_io_v2/request_clients/jwt'
|
@@ -33,7 +34,7 @@ module CirroIOV2
|
|
33
34
|
attr_reader :options
|
34
35
|
|
35
36
|
DEFAULT_OPTIONS = {
|
36
|
-
site: 'https://
|
37
|
+
site: 'https://cirro.io/api',
|
37
38
|
api_version: 'v2',
|
38
39
|
auth_type: :jwt,
|
39
40
|
}.freeze
|
@@ -0,0 +1,29 @@
|
|
1
|
+
require 'forwardable'
|
2
|
+
|
3
|
+
module CirroIOV2
|
4
|
+
module Errors
|
5
|
+
class ClientError < StandardError
|
6
|
+
extend Forwardable
|
7
|
+
|
8
|
+
def_instance_delegators :@faraday_error, :response, :full_message
|
9
|
+
|
10
|
+
attr_reader :faraday_error
|
11
|
+
|
12
|
+
# this error class is intended to be used ONLY for 4xx errors
|
13
|
+
# https://www.rubydoc.info/github/lostisland/faraday/Faraday/ClientError
|
14
|
+
|
15
|
+
def initialize(faraday_error)
|
16
|
+
@faraday_error = faraday_error
|
17
|
+
end
|
18
|
+
|
19
|
+
def message
|
20
|
+
puts faraday_error.response.inspect
|
21
|
+
faraday_error.response.then do |response|
|
22
|
+
return response.inspect if ENV.fetch('DEBUG_CIRRO_RUBY_CLIENT', false)
|
23
|
+
|
24
|
+
faraday_error.response[:body].presence || faraday_error.try[:message]
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cirro-ruby-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cirro Dev Team
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-12-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -122,6 +122,7 @@ files:
|
|
122
122
|
- lib/cirro_io/client/version.rb
|
123
123
|
- lib/cirro_io/client/worker_filter.rb
|
124
124
|
- lib/cirro_io_v2/client.rb
|
125
|
+
- lib/cirro_io_v2/errors/client_error.rb
|
125
126
|
- lib/cirro_io_v2/errors/http_error.rb
|
126
127
|
- lib/cirro_io_v2/errors/response_not_json_error.rb
|
127
128
|
- lib/cirro_io_v2/request_clients/base.rb
|