knockapi 0.5.0 → 0.5.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/.github/workflows/ruby.yml +12 -17
- data/.ruby-version +1 -1
- data/.tool-versions +1 -1
- data/Gemfile.lock +1 -1
- data/lib/knock/client.rb +10 -0
- data/lib/knock/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a134ca1b8dfef66365a05c99f1eb70146f647d1df31978da691b81b09016d37e
|
|
4
|
+
data.tar.gz: ce602039743e58d61f5a926aec90996a95e6635343b148df247c914b33597cd4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 78a5c9740fd5fe6328ffaa1b8582dbf93221fc2775bdfc3471935c86de5bbb2fe1b9d80f2e7280c3a8bdb6bdc99cc59180a9e46ab77b6041673aae06ab3d43d7
|
|
7
|
+
data.tar.gz: 4dd3a4622d8d2cddd6b1b6b895740071603ffc613971e817bd58baa650602cc2c835664935d06500a768d83c00e8961b4eadbbf1e65b8cc91462b9c13d0fc7ee
|
data/.github/workflows/ruby.yml
CHANGED
|
@@ -9,42 +9,37 @@ name: Ruby
|
|
|
9
9
|
|
|
10
10
|
on:
|
|
11
11
|
push:
|
|
12
|
-
branches: [
|
|
12
|
+
branches: ["main"]
|
|
13
13
|
pull_request:
|
|
14
|
-
branches: [
|
|
14
|
+
branches: ["main"]
|
|
15
15
|
|
|
16
16
|
permissions:
|
|
17
17
|
contents: read
|
|
18
18
|
|
|
19
19
|
jobs:
|
|
20
20
|
test:
|
|
21
|
-
|
|
22
21
|
runs-on: ubuntu-latest
|
|
23
22
|
strategy:
|
|
24
23
|
matrix:
|
|
25
|
-
ruby-version: [
|
|
24
|
+
ruby-version: ["2.7", "3.0", "3.1", "3.2"]
|
|
26
25
|
|
|
27
26
|
steps:
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
|
37
|
-
- name: Run tests
|
|
38
|
-
run: bundle exec rspec spec
|
|
27
|
+
- uses: actions/checkout@v3
|
|
28
|
+
- name: Set up Ruby
|
|
29
|
+
uses: ruby/setup-ruby@v1
|
|
30
|
+
with:
|
|
31
|
+
ruby-version: ${{ matrix.ruby-version }}
|
|
32
|
+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
|
33
|
+
- name: Run tests
|
|
34
|
+
run: bundle exec rspec spec
|
|
39
35
|
|
|
40
36
|
lint:
|
|
41
|
-
|
|
42
37
|
runs-on: ubuntu-latest
|
|
43
38
|
steps:
|
|
44
39
|
- name: Checkout code
|
|
45
40
|
uses: actions/checkout@v3
|
|
46
41
|
- name: Install Ruby and gems
|
|
47
|
-
uses: ruby/setup-ruby@
|
|
42
|
+
uses: ruby/setup-ruby@v1
|
|
48
43
|
with:
|
|
49
44
|
bundler-cache: true
|
|
50
45
|
# Add or replace any other lints here
|
data/.ruby-version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
3.
|
|
1
|
+
3.2.5
|
data/.tool-versions
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
ruby 3.2.
|
|
1
|
+
ruby 3.2.5
|
data/Gemfile.lock
CHANGED
data/lib/knock/client.rb
CHANGED
|
@@ -82,6 +82,8 @@ module Knock
|
|
|
82
82
|
end
|
|
83
83
|
|
|
84
84
|
# rubocop:disable Metrics/AbcSize
|
|
85
|
+
# rubocop:disable Metrics/CyclomaticComplexity
|
|
86
|
+
# rubocop:disable Metrics/MethodLength
|
|
85
87
|
|
|
86
88
|
def handle_error_response(response:)
|
|
87
89
|
http_status = response.code.to_i
|
|
@@ -116,10 +118,18 @@ module Knock
|
|
|
116
118
|
http_status: http_status,
|
|
117
119
|
request_id: response['x-request-id']
|
|
118
120
|
)
|
|
121
|
+
when 429
|
|
122
|
+
raise APIError.new(
|
|
123
|
+
message: json['message'],
|
|
124
|
+
http_status: http_status,
|
|
125
|
+
request_id: response['x-request-id']
|
|
126
|
+
)
|
|
119
127
|
end
|
|
120
128
|
end
|
|
121
129
|
|
|
122
130
|
# rubocop:enable Metrics/AbcSize
|
|
131
|
+
# rubocop:enable Metrics/CyclomaticComplexity
|
|
132
|
+
# rubocop:enable Metrics/MethodLength
|
|
123
133
|
|
|
124
134
|
private
|
|
125
135
|
|
data/lib/knock/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: knockapi
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.5.
|
|
4
|
+
version: 0.5.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Knock Labs, Inc.
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2024-
|
|
11
|
+
date: 2024-07-29 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -109,7 +109,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
109
109
|
- !ruby/object:Gem::Version
|
|
110
110
|
version: '0'
|
|
111
111
|
requirements: []
|
|
112
|
-
rubygems_version: 3.5.
|
|
112
|
+
rubygems_version: 3.5.11
|
|
113
113
|
signing_key:
|
|
114
114
|
specification_version: 4
|
|
115
115
|
summary: API client for Knock
|