persona-ruby 0.1.4 → 0.2.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: 204ebc23f6ace3484b14d77d85e7954b09dadbfaf09a964ab69ebd201e2db6e7
4
- data.tar.gz: b38e4c03268977aa80aee498935699483812caba74abe2141174d9dabe724414
3
+ metadata.gz: 16bfc46d0c71df47185c13049ca23a3d9fa9194d5d5719340edea459a70c2cf5
4
+ data.tar.gz: 5420682dd2b17248deb47a6edb9ad1def8a6722d72fea2c846f274f809e67336
5
5
  SHA512:
6
- metadata.gz: 41c7a0334cde2cee4c732353c4e3a9b5dd8b416f7c0dafe18858ce51a67d549aa00f018d61e029fc750792014072c5d0fa7e0412f3548bbc5300d95d1e1d1b4b
7
- data.tar.gz: 299c50fa79a6565111e7d1612baa473ffa02bf22d510fdaa49b50be8bd1fa6c0b0aac6d2237b0274d8c20c180252e3cdfb53d37e2ebfd39fe1c6b99e326bb659
6
+ metadata.gz: df210c24e00bc3dc114f04d3ebb33f059a43224c9d65272c77e5e59ed92491b216e197698e54728e9656a1946a934c2e038373c5805584d1a60c9f95155e2e23
7
+ data.tar.gz: d457b0209bbf69e660a828f9d679eb272f311433594c5d172484c6af8ec727ff2aad69ae94ae8ceb60d6d568e408b1a200e58d53e76b106a8eb2551c7e191d78
data/README.md CHANGED
@@ -30,6 +30,7 @@ Then you can create a Persona API client.
30
30
  ```ruby
31
31
  client = Persona::Client.new(
32
32
  access_token: 'access_token', # Access token from authorization flow
33
+ timeout: 30, # Optional setting for timeouts of all requests (default 60)
33
34
  )
34
35
  ```
35
36
 
@@ -7,13 +7,14 @@ module Persona
7
7
 
8
8
  BASE_URL = "https://withpersona.com/api/v1"
9
9
 
10
- def initialize(access_token:)
10
+ def initialize(access_token:, timeout: 60)
11
11
  @access_token = "Bearer #{access_token}"
12
- @url = BASE_URL
12
+ @timeout = timeout
13
+ @url = BASE_URL
13
14
  end
14
15
 
15
16
  def connection
16
- Connection.new(@url, @access_token)
17
+ Connection.new(@url, @access_token, timeout: @timeout)
17
18
  end
18
19
  end
19
20
  end
@@ -4,12 +4,13 @@ require "faraday"
4
4
 
5
5
  module Persona
6
6
  class Connection
7
- def initialize(url, auth_token)
7
+ def initialize(url, auth_token, options = { timeout: 60 })
8
8
  @connection = Faraday.new(url:) do |builder|
9
9
  builder.request :json
10
10
  builder.headers[:accept] = "application/json"
11
11
  builder.response :json
12
12
  builder.request :authorization, auth_token, ""
13
+ builder.options.timeout = options[:timeout]
13
14
  end
14
15
  end
15
16
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Persona
4
- VERSION = "0.1.4"
4
+ VERSION = "0.2.0"
5
5
  end
metadata CHANGED
@@ -1,15 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: persona-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ravi Trivedi
8
8
  - Stephen Tredger
9
- autorequire:
10
9
  bindir: exe
11
10
  cert_chain: []
12
- date: 2025-01-08 00:00:00.000000000 Z
11
+ date: 2025-01-27 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: faraday
@@ -53,7 +52,6 @@ files:
53
52
  - lib/persona-ruby/connection.rb
54
53
  - lib/persona-ruby/error.rb
55
54
  - lib/persona-ruby/version.rb
56
- - persona-ruby-0.1.3.gem
57
55
  homepage: https://github.com/riipen/persona-ruby
58
56
  licenses:
59
57
  - MIT
@@ -61,7 +59,6 @@ metadata:
61
59
  homepage_uri: https://github.com/riipen/persona-ruby
62
60
  changelog_uri: https://github.com/riipen/persona-ruby/blob/master/CHANGELOG.md
63
61
  rubygems_mfa_required: 'true'
64
- post_install_message:
65
62
  rdoc_options: []
66
63
  require_paths:
67
64
  - lib
@@ -76,8 +73,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
76
73
  - !ruby/object:Gem::Version
77
74
  version: '0'
78
75
  requirements: []
79
- rubygems_version: 3.5.11
80
- signing_key:
76
+ rubygems_version: 3.6.3
81
77
  specification_version: 4
82
78
  summary: An API client for Persona in ruby.
83
79
  test_files: []
Binary file