incognia_api 3.2.0 → 4.0.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bce61afa0db25cd4c0e38bdc2a6fda87e6465b932dfd268240a8fa81da56b7f7
4
- data.tar.gz: de3df449038775fa70eb1cb2ca2a6d1bb0cf8ea91e149fab493b20295f3272dc
3
+ metadata.gz: d68f4d6839a251feef3d35c6549916f85b61722d3d884c0f01088c55ffdad522
4
+ data.tar.gz: 94ceea8dfb16ace08e710082e511b724eb46e615f747bebcdad53283d58ababd
5
5
  SHA512:
6
- metadata.gz: da2dc99070e25df33b7d204fecd1dbb788b60900082e784ac243549f41efa4204875b053f33752eacf254a94d8a31c491ca0e344408e386a47e33bb3eb6dfad3
7
- data.tar.gz: c0c79fc3da02882f950f3de3a694bbc34a66bdacc836a4138be0847ae6706a0364385e156e7fe300a41ca999108c4f233c50f57bde15ba7ebb051ff6ee73801d
6
+ metadata.gz: 2323ebadda00bfe03ce0d5fe15eb8bd8a504460a40170822c67f839c0785a942cb926fba49191236adfbbd7c88f60c7cc122372642fd8faf28d27459f65bff0b
7
+ data.tar.gz: 9c85a5715c2f295cd6072f41853fc3664f8624a575dbe78b0df09e333668ec9155d7b54b4a1599c6c6cb03f58b607effbdc8b2a0e2afa9b525329e42a9b6808b
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [4.0.0] - 2026-05-27
4
+ - Reuse TCP connection by default
5
+
3
6
  ## [3.2.0] - 2026-05-04
4
7
  - Add `county` support to structured addresses.
5
8
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- incognia_api (3.2.0)
4
+ incognia_api (4.0.0)
5
5
  faraday (~> 2.13)
6
6
  faraday-net_http_persistent (~> 2.3)
7
7
 
data/README.md CHANGED
@@ -45,19 +45,29 @@ Incognia.configure(
45
45
  )
46
46
  ```
47
47
 
48
- To reuse HTTP connections between requests, enable `keep_alive`. When enabled,
49
- `max_connections` sets the maximum number of concurrent persistent
50
- connections used by the client.
48
+ HTTP connection reuse is enabled by default. When connection reuse is enabled,
49
+ `max_connections` sets the maximum number of concurrent persistent connections
50
+ used by the client.
51
51
 
52
52
  ```ruby
53
53
  Incognia.configure(
54
54
  client_id: ENV['INCOGNIA_CLIENT_ID'],
55
55
  client_secret: ENV['INCOGNIA_CLIENT_SECRET'],
56
- keep_alive: true,
57
56
  max_connections: 5
58
57
  )
59
58
  ```
60
59
 
60
+ To disable persistent connections, set `keep_alive: false`. `max_connections`
61
+ can only be configured when `keep_alive` is enabled.
62
+
63
+ ```ruby
64
+ Incognia.configure(
65
+ client_id: ENV['INCOGNIA_CLIENT_ID'],
66
+ client_secret: ENV['INCOGNIA_CLIENT_SECRET'],
67
+ keep_alive: false
68
+ )
69
+ ```
70
+
61
71
  For sandbox credentials, refer to the [API testing guide](https://developer.incognia.com/).
62
72
 
63
73
  :bulb: For Rails applications it's recommended to create an initializer file, for example `config/initializers/incognia.rb`.
@@ -6,7 +6,7 @@ module Incognia
6
6
 
7
7
  attr_accessor :client_id, :client_secret, :host, :keep_alive, :max_connections
8
8
 
9
- def configure(client_id:, client_secret:, host: nil, keep_alive: false, max_connections: nil)
9
+ def configure(client_id:, client_secret:, host: nil, keep_alive: true, max_connections: nil)
10
10
  validate_connection_settings!(keep_alive: keep_alive, max_connections: max_connections)
11
11
 
12
12
  @client_id = client_id
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Incognia
4
- VERSION = "3.2.0"
4
+ VERSION = "4.0.0"
5
5
  end
data/lib/incognia_api.rb CHANGED
@@ -29,7 +29,9 @@ module Incognia
29
29
  class APIError < StandardError
30
30
  attr_reader :message, :errors, :status
31
31
 
32
- def initialize(message, response_info = {})
32
+ def initialize(message, response_info = nil)
33
+ response_info ||= {}
34
+
33
35
  @status = response_info[:status]
34
36
  @errors = response_info[:body]
35
37
  @message = format_message(message)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: incognia_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.0
4
+ version: 4.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Guilherme Cavalcanti
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-05-13 00:00:00.000000000 Z
11
+ date: 2026-05-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday