odeon_uk 5.0.0-x86_64-linux-gnu → 5.1.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: c4ad84f453bd9911cc64ce15f082a13c7a55d5873f0889231b2d6af0ab78e016
4
- data.tar.gz: da486b64502f139e58ac40903a58156d522aa3f1816ed2651ff7d29d1d261763
3
+ metadata.gz: 3393135e93707f7e38672d0bd3d25287c822e84e8d5264b54e80f6f2041eef83
4
+ data.tar.gz: deaf4a386a483d7257845ad5052421d46e7ec91e23166bcb6cff43e13396032a
5
5
  SHA512:
6
- metadata.gz: 9938b688d64ddaa017c00cf2eadf56b813a687c8dcf2bd6dba232b76b6dee84a1184148e1aabb991b59b1233d1a296dd6c9ee3ede3d02840687fec184fe34579
7
- data.tar.gz: ec83924eea649b7195e128d3036c71fffb0329d3f8f93fbe5a9d7a5d75b83b2ff005ab7aedc1bbbeb58aaf2ce2bf0283200f06a167d03614aa5c5904578a9e58
6
+ metadata.gz: 644aa5c3a8db2a08cf60984e71eda83c64f038cd9ab05aa243fccd56f2c83f6385a67411c64295604a0bbf6f9db70c86ac044dcef7884773a80b5c642ff9066a
7
+ data.tar.gz: 1d6e9657baf9f7daf53e96c48ebe2c2ad38088660b562bae38b322002a6973d039d72b4b8b91bff2c54977c5cba83ff514f2a2b0d3fff8679c2854acdae3db35
@@ -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: ODEON_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,19 @@
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
+ ## 5.1.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
+
10
+ ## 5.1.0 - 2026-10-22
11
+
12
+ ### Added
13
+ - `Performance#film_year`, read from a trailing `(1996)` in the title.
14
+
15
+ ### Changed
16
+ - Require cinebase 5.4. Film titles lose their year suffix, `(Re-release)` and Lithuanian markers, `+ ... Q&A` and `+ Discussion` add-ons, `(35mm)`, `(70mm)` and `4K` markers; `Horror Season` and `CFF:` prefixes become festivals.
17
+
5
18
  ## 5.0.0 - 2026-10-22
6
19
 
7
20
  ### Changed
data/README.md CHANGED
@@ -122,6 +122,9 @@ performance.dimension
122
122
  performance.variant
123
123
  #=> ['audio_described', 'imax']
124
124
 
125
+ performance.film_year
126
+ #=> 1996 # from the title, nil when it has no year
127
+
125
128
  performance.language
126
129
  #=> 'Korean' # audio language, nil when the cinema does not tag one
127
130
 
@@ -163,6 +166,13 @@ addresses in the shape of Vista responses, never recorded API output.
163
166
  checks the fixtures against it and the live suite checks real responses, held
164
167
  only in memory. When the API changes, update the shape first, then the fixtures.
165
168
 
169
+ ## Releasing
170
+
171
+ To release, bump the version, merge, then run the **Release Gem** workflow in
172
+ GitHub Actions. It builds the source and four platform gems, publishes them
173
+ through RubyGems trusted publishing (no MFA code needed) and tags the release.
174
+ Versions already on RubyGems are skipped, so a failed run can be rerun.
175
+
166
176
  ## Contributing
167
177
 
168
178
  1. Fork it
@@ -27,9 +27,15 @@ module OdeonUk
27
27
 
28
28
  private
29
29
 
30
+ # One client keeps one connection open, so reuse it until the token changes.
30
31
  def client
31
- Cinebase::Vista::Client.new(base_url: BASE_URL, region_code: REGION_CODE,
32
- token: OdeonUk.token)
32
+ token = OdeonUk.token
33
+ if @client.nil? || @client_token != token
34
+ @client_token = token
35
+ @client = Cinebase::Vista::Client.new(base_url: BASE_URL, region_code: REGION_CODE,
36
+ token: token)
37
+ end
38
+ @client
33
39
  end
34
40
  end
35
41
  end
@@ -40,6 +40,7 @@ module OdeonUk
40
40
  dimension: @data["requires3dGlasses"] ? "3d" : "2d",
41
41
  festival: Cinebase::Festival.from_title(title, year: starting_at.year),
42
42
  film_name: film_name,
43
+ film_year: Cinebase::TitleSanitizer.film_year(title),
43
44
  language: language,
44
45
  starting_at: starting_at,
45
46
  variant: variant
@@ -1,6 +1,6 @@
1
1
  # Ruby interface for https://www.odeon.co.uk
2
- # @version 5.0.0
2
+ # @version 5.1.1
3
3
  module OdeonUk
4
4
  # Gem version
5
- VERSION = '5.0.0'.freeze
5
+ VERSION = '5.1.1'.freeze
6
6
  end
data/odeon_uk.gemspec CHANGED
@@ -27,5 +27,5 @@ Gem::Specification.new do |spec|
27
27
  spec.add_development_dependency 'simplecov', '< 1'
28
28
  spec.add_development_dependency 'webmock'
29
29
 
30
- spec.add_runtime_dependency 'cinebase', '~> 5.2'
30
+ spec.add_runtime_dependency 'cinebase', '~> 5.5'
31
31
  end
@@ -48,7 +48,7 @@
48
48
  "films": [
49
49
  { "id": "FILM-1", "title": { "text": "The Example Film 3D" } },
50
50
  { "id": "FILM-2", "title": { "text": "Made Up Concert: Live" } },
51
- { "id": "FILM-3", "title": { "text": "Imaginary Picture (Tamil)" } },
51
+ { "id": "FILM-3", "title": { "text": "Imaginary Picture (2025) (Tamil)" } },
52
52
  { "id": "FILM-4", "title": { "text": "Pretend Pups" } }
53
53
  ],
54
54
  "attributes": [
@@ -58,8 +58,36 @@ class OdeonUk::Internal::ApiResponseTest < Minitest::Test
58
58
  assert_equal 'Vista HTTP error 500', error.message
59
59
  end
60
60
 
61
+ def test_reuses_one_client_while_the_token_holds
62
+ stub_request(:get, "#{BASE_URL}/sites").to_return(status: 200, body: sites_json)
63
+ shared = api
64
+
65
+ assert_equal 1, count_clients { 3.times { shared.sites } }
66
+ end
67
+
68
+ def test_builds_a_new_client_for_a_new_token
69
+ stub_request(:get, "#{BASE_URL}/sites").to_return(status: 200, body: sites_json)
70
+ shared = api
71
+
72
+ clients = count_clients do
73
+ shared.sites
74
+ OdeonUk.token = 'renewed-jwt'
75
+ shared.sites
76
+ end
77
+
78
+ assert_equal 2, clients
79
+ end
80
+
61
81
  private
62
82
 
83
+ def count_clients
84
+ clients = 0
85
+ original = Cinebase::Vista::Client.method(:new)
86
+ counting = ->(**options) { clients += 1; original.call(**options) }
87
+ Cinebase::Vista::Client.stub(:new, counting) { yield }
88
+ clients
89
+ end
90
+
63
91
  def api
64
92
  OdeonUk::Internal::ApiResponse.new
65
93
  end
@@ -3,7 +3,8 @@ require_relative '../../../../../test_helper'
3
3
  class OdeonUk::Internal::Parser::Api::ShowtimeTest < Minitest::Test
4
4
  FILMS = {
5
5
  'HO1' => { 'title' => { 'text' => 'Jailer 2 (Tamil)' } },
6
- 'HO2' => { 'title' => { 'text' => 'Cine-Excess 2026: Scum Of The Earth' } }
6
+ 'HO2' => { 'title' => { 'text' => 'Cine-Excess 2026: Scum Of The Earth' } },
7
+ 'HO3' => { 'title' => { 'text' => 'From Dusk Till Dawn (1996)' } }
7
8
  }.freeze
8
9
 
9
10
  ATTRIBUTES = {
@@ -20,6 +21,7 @@ class OdeonUk::Internal::Parser::Api::ShowtimeTest < Minitest::Test
20
21
  dimension: '2d',
21
22
  festival: nil,
22
23
  film_name: 'Jailer 2',
24
+ film_year: nil,
23
25
  language: nil,
24
26
  starting_at: Time.utc(2026, 10, 24, 17, 30),
25
27
  variant: []
@@ -47,6 +49,13 @@ class OdeonUk::Internal::Parser::Api::ShowtimeTest < Minitest::Test
47
49
  assert_equal 'Scum Of The Earth', showtime[:film_name]
48
50
  end
49
51
 
52
+ def test_film_year_moves_from_title_to_attribute
53
+ showtime = parse(film_id: 'HO3')
54
+
55
+ assert_equal 1996, showtime[:film_year]
56
+ assert_equal 'From Dusk Till Dawn', showtime[:film_name]
57
+ end
58
+
50
59
  def test_open_captions_and_subtitles_are_one_variant
51
60
  assert_equal %w(subtitled), parse(attribute_ids: %w(2 4))[:variant]
52
61
  end
@@ -49,6 +49,7 @@ class OdeonUk::PerformanceTest < Minitest::Test
49
49
  korean = performances[2]
50
50
 
51
51
  assert_equal 'Imaginary Picture', tamil.film_name
52
+ assert_equal 2025, tamil.film_year
52
53
  assert_equal 'Tamil', tamil.language
53
54
  assert tamil.subtitled?
54
55
  assert_equal 'Korean', korean.language
@@ -110,6 +111,10 @@ class OdeonUk::PerformanceTest < Minitest::Test
110
111
  assert_equal festival, performance.festival
111
112
  end
112
113
 
114
+ def test_film_year
115
+ assert_equal 1996, OdeonUk::Performance.new(options(film_year: 1996)).film_year
116
+ end
117
+
113
118
  def test_subtitled
114
119
  assert OdeonUk::Performance.new(options(variant: %w(subtitled))).subtitled?
115
120
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: odeon_uk
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.0
4
+ version: 5.1.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.2'
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.2'
123
+ version: '5.5'
124
124
  description: Pull movie & cinema information from the ODEON Vista API
125
125
  email:
126
126
  - andy@goodscary.com
@@ -128,6 +128,7 @@ executables: []
128
128
  extensions: []
129
129
  extra_rdoc_files: []
130
130
  files:
131
+ - ".github/workflows/release.yml"
131
132
  - ".github/workflows/test.yml"
132
133
  - ".gitignore"
133
134
  - ".ruby-version"