berkeley_library-location 4.0.0 → 4.1.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: dcdd92dafd937a6dabe9cf2104e84311ae590d2db023b80c9c6fb06d0a1f3b40
4
- data.tar.gz: fc15382505d0611b660cdca1e5575b780ca00a0a13cb65cf5dec1d3c2a07a501
3
+ metadata.gz: 38e532bc61a09117863f2ac3583ec26735685d03b9a22ece2cc55a32490cc31e
4
+ data.tar.gz: 3cdec6c95056bdc388716b4153d46a6ea1e7dfd529fe18dc9660de32068bb55b
5
5
  SHA512:
6
- metadata.gz: e7f912cc954ceaf098cd7711cffc6016c0cfa945d7b63eb46e1a6c546d321962df4e76abb8e21ee8d57153590cacc7996f4d6ad4a90ae2f40fe91b46467b2e98
7
- data.tar.gz: b8096c7cdc373ac6d79f0b966c2cfce33c959cc562c8b0d002ee1265ba6c0fb38eda81fb46ef8fff9accf6e033cef5b1b7e952bc96926b06eb3198235452d540
6
+ metadata.gz: 1883e646eab5646d0dcde57e88477d758b52939ab2b0f0033e7aecf1184c7a342ac0c339060cd2ead515ccdcd7005d84df6f6700cb0095955e4d817c9ca28fe7
7
+ data.tar.gz: fb64c8aa2204c0a60d36ae504d96c5e2e946e71517d4b9e11584f48f91b0bc3339dcece2e4f906145c866a124fe260117ba1849a87244eccb89bf3f7401aeed3
data/CHANGES.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 4.1.0 (2025-01-10)
2
+
3
+ - Fixed token refresh function and test
4
+
1
5
  # 4.0.0 (2025-01-08)
2
6
 
3
7
  - Update from Worldcat API v1 to API v2
@@ -7,7 +7,7 @@ module BerkeleyLibrary
7
7
  SUMMARY = 'Locaton-related utilities for the UC Berkeley Library'.freeze
8
8
  DESCRIPTION = 'A collection of location-related utilities for the UC Berkeley Library'.freeze
9
9
  LICENSE = 'MIT'.freeze
10
- VERSION = '4.0.0'.freeze
10
+ VERSION = '4.1.0'.freeze
11
11
  HOMEPAGE = 'https://github.com/BerkeleyLibrary/location'.freeze
12
12
  end
13
13
  end
@@ -10,6 +10,7 @@ module BerkeleyLibrary
10
10
  attr_accessor :token
11
11
 
12
12
  def initialize
13
+ # Sorry Rubocop - needs to be ||= because we're dealing with a singleton
13
14
  # rubocop:disable Lint/DisjunctiveAssignmentInConstructor
14
15
  @token ||= fetch_token
15
16
  # rubocop:enable Lint/DisjunctiveAssignmentInConstructor:
@@ -29,18 +30,13 @@ module BerkeleyLibrary
29
30
  JSON.parse(response.body, symbolize_names: true)
30
31
  end
31
32
 
32
- # def token
33
- # @token = get_token if token_expired?
34
- # @token
35
- # end
36
-
37
33
  def oclc_token_url
38
34
  URI.parse("#{Config.token_uri}?#{URI.encode_www_form(token_params)}")
39
35
  end
40
36
 
41
37
  # Before every request check if the token is expired (OCLC tokens expire after 20 minutes)
42
38
  def access_token
43
- @token = token if token_expired?
39
+ @token = fetch_token if token_expired?
44
40
  @token[:access_token]
45
41
  end
46
42
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: berkeley_library-location
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0
4
+ version: 4.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - UC Berkeley Library IT
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-01-09 00:00:00.000000000 Z
11
+ date: 2025-01-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: berkeley_library-logging