knockapi 0.5.0 → 0.5.1

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: d2393f1d0c19c88f4969519059063b0b71a4f5a936f40abb6e7521e519830e1b
4
- data.tar.gz: 2f6f91ec95d57f8dd8c52c74bbd6506d4d978626ff17f4d77c0bb4acfabff6d2
3
+ metadata.gz: a134ca1b8dfef66365a05c99f1eb70146f647d1df31978da691b81b09016d37e
4
+ data.tar.gz: ce602039743e58d61f5a926aec90996a95e6635343b148df247c914b33597cd4
5
5
  SHA512:
6
- metadata.gz: 3348c75410ed7a5b26522243eb7a41a54aec41e1750d9afe5f401ba34efb4284b3fd16f6ad7b42195ef08da98d2b04a9df6eae28b9ac118b81fb89dba28feeba
7
- data.tar.gz: c0b60143532820fa86dbca11bb81b3f030253158edd5dd998198d11235a6fe2c3f8cbf3106ad56f7064a1741822037a0b2f9a448dcaa05684abafecb76d2d6c3
6
+ metadata.gz: 78a5c9740fd5fe6328ffaa1b8582dbf93221fc2775bdfc3471935c86de5bbb2fe1b9d80f2e7280c3a8bdb6bdc99cc59180a9e46ab77b6041673aae06ab3d43d7
7
+ data.tar.gz: 4dd3a4622d8d2cddd6b1b6b895740071603ffc613971e817bd58baa650602cc2c835664935d06500a768d83c00e8961b4eadbbf1e65b8cc91462b9c13d0fc7ee
@@ -9,42 +9,37 @@ name: Ruby
9
9
 
10
10
  on:
11
11
  push:
12
- branches: [ "main" ]
12
+ branches: ["main"]
13
13
  pull_request:
14
- branches: [ "main" ]
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: ['2.6', '2.7', '3.0']
24
+ ruby-version: ["2.7", "3.0", "3.1", "3.2"]
26
25
 
27
26
  steps:
28
- - uses: actions/checkout@v3
29
- - name: Set up Ruby
30
- # To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
31
- # change this to (see https://github.com/ruby/setup-ruby#versioning):
32
- # uses: ruby/setup-ruby@v1
33
- uses: ruby/setup-ruby@2b019609e2b0f1ea1a2bc8ca11cb82ab46ada124
34
- with:
35
- ruby-version: ${{ matrix.ruby-version }}
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@8f312efe1262fb463d906e9bf040319394c18d3e # v1.92
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.0.2
1
+ 3.2.5
data/.tool-versions CHANGED
@@ -1 +1 @@
1
- ruby 3.2.2
1
+ ruby 3.2.5
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- knockapi (0.5.0)
4
+ knockapi (0.5.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Knock
4
- VERSION = '0.5.0'
4
+ VERSION = '0.5.1'
5
5
  end
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.0
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-05-22 00:00:00.000000000 Z
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.9
112
+ rubygems_version: 3.5.11
113
113
  signing_key:
114
114
  specification_version: 4
115
115
  summary: API client for Knock