cineworld_uk 4.3.0 → 4.3.2
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 +4 -4
- data/.github/workflows/release.yml +73 -0
- data/CHANGELOG.md +10 -0
- data/README.md +6 -1
- data/cineworld_uk.gemspec +1 -1
- data/lib/cineworld_uk/internal/api_response.rb +11 -2
- data/lib/cineworld_uk/performance.rb +5 -1
- data/lib/cineworld_uk/version.rb +2 -2
- data/test/lib/cineworld_uk/internal/api_response_test.rb +39 -0
- data/test/support/vista_fixtures.rb +1 -0
- metadata +4 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e9b36bfd98b2897bc7794dafb17c958be5ce416ca6062da97d51f90cfd9d87c8
|
|
4
|
+
data.tar.gz: cc34427384559cb5f7392923a9df9d53a223fd339aa1d78ef900c1d776694c73
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 299579ed67952c0cca4f19dcf893779678cdc393cd49832c1f7f1d9d8c0fb0abedb2c1c6ee31e026de8142695a78344821379cf7d0081e0669a1f56ba48fdde7
|
|
7
|
+
data.tar.gz: 2917230374b9201b42d259991317174218e72ff971a026f13657508e47251e93f6ba54c3ba8b0f0c646896146adef347c86e13fbffde6190002c3931b7945063
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
name: Release Gem
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
|
|
6
|
+
jobs:
|
|
7
|
+
package:
|
|
8
|
+
strategy:
|
|
9
|
+
matrix:
|
|
10
|
+
include:
|
|
11
|
+
- runner: ubuntu-latest
|
|
12
|
+
platform: x86_64-linux-gnu
|
|
13
|
+
- runner: ubuntu-24.04-arm
|
|
14
|
+
platform: aarch64-linux-gnu
|
|
15
|
+
- runner: macos-15
|
|
16
|
+
platform: arm64-darwin
|
|
17
|
+
- runner: macos-15-intel
|
|
18
|
+
platform: x86_64-darwin
|
|
19
|
+
runs-on: ${{ matrix.runner }}
|
|
20
|
+
steps:
|
|
21
|
+
- uses: actions/checkout@v4
|
|
22
|
+
- uses: ruby/setup-ruby@v1
|
|
23
|
+
with:
|
|
24
|
+
ruby-version: '4.0'
|
|
25
|
+
bundler-cache: true
|
|
26
|
+
- run: bundle exec rake 'package:native[${{ matrix.platform }}]'
|
|
27
|
+
- run: CINEWORLD_PACKAGE="$(echo pkg/*.gem)" bundle exec ruby test/package_test.rb
|
|
28
|
+
- uses: actions/upload-artifact@v4
|
|
29
|
+
with:
|
|
30
|
+
name: gem-${{ matrix.platform }}
|
|
31
|
+
path: pkg/*.gem
|
|
32
|
+
|
|
33
|
+
release:
|
|
34
|
+
needs: package
|
|
35
|
+
runs-on: ubuntu-latest
|
|
36
|
+
permissions:
|
|
37
|
+
id-token: write
|
|
38
|
+
contents: write
|
|
39
|
+
steps:
|
|
40
|
+
- uses: actions/checkout@v4
|
|
41
|
+
- uses: ruby/setup-ruby@v1
|
|
42
|
+
with:
|
|
43
|
+
ruby-version: '4.0'
|
|
44
|
+
bundler-cache: true
|
|
45
|
+
- run: bundle exec rake test
|
|
46
|
+
- run: bundle exec rake build
|
|
47
|
+
- uses: actions/download-artifact@v4
|
|
48
|
+
with:
|
|
49
|
+
path: pkg
|
|
50
|
+
pattern: gem-*
|
|
51
|
+
merge-multiple: true
|
|
52
|
+
- uses: rubygems/configure-rubygems-credentials@v1.0.0
|
|
53
|
+
- name: Push the source and platform gems
|
|
54
|
+
run: |
|
|
55
|
+
for gem in pkg/*.gem; do
|
|
56
|
+
if output=$(gem push "$gem" 2>&1); then
|
|
57
|
+
echo "$output"
|
|
58
|
+
elif echo "$output" | grep -q "Repushing of gem versions is not allowed"; then
|
|
59
|
+
echo "Already published: $gem"
|
|
60
|
+
else
|
|
61
|
+
echo "$output"
|
|
62
|
+
exit 1
|
|
63
|
+
fi
|
|
64
|
+
done
|
|
65
|
+
- name: Tag the release
|
|
66
|
+
run: |
|
|
67
|
+
tag="v$(ruby -e 'print Gem::Specification.load(Dir["*.gemspec"].first).version')"
|
|
68
|
+
if git ls-remote --exit-code --tags origin "$tag" >/dev/null; then
|
|
69
|
+
echo "$tag already exists"
|
|
70
|
+
else
|
|
71
|
+
git tag "$tag"
|
|
72
|
+
git push origin "$tag"
|
|
73
|
+
fi
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,16 @@
|
|
|
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
|
+
## 4.3.2 - 2026-10-22
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
- Reuse one Vista client, and so one kept-alive connection, per thread instead of opening a TLS connection for every request. Requires cinebase 5.5. A cinema day now takes about 0.19s rather than 0.37s.
|
|
9
|
+
|
|
10
|
+
## 4.3.1 - 2026-10-22
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
- Publish the platform gems that bundle curl-impersonate. 4.3.0 shipped only the source gem. No code changes.
|
|
14
|
+
|
|
5
15
|
## 4.3.0 - 2026-10-22
|
|
6
16
|
|
|
7
17
|
### Added
|
data/README.md
CHANGED
|
@@ -229,7 +229,7 @@ To build and check just one platform on a matching host:
|
|
|
229
229
|
|
|
230
230
|
```sh
|
|
231
231
|
bundle exec rake 'package:native[x86_64-linux-gnu]'
|
|
232
|
-
CINEWORLD_PACKAGE=pkg/cineworld_uk-4.3.
|
|
232
|
+
CINEWORLD_PACKAGE=pkg/cineworld_uk-4.3.2-x86_64-linux-gnu.gem bundle exec ruby test/package_test.rb
|
|
233
233
|
```
|
|
234
234
|
|
|
235
235
|
Native packaging downloads pinned upstream archives at **build time**, verifies
|
|
@@ -239,6 +239,11 @@ and installation-tests each platform on its corresponding runner and saves the
|
|
|
239
239
|
gems as workflow artifacts; it does not publish them. Publish the source and
|
|
240
240
|
platform gems together for automatic platform selection to work for users.
|
|
241
241
|
|
|
242
|
+
To release, bump the version, merge, then run the **Release Gem** workflow in
|
|
243
|
+
GitHub Actions. It builds the source and four platform gems, publishes them
|
|
244
|
+
through RubyGems trusted publishing (no MFA code needed) and tags the release.
|
|
245
|
+
Versions already on RubyGems are skipped, so a failed run can be rerun.
|
|
246
|
+
|
|
242
247
|
## Contributing
|
|
243
248
|
|
|
244
249
|
1. Fork it
|
data/cineworld_uk.gemspec
CHANGED
|
@@ -25,6 +25,6 @@ Gem::Specification.new do |spec|
|
|
|
25
25
|
spec.add_development_dependency 'simplecov', '< 1'
|
|
26
26
|
spec.add_development_dependency 'webmock'
|
|
27
27
|
|
|
28
|
-
spec.add_runtime_dependency 'cinebase', '~> 5.
|
|
28
|
+
spec.add_runtime_dependency 'cinebase', '~> 5.5'
|
|
29
29
|
spec.add_runtime_dependency 'nokogiri', '>= 1.11'
|
|
30
30
|
end
|
|
@@ -86,8 +86,17 @@ module CineworldUk
|
|
|
86
86
|
private
|
|
87
87
|
|
|
88
88
|
def fetch(path, query = {})
|
|
89
|
-
|
|
90
|
-
|
|
89
|
+
client.get(path, query)
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
# One client keeps one connection open, so reuse it until the token changes.
|
|
93
|
+
def client
|
|
94
|
+
token = CineworldUk.token
|
|
95
|
+
if @client.nil? || @client_token != token
|
|
96
|
+
@client_token = token
|
|
97
|
+
@client = Cinebase::Vista::Client.new(base_url: BASE_URL, region_code: "GB", token: token)
|
|
98
|
+
end
|
|
99
|
+
@client
|
|
91
100
|
end
|
|
92
101
|
end
|
|
93
102
|
end
|
|
@@ -56,9 +56,13 @@ module CineworldUk
|
|
|
56
56
|
|
|
57
57
|
# private
|
|
58
58
|
|
|
59
|
+
API = :cineworld_uk_performance_api
|
|
60
|
+
|
|
59
61
|
# @api private
|
|
62
|
+
# One API, and so one kept-alive connection, per thread: job runners
|
|
63
|
+
# import several cinemas at once.
|
|
60
64
|
def self.api
|
|
61
|
-
|
|
65
|
+
Thread.current[API] ||= Internal::ApiResponse.new
|
|
62
66
|
end
|
|
63
67
|
private_class_method :api
|
|
64
68
|
|
data/lib/cineworld_uk/version.rb
CHANGED
|
@@ -14,6 +14,45 @@ class CineworldUk::Internal::ApiResponseTest < Minitest::Test
|
|
|
14
14
|
super
|
|
15
15
|
end
|
|
16
16
|
|
|
17
|
+
def test_reuses_one_client_while_the_token_holds
|
|
18
|
+
stub_request(:get, "#{BASE_URL}sites").to_return(body: '{"sites":[]}')
|
|
19
|
+
api = CineworldUk::Internal::ApiResponse.new
|
|
20
|
+
|
|
21
|
+
clients = count_clients { 3.times { api.cinema_list } }
|
|
22
|
+
|
|
23
|
+
assert_equal 1, clients
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def test_builds_a_new_client_for_a_new_token
|
|
27
|
+
stub_request(:get, "#{BASE_URL}sites").to_return(body: '{"sites":[]}')
|
|
28
|
+
api = CineworldUk::Internal::ApiResponse.new
|
|
29
|
+
|
|
30
|
+
clients = count_clients do
|
|
31
|
+
api.cinema_list
|
|
32
|
+
CineworldUk.token = "renewed-token"
|
|
33
|
+
api.cinema_list
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
assert_equal 2, clients
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def test_each_thread_has_its_own_performance_api
|
|
40
|
+
main = CineworldUk::Performance.send(:api)
|
|
41
|
+
|
|
42
|
+
other = Thread.new { CineworldUk::Performance.send(:api) }.value
|
|
43
|
+
|
|
44
|
+
assert_same main, CineworldUk::Performance.send(:api)
|
|
45
|
+
refute_same main, other
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
def count_clients
|
|
49
|
+
clients = 0
|
|
50
|
+
original = Cinebase::Vista::Client.method(:new)
|
|
51
|
+
counting = ->(**options) { clients += 1; original.call(**options) }
|
|
52
|
+
Cinebase::Vista::Client.stub(:new, counting) { yield }
|
|
53
|
+
clients
|
|
54
|
+
end
|
|
55
|
+
|
|
17
56
|
def test_rejects_missing_token
|
|
18
57
|
CineworldUk.token = nil
|
|
19
58
|
|
|
@@ -53,6 +53,7 @@ module Support
|
|
|
53
53
|
[CineworldUk::Cinema, CineworldUk::Performance].each do |klass|
|
|
54
54
|
klass.instance_variables.each { |name| klass.remove_instance_variable(name) }
|
|
55
55
|
end
|
|
56
|
+
Thread.current[CineworldUk::Performance::API] = nil if defined?(CineworldUk::Performance::API)
|
|
56
57
|
end
|
|
57
58
|
end
|
|
58
59
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: cineworld_uk
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 4.3.
|
|
4
|
+
version: 4.3.2
|
|
5
5
|
platform: ruby
|
|
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
|
- !ruby/object:Gem::Dependency
|
|
125
125
|
name: nokogiri
|
|
126
126
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -143,6 +143,7 @@ extensions: []
|
|
|
143
143
|
extra_rdoc_files: []
|
|
144
144
|
files:
|
|
145
145
|
- ".agents/setup"
|
|
146
|
+
- ".github/workflows/release.yml"
|
|
146
147
|
- ".github/workflows/test.yml"
|
|
147
148
|
- ".gitignore"
|
|
148
149
|
- ".ruby-version"
|