picturehouse_uk 6.0.0-x86_64-linux-gnu → 6.0.1-x86_64-linux-gnu
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: fac24a15e6d610e273d5e6e5b07f5ca7105cb41a3f17ce3efd010f35e67116ed
|
|
4
|
+
data.tar.gz: fe58044d6693d6a462a150f334966b03240ed423566b652daef5839bdb50f8ce
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3226a90addbc189b3ede1d137379e0c90a945f05d939253eb40732f62d0fd5a5fcd337b9e980ffbdbacabb4df2f6184b4a40326b49f04709853681df7e7b74d3
|
|
7
|
+
data.tar.gz: 8790b89ab6d0c8ad891df56f4ad45c240a817b4ceb2dccc8650665e172179112e22ee552b8cf895e30f9927158423c12a2f2874ec92a6f6fb37e9ddd818c7219
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
All notable changes to this project will be documented in this file.
|
|
3
3
|
This project adheres to [Semantic Versioning](http://semver.org/).
|
|
4
4
|
|
|
5
|
+
## [6.0.1] - 2026-10-22
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
- Reuse one Vista client, and so one kept-alive connection, for all requests until the token changes, instead of opening a TLS connection for every request. Requires cinebase 5.5.
|
|
9
|
+
|
|
5
10
|
## [6.0.0] - 2026-10-22
|
|
6
11
|
|
|
7
12
|
### Changed
|
|
@@ -25,10 +25,17 @@ module PicturehouseUk
|
|
|
25
25
|
|
|
26
26
|
private
|
|
27
27
|
|
|
28
|
-
#
|
|
28
|
+
# One client keeps one connection open, so reuse it until the token
|
|
29
|
+
# changes. Picturehouse's API rejects every Connect-Region-Code, so
|
|
30
|
+
# send none.
|
|
29
31
|
def client
|
|
30
|
-
|
|
31
|
-
|
|
32
|
+
token = PicturehouseUk.token
|
|
33
|
+
if @client.nil? || @client_token != token
|
|
34
|
+
@client_token = token
|
|
35
|
+
@client = Cinebase::Vista::Client.new(base_url: BASE_URL, region_code: nil,
|
|
36
|
+
token: token)
|
|
37
|
+
end
|
|
38
|
+
@client
|
|
32
39
|
end
|
|
33
40
|
end
|
|
34
41
|
end
|
data/picturehouse_uk.gemspec
CHANGED
|
@@ -44,8 +44,36 @@ class PicturehouseUk::Internal::ApiResponseTest < Minitest::Test
|
|
|
44
44
|
assert_raises(PicturehouseUk::AuthenticationError) { api.sites }
|
|
45
45
|
end
|
|
46
46
|
|
|
47
|
+
def test_reuses_one_client_while_the_token_holds
|
|
48
|
+
stub_request(:get, "#{BASE_URL}/sites").to_return(status: 200, body: sites_json)
|
|
49
|
+
shared = api
|
|
50
|
+
|
|
51
|
+
assert_equal 1, count_clients { 3.times { shared.sites } }
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
def test_builds_a_new_client_for_a_new_token
|
|
55
|
+
stub_request(:get, "#{BASE_URL}/sites").to_return(status: 200, body: sites_json)
|
|
56
|
+
shared = api
|
|
57
|
+
|
|
58
|
+
clients = count_clients do
|
|
59
|
+
shared.sites
|
|
60
|
+
PicturehouseUk.token = 'renewed-jwt'
|
|
61
|
+
shared.sites
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
assert_equal 2, clients
|
|
65
|
+
end
|
|
66
|
+
|
|
47
67
|
private
|
|
48
68
|
|
|
69
|
+
def count_clients
|
|
70
|
+
clients = 0
|
|
71
|
+
original = Cinebase::Vista::Client.method(:new)
|
|
72
|
+
counting = ->(**options) { clients += 1; original.call(**options) }
|
|
73
|
+
Cinebase::Vista::Client.stub(:new, counting) { yield }
|
|
74
|
+
clients
|
|
75
|
+
end
|
|
76
|
+
|
|
49
77
|
def api
|
|
50
78
|
PicturehouseUk::Internal::ApiResponse.new
|
|
51
79
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: picturehouse_uk
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 6.0.
|
|
4
|
+
version: 6.0.1
|
|
5
5
|
platform: x86_64-linux-gnu
|
|
6
6
|
authors:
|
|
7
7
|
- Andy Croll
|
|
@@ -113,14 +113,14 @@ dependencies:
|
|
|
113
113
|
requirements:
|
|
114
114
|
- - "~>"
|
|
115
115
|
- !ruby/object:Gem::Version
|
|
116
|
-
version: '5.
|
|
116
|
+
version: '5.5'
|
|
117
117
|
type: :runtime
|
|
118
118
|
prerelease: false
|
|
119
119
|
version_requirements: !ruby/object:Gem::Requirement
|
|
120
120
|
requirements:
|
|
121
121
|
- - "~>"
|
|
122
122
|
- !ruby/object:Gem::Version
|
|
123
|
-
version: '5.
|
|
123
|
+
version: '5.5'
|
|
124
124
|
description: Pull movie & cinema information from the Picturehouse Vista API
|
|
125
125
|
email:
|
|
126
126
|
- andy@goodscary.com
|