picturehouse_uk 4.0.0 → 5.0.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 +5 -5
- data/.github/workflows/ci.yml +26 -0
- data/.github/workflows/release.yml +26 -0
- data/.gitignore +1 -0
- data/.ruby-version +1 -0
- data/CHANGELOG.md +25 -0
- data/Rakefile +2 -2
- data/lib/picturehouse_uk/cinema.rb +30 -14
- data/lib/picturehouse_uk/internal/api.rb +42 -0
- data/lib/picturehouse_uk/internal/parser/address.rb +21 -6
- data/lib/picturehouse_uk/internal/parser/screenings.rb +85 -133
- data/lib/picturehouse_uk/internal/website.rb +10 -12
- data/lib/picturehouse_uk/version.rb +2 -2
- data/lib/picturehouse_uk.rb +1 -0
- data/picturehouse_uk.gemspec +2 -3
- data/rake/fixture_creator.rb +21 -1
- data/test/fixtures/cinemas.html +4262 -0
- data/test/fixtures/duke-of-york-s-picturehouse/cinema.html +6187 -0
- data/test/fixtures/duke-of-york-s-picturehouse/get_movies.json +120552 -0
- data/test/fixtures/duke-of-york-s-picturehouse/information.html +3725 -0
- data/test/fixtures/duke-s-at-komedia/cinema.html +6138 -0
- data/test/fixtures/duke-s-at-komedia/get_movies.json +112 -0
- data/test/fixtures/duke-s-at-komedia/information.html +3690 -0
- data/test/fixtures/home.html +6235 -555
- data/test/fixtures/phoenix-picturehouse/cinema.html +6089 -0
- data/test/fixtures/phoenix-picturehouse/get_movies.json +120552 -0
- data/test/fixtures/phoenix-picturehouse/information.html +3630 -0
- data/test/lib/picturehouse_uk/cinema_test.rb +34 -34
- data/test/lib/picturehouse_uk/internal/api_test.rb +92 -0
- data/test/lib/picturehouse_uk/internal/parser/address_test.rb +8 -8
- data/test/lib/picturehouse_uk/internal/parser/screenings_test.rb +99 -45
- data/test/lib/picturehouse_uk/internal/title_sanitizer_test.rb +48 -48
- data/test/lib/picturehouse_uk/internal/website_test.rb +12 -31
- data/test/lib/picturehouse_uk/performance_test.rb +63 -23
- data/test/lib/picturehouse_uk/version_test.rb +1 -1
- data/test/live/integration_test.rb +8 -8
- data/test/support/fake_api.rb +16 -0
- data/test/support/fake_website.rb +6 -6
- data/test/test_helper.rb +3 -2
- metadata +34 -50
- data/.travis.yml +0 -8
- data/test/fixtures/Duke_Of_Yorks/cinema.html +0 -3408
- data/test/fixtures/Duke_Of_Yorks/info.html +0 -556
- data/test/fixtures/Duke_Of_Yorks/whats_on.html +0 -3159
- data/test/fixtures/Dukes_At_Komedia/cinema.html +0 -4764
- data/test/fixtures/Dukes_At_Komedia/info.html +0 -526
- data/test/fixtures/Dukes_At_Komedia/whats_on.html +0 -4429
- data/test/fixtures/National_Media_Museum/cinema.html +0 -9200
- data/test/fixtures/National_Media_Museum/info.html +0 -606
- data/test/fixtures/National_Media_Museum/whats_on.html +0 -8850
- data/test/fixtures/Phoenix_Picturehouse/cinema.html +0 -8274
- data/test/fixtures/Phoenix_Picturehouse/info.html +0 -542
- data/test/fixtures/Phoenix_Picturehouse/whats_on.html +0 -7986
|
@@ -14,19 +14,19 @@ describe PicturehouseUk::Cinema do
|
|
|
14
14
|
subject { described_class.all }
|
|
15
15
|
|
|
16
16
|
it 'returns an Array of CineworldUK::Cinemas' do
|
|
17
|
-
subject.must_be_instance_of(Array)
|
|
17
|
+
_(subject).must_be_instance_of(Array)
|
|
18
18
|
subject.each do |value|
|
|
19
|
-
value.must_be_instance_of(PicturehouseUk::Cinema)
|
|
19
|
+
_(value).must_be_instance_of(PicturehouseUk::Cinema)
|
|
20
20
|
end
|
|
21
21
|
end
|
|
22
22
|
|
|
23
23
|
it 'returns the correctly sized array' do
|
|
24
|
-
subject.size.must_be :>, 18
|
|
24
|
+
_(subject.size).must_be :>, 18
|
|
25
25
|
end
|
|
26
26
|
|
|
27
27
|
it 'returns the right cinemas' do
|
|
28
|
-
subject.first.name.must_equal '
|
|
29
|
-
subject.last.name.must_equal 'City Screen
|
|
28
|
+
_(subject.first.name).must_equal 'Little Theatre Cinema'
|
|
29
|
+
_(subject.last.name).must_equal 'City Screen York'
|
|
30
30
|
end
|
|
31
31
|
end
|
|
32
32
|
end
|
|
@@ -38,14 +38,14 @@ describe PicturehouseUk::Performance do
|
|
|
38
38
|
subject { described_class.at('Duke_Of_Yorks') }
|
|
39
39
|
|
|
40
40
|
it 'returns an array of screenings' do
|
|
41
|
-
subject.must_be_instance_of(Array)
|
|
41
|
+
_(subject).must_be_instance_of(Array)
|
|
42
42
|
subject.each do |performance|
|
|
43
|
-
performance.must_be_instance_of(PicturehouseUk::Performance)
|
|
43
|
+
_(performance).must_be_instance_of(PicturehouseUk::Performance)
|
|
44
44
|
end
|
|
45
45
|
end
|
|
46
46
|
|
|
47
47
|
it 'returns correct number of screenings' do
|
|
48
|
-
subject.count.must_be :>, 10
|
|
48
|
+
_(subject.count).must_be :>, 10
|
|
49
49
|
end
|
|
50
50
|
end
|
|
51
51
|
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
require 'json'
|
|
2
|
+
|
|
3
|
+
# Fake API client for reading JSON fixtures from disk
|
|
4
|
+
class FakeApi
|
|
5
|
+
def get_movies(cinema_id, _date = 'show_all_dates')
|
|
6
|
+
JSON.parse(read_file("../../fixtures/#{cinema_id}/get_movies.json"))
|
|
7
|
+
rescue Errno::ENOENT
|
|
8
|
+
{ 'response' => 'error', 'movies' => [] }
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
private
|
|
12
|
+
|
|
13
|
+
def read_file(filepath)
|
|
14
|
+
File.read(File.expand_path(filepath, __FILE__))
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -4,16 +4,16 @@ class FakeWebsite
|
|
|
4
4
|
read_file('../../fixtures/home.html')
|
|
5
5
|
end
|
|
6
6
|
|
|
7
|
-
def
|
|
8
|
-
read_file(
|
|
7
|
+
def cinemas
|
|
8
|
+
read_file('../../fixtures/cinemas.html')
|
|
9
9
|
end
|
|
10
10
|
|
|
11
|
-
def
|
|
12
|
-
read_file("../../fixtures/#{cinema_id}/
|
|
11
|
+
def cinema(cinema_id)
|
|
12
|
+
read_file("../../fixtures/#{cinema_id}/cinema.html")
|
|
13
13
|
end
|
|
14
14
|
|
|
15
|
-
def
|
|
16
|
-
read_file("../../fixtures/#{cinema_id}/
|
|
15
|
+
def information(cinema_id)
|
|
16
|
+
read_file("../../fixtures/#{cinema_id}/information.html")
|
|
17
17
|
end
|
|
18
18
|
|
|
19
19
|
private
|
data/test/test_helper.rb
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
require '
|
|
2
|
-
|
|
1
|
+
require 'simplecov'
|
|
2
|
+
SimpleCov.start
|
|
3
3
|
|
|
4
4
|
require 'minitest/autorun'
|
|
5
5
|
require 'minitest/reporters'
|
|
@@ -15,4 +15,5 @@ require 'webmock/minitest'
|
|
|
15
15
|
|
|
16
16
|
require File.expand_path('../../lib/picturehouse_uk.rb', __FILE__)
|
|
17
17
|
|
|
18
|
+
require_relative 'support/fake_api'
|
|
18
19
|
require_relative 'support/fake_website'
|
metadata
CHANGED
|
@@ -1,31 +1,16 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: picturehouse_uk
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 5.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Andy Croll
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
|
-
name:
|
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
|
16
|
-
requirements:
|
|
17
|
-
- - "~>"
|
|
18
|
-
- !ruby/object:Gem::Version
|
|
19
|
-
version: '1.3'
|
|
20
|
-
type: :development
|
|
21
|
-
prerelease: false
|
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
-
requirements:
|
|
24
|
-
- - "~>"
|
|
25
|
-
- !ruby/object:Gem::Version
|
|
26
|
-
version: '1.3'
|
|
27
|
-
- !ruby/object:Gem::Dependency
|
|
28
|
-
name: codeclimate-test-reporter
|
|
13
|
+
name: minitest-reporters
|
|
29
14
|
requirement: !ruby/object:Gem::Requirement
|
|
30
15
|
requirements:
|
|
31
16
|
- - ">="
|
|
@@ -39,7 +24,7 @@ dependencies:
|
|
|
39
24
|
- !ruby/object:Gem::Version
|
|
40
25
|
version: '0'
|
|
41
26
|
- !ruby/object:Gem::Dependency
|
|
42
|
-
name:
|
|
27
|
+
name: rake
|
|
43
28
|
requirement: !ruby/object:Gem::Requirement
|
|
44
29
|
requirements:
|
|
45
30
|
- - ">="
|
|
@@ -53,7 +38,7 @@ dependencies:
|
|
|
53
38
|
- !ruby/object:Gem::Version
|
|
54
39
|
version: '0'
|
|
55
40
|
- !ruby/object:Gem::Dependency
|
|
56
|
-
name:
|
|
41
|
+
name: simplecov
|
|
57
42
|
requirement: !ruby/object:Gem::Requirement
|
|
58
43
|
requirements:
|
|
59
44
|
- - ">="
|
|
@@ -115,8 +100,10 @@ executables: []
|
|
|
115
100
|
extensions: []
|
|
116
101
|
extra_rdoc_files: []
|
|
117
102
|
files:
|
|
103
|
+
- ".github/workflows/ci.yml"
|
|
104
|
+
- ".github/workflows/release.yml"
|
|
118
105
|
- ".gitignore"
|
|
119
|
-
- ".
|
|
106
|
+
- ".ruby-version"
|
|
120
107
|
- ".yardopts"
|
|
121
108
|
- CHANGELOG.md
|
|
122
109
|
- COMM-LICENSE
|
|
@@ -126,6 +113,7 @@ files:
|
|
|
126
113
|
- Rakefile
|
|
127
114
|
- lib/picturehouse_uk.rb
|
|
128
115
|
- lib/picturehouse_uk/cinema.rb
|
|
116
|
+
- lib/picturehouse_uk/internal/api.rb
|
|
129
117
|
- lib/picturehouse_uk/internal/parser/address.rb
|
|
130
118
|
- lib/picturehouse_uk/internal/parser/screenings.rb
|
|
131
119
|
- lib/picturehouse_uk/internal/title_sanitizer.rb
|
|
@@ -134,20 +122,19 @@ files:
|
|
|
134
122
|
- lib/picturehouse_uk/version.rb
|
|
135
123
|
- picturehouse_uk.gemspec
|
|
136
124
|
- rake/fixture_creator.rb
|
|
137
|
-
- test/fixtures/
|
|
138
|
-
- test/fixtures/
|
|
139
|
-
- test/fixtures/
|
|
140
|
-
- test/fixtures/
|
|
141
|
-
- test/fixtures/
|
|
142
|
-
- test/fixtures/
|
|
143
|
-
- test/fixtures/
|
|
144
|
-
- test/fixtures/National_Media_Museum/info.html
|
|
145
|
-
- test/fixtures/National_Media_Museum/whats_on.html
|
|
146
|
-
- test/fixtures/Phoenix_Picturehouse/cinema.html
|
|
147
|
-
- test/fixtures/Phoenix_Picturehouse/info.html
|
|
148
|
-
- test/fixtures/Phoenix_Picturehouse/whats_on.html
|
|
125
|
+
- test/fixtures/cinemas.html
|
|
126
|
+
- test/fixtures/duke-of-york-s-picturehouse/cinema.html
|
|
127
|
+
- test/fixtures/duke-of-york-s-picturehouse/get_movies.json
|
|
128
|
+
- test/fixtures/duke-of-york-s-picturehouse/information.html
|
|
129
|
+
- test/fixtures/duke-s-at-komedia/cinema.html
|
|
130
|
+
- test/fixtures/duke-s-at-komedia/get_movies.json
|
|
131
|
+
- test/fixtures/duke-s-at-komedia/information.html
|
|
149
132
|
- test/fixtures/home.html
|
|
133
|
+
- test/fixtures/phoenix-picturehouse/cinema.html
|
|
134
|
+
- test/fixtures/phoenix-picturehouse/get_movies.json
|
|
135
|
+
- test/fixtures/phoenix-picturehouse/information.html
|
|
150
136
|
- test/lib/picturehouse_uk/cinema_test.rb
|
|
137
|
+
- test/lib/picturehouse_uk/internal/api_test.rb
|
|
151
138
|
- test/lib/picturehouse_uk/internal/parser/address_test.rb
|
|
152
139
|
- test/lib/picturehouse_uk/internal/parser/screenings_test.rb
|
|
153
140
|
- test/lib/picturehouse_uk/internal/title_sanitizer_test.rb
|
|
@@ -155,6 +142,7 @@ files:
|
|
|
155
142
|
- test/lib/picturehouse_uk/performance_test.rb
|
|
156
143
|
- test/lib/picturehouse_uk/version_test.rb
|
|
157
144
|
- test/live/integration_test.rb
|
|
145
|
+
- test/support/fake_api.rb
|
|
158
146
|
- test/support/fake_website.rb
|
|
159
147
|
- test/test_helper.rb
|
|
160
148
|
homepage: ''
|
|
@@ -162,7 +150,6 @@ licenses:
|
|
|
162
150
|
- AGPL
|
|
163
151
|
- MIT
|
|
164
152
|
metadata: {}
|
|
165
|
-
post_install_message:
|
|
166
153
|
rdoc_options: []
|
|
167
154
|
require_paths:
|
|
168
155
|
- lib
|
|
@@ -177,26 +164,23 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
177
164
|
- !ruby/object:Gem::Version
|
|
178
165
|
version: '0'
|
|
179
166
|
requirements: []
|
|
180
|
-
|
|
181
|
-
rubygems_version: 2.4.5
|
|
182
|
-
signing_key:
|
|
167
|
+
rubygems_version: 3.6.9
|
|
183
168
|
specification_version: 4
|
|
184
169
|
summary: It's a scraper, but a nice one
|
|
185
170
|
test_files:
|
|
186
|
-
- test/fixtures/
|
|
187
|
-
- test/fixtures/
|
|
188
|
-
- test/fixtures/
|
|
189
|
-
- test/fixtures/
|
|
190
|
-
- test/fixtures/
|
|
191
|
-
- test/fixtures/
|
|
192
|
-
- test/fixtures/
|
|
193
|
-
- test/fixtures/National_Media_Museum/info.html
|
|
194
|
-
- test/fixtures/National_Media_Museum/whats_on.html
|
|
195
|
-
- test/fixtures/Phoenix_Picturehouse/cinema.html
|
|
196
|
-
- test/fixtures/Phoenix_Picturehouse/info.html
|
|
197
|
-
- test/fixtures/Phoenix_Picturehouse/whats_on.html
|
|
171
|
+
- test/fixtures/cinemas.html
|
|
172
|
+
- test/fixtures/duke-of-york-s-picturehouse/cinema.html
|
|
173
|
+
- test/fixtures/duke-of-york-s-picturehouse/get_movies.json
|
|
174
|
+
- test/fixtures/duke-of-york-s-picturehouse/information.html
|
|
175
|
+
- test/fixtures/duke-s-at-komedia/cinema.html
|
|
176
|
+
- test/fixtures/duke-s-at-komedia/get_movies.json
|
|
177
|
+
- test/fixtures/duke-s-at-komedia/information.html
|
|
198
178
|
- test/fixtures/home.html
|
|
179
|
+
- test/fixtures/phoenix-picturehouse/cinema.html
|
|
180
|
+
- test/fixtures/phoenix-picturehouse/get_movies.json
|
|
181
|
+
- test/fixtures/phoenix-picturehouse/information.html
|
|
199
182
|
- test/lib/picturehouse_uk/cinema_test.rb
|
|
183
|
+
- test/lib/picturehouse_uk/internal/api_test.rb
|
|
200
184
|
- test/lib/picturehouse_uk/internal/parser/address_test.rb
|
|
201
185
|
- test/lib/picturehouse_uk/internal/parser/screenings_test.rb
|
|
202
186
|
- test/lib/picturehouse_uk/internal/title_sanitizer_test.rb
|
|
@@ -204,6 +188,6 @@ test_files:
|
|
|
204
188
|
- test/lib/picturehouse_uk/performance_test.rb
|
|
205
189
|
- test/lib/picturehouse_uk/version_test.rb
|
|
206
190
|
- test/live/integration_test.rb
|
|
191
|
+
- test/support/fake_api.rb
|
|
207
192
|
- test/support/fake_website.rb
|
|
208
193
|
- test/test_helper.rb
|
|
209
|
-
has_rdoc:
|