action_network_rest 0.11.0 → 1.0.0

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: 60ec6a3895471c7d3a0f2a45076fc79e085a215ab5615be1db0f665ad6503106
4
- data.tar.gz: 940276b2e72e63794de66a46d06c549126a446de28f79dc8a8ba5440fd7d4657
3
+ metadata.gz: e65f3bb81f2d96f6387f07f7eb28ac79cc851c5552ef2f8c8925bec3ae44c192
4
+ data.tar.gz: a49f69fe3f7c43e5f7eb5102529943a4dca20c1a69b22baa8c916829a4b85c78
5
5
  SHA512:
6
- metadata.gz: 13a5c4e166e1d6a83c637a7ff70ef0bec3e105d647bf484fd35bd296b11787812fcf6cb7a2d73ad55a60aea7adba1ebb3083170208db3c8132aa94890982f5ba
7
- data.tar.gz: 6436d185b7311fd1dae2c9663f178886a0d1cc9ab5a5fcf956ff001acc1154e5e8ecc0cf978dc441470effc00ce4c01bb919185929036a7dcf7fc93aba041fce
6
+ metadata.gz: 2562c647add336113f29e9ab423484c46db0a4e678d7b665d7b556229aa206af28cb652eedde6278b3f4b6cebd908fe17b3af3c41673cba8c3c3cfd6d120980b
7
+ data.tar.gz: f1c8324c8cbe351074c43c7c8ea0de6e30de049c73abe3afbecd9b77b8b2865b684a11d7232e0a8f9f10c8df4d2cc6cbcd2712b8a2a8ad2061a9340d5aeb76e7
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.1.2
1
+ 3.2.2
@@ -23,10 +23,10 @@ Gem::Specification.new do |spec|
23
23
 
24
24
  spec.required_ruby_version = '>= 2.6'
25
25
 
26
- spec.add_runtime_dependency 'vertebrae', '~> 0.6.0'
26
+ spec.add_runtime_dependency 'vertebrae', '>= 1.0.0'
27
27
 
28
28
  spec.add_development_dependency 'bundler', '~> 2.1'
29
- spec.add_development_dependency 'byebug', '~> 11.1'
29
+ spec.add_development_dependency 'debug'
30
30
  spec.add_development_dependency 'dotenv', '~> 2.7'
31
31
  spec.add_development_dependency 'rake', '~> 13.0'
32
32
  spec.add_development_dependency 'rspec', '~> 3.0'
@@ -3,17 +3,15 @@
3
3
  module ActionNetworkRest
4
4
  class API < Vertebrae::API
5
5
  def setup
6
- connection.stack do |builder|
7
- builder.use Faraday::Request::Multipart
8
- builder.use Faraday::Request::UrlEncoded
6
+ connection.faraday_connection = Faraday.new(connection.configuration.faraday_options) do |f|
7
+ f.request :multipart
8
+ f.request :url_encoded
9
9
 
10
- builder.use Faraday::Response::Logger if ENV['DEBUG']
10
+ f.response :mashify
11
+ f.response :json
11
12
 
12
- builder.use FaradayMiddleware::Mashify
13
- builder.use FaradayMiddleware::ParseJson
14
-
15
- builder.use ActionNetworkRest::Response::RaiseError
16
- builder.adapter connection.configuration.adapter
13
+ f.response :actionnetwork_raise_error
14
+ f.adapter connection.configuration.adapter
17
15
  end
18
16
  end
19
17
  end
@@ -28,7 +28,7 @@ module ActionNetworkRest
28
28
  wait = min_wait * (1.5**tries)
29
29
  new_time = Time.now.to_r
30
30
  if (timestamp + min_wait - new_time).positive?
31
- sleep(wait) # Wait if calling again could excede the rate limit
31
+ sleep(wait) # Wait if calling again could exceed the rate limit
32
32
  tries += 1
33
33
  next # check again
34
34
  end
@@ -46,7 +46,7 @@ module ActionNetworkRest
46
46
  end
47
47
 
48
48
  sleep(wait)
49
- tries += 1 # Exponential back off if got Too Many Requests error reponse
49
+ tries += 1 # Exponential back off if got Too Many Requests error response
50
50
  next
51
51
  end
52
52
  timestamp = Time.now.to_r
@@ -2,7 +2,7 @@
2
2
 
3
3
  module ActionNetworkRest
4
4
  module Response
5
- class RaiseError < Faraday::Response::Middleware
5
+ class RaiseError < Faraday::Middleware
6
6
  # rubocop:disable Style/GuardClause
7
7
  def on_complete(response)
8
8
  status_code = response[:status].to_i
@@ -44,3 +44,5 @@ module ActionNetworkRest
44
44
  class UsedAllRequestTries < StandardError; end
45
45
  end
46
46
  end
47
+
48
+ Faraday::Response.register_middleware actionnetwork_raise_error: -> { ActionNetworkRest::Response::RaiseError }
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ActionNetworkRest
4
- VERSION = '0.11.0'
4
+ VERSION = '1.0.0'
5
5
  end
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: action_network_rest
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Grey Moore
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-09-26 00:00:00.000000000 Z
11
+ date: 2023-05-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: vertebrae
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 0.6.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.6.0
26
+ version: 1.0.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -39,19 +39,19 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: '2.1'
41
41
  - !ruby/object:Gem::Dependency
42
- name: byebug
42
+ name: debug
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: '11.1'
47
+ version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: '11.1'
54
+ version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: dotenv
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -136,7 +136,7 @@ dependencies:
136
136
  - - "~>"
137
137
  - !ruby/object:Gem::Version
138
138
  version: 3.8.3
139
- description:
139
+ description:
140
140
  email:
141
141
  - grey@controlshiftlabs.com
142
142
  executables: []
@@ -182,7 +182,7 @@ licenses:
182
182
  - MIT
183
183
  metadata:
184
184
  rubygems_mfa_required: 'true'
185
- post_install_message:
185
+ post_install_message:
186
186
  rdoc_options: []
187
187
  require_paths:
188
188
  - lib
@@ -197,8 +197,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
197
197
  - !ruby/object:Gem::Version
198
198
  version: '0'
199
199
  requirements: []
200
- rubygems_version: 3.3.19
201
- signing_key:
200
+ rubygems_version: 3.4.10
201
+ signing_key:
202
202
  specification_version: 4
203
203
  summary: Ruby client for interacting with the ActionNetwork REST API
204
204
  test_files: []