picturehouse_uk 2.0.1 → 2.0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 515cc194c2ddb6340b07b0a20c25f491aba6e7ac
4
- data.tar.gz: c06643abffca387ca159f78a029532eddd304ec5
3
+ metadata.gz: 190e0e19a7e33fd30aa252d53617a8f3f6820ae2
4
+ data.tar.gz: 0a8ed252dfbf2d9a564a042ee01806b00f52a914
5
5
  SHA512:
6
- metadata.gz: 73ed0a6bfd6be3231955f23dd16a0ba8bfece01d3774abb47043c5b278552a398fda1717fb04fb8be810a1f5f19ee98f6b806eaf86f7d09952e8fa2912329728
7
- data.tar.gz: 5d69b824baf177025b9d685d3fdbfe1f26c009703c87c78a39ed2e2c6957f5efad41a85bae3b733319591312f90d36452978586238850d19d7cfbcde91f84a82
6
+ metadata.gz: bd685b9048d7a054fa0c712014f0d8fda32fb189ae180f0e1e890854fc0aed9eb0c6527333796a0f31933ffa2a91f5c3a34dafdb5dae73c7af76473631e102a7
7
+ data.tar.gz: a0bbdda9c956e867e5863991f981fa862d6a8f5a85250e079bc3c373a503fa750112eef17fbc602a802f2af340604898e7158aad7fb0775f4e33363dccccecfc
data/CHANGELOG.md CHANGED
@@ -1,6 +1,15 @@
1
1
  # Change Log
2
2
  All notable changes to this project will be documented in this file.
3
3
 
4
+ ## v.2.0.2 -2014-10-19
5
+
6
+ ### Added
7
+ - No screenings in York for 'basement events'
8
+ - more flexible 2d removal
9
+ - better title sanitizations
10
+ - deal with ROH Encore
11
+ - better spacing on 'event' titles
12
+
4
13
  ## v.2.0.1 -2014-10-19
5
14
 
6
15
  ### Added
@@ -16,6 +16,7 @@ module PicturehouseUk
16
16
  # The film name
17
17
  # @return [String]
18
18
  def film_name
19
+ return if city_screen_basement_event?
19
20
  TitleSanitizer.new(raw_film_name).sanitized
20
21
  end
21
22
 
@@ -33,6 +34,10 @@ module PicturehouseUk
33
34
 
34
35
  private
35
36
 
37
+ def city_screen_basement_event?
38
+ raw_film_name.match(/\Abasement/)
39
+ end
40
+
36
41
  def dimension
37
42
  raw_film_name.match(/3d/i) ? '3d' : '2d'
38
43
  end
@@ -50,7 +55,7 @@ module PicturehouseUk
50
55
  end
51
56
 
52
57
  def screenings?
53
- !!screening_nodes
58
+ !!screening_nodes && !city_screen_basement_event?
54
59
  end
55
60
  end
56
61
 
@@ -6,7 +6,7 @@ module PicturehouseUk
6
6
  # strings and regex to be removed
7
7
  REMOVE = [
8
8
  /\s\[(AS LIVE:\s*)?[ACPGU1258]+\]/, # regular certificate
9
- /\s+[23][dD]/, # 2d or 3d from title
9
+ /\s+\(?[23][dD]\)?/, # 2d or 3d from title
10
10
  /\s\[NO CERT\]/, # no certificate
11
11
  /\s\[\]/, # blank certificate
12
12
  /ourscreen\: /, # ourscreen
@@ -16,18 +16,23 @@ module PicturehouseUk
16
16
  /\s?\+\s?Q\&A\.?/i, # +Q&A
17
17
  /KIDS CLUB\s*/i, # kids club
18
18
  /DISCOVER TUE\s*/i, # discover tue
19
- /FREE Screening\s*-\s*/i # free screening
19
+ /FREE Screening\s*-\s*/i, # free screening
20
+ /\s*-?\s*Big Scream\s*-?\s*/i, # big scream
21
+ /\*?HOH Subtitled\*?/i, # subtitled
22
+ /\s*\-?\s*Reminiscence/i, # reminiscence
23
+ /\s*-?\s*Kids\'? Club\s*-?\s*/, # kids club
20
24
  ]
21
25
 
22
26
  # regexes and their replacements
23
27
  REPLACE = {
24
- /Met\.? Encore:\s*(.*)/ => 'Met Opera:',
28
+ /Met\.? Encore:\s*(.*)/ => 'Met Opera: ',
25
29
  /Met\.? Opera:\s*(.*)/ => 'Met Opera: ',
26
- /NT Encore:\s*(.*)/ => 'National Theatre:',
27
- /NT Live:\s*(.*)/ => 'National Theatre:',
28
- /ROH\.? Live:\s*(.*)/ => 'Royal Opera House:',
29
- /RSC\.? Live:\s*(.*)/ => 'Royal Shakespeare Company:',
30
- /RSC\.? Encore:\s*(.*)/ => 'Royal Shakespeare Company:'
30
+ /NT Encore:\s*(.*)/ => 'National Theatre: ',
31
+ /NT Live:\s*(.*)/ => 'National Theatre: ',
32
+ /ROH\.? Live:\s*(.*)/ => 'Royal Opera House: ',
33
+ /ROH\.? Encore:\s*(.*)/ => 'Royal Opera House: ',
34
+ /RSC\.? Live:\s*(.*)/ => 'Royal Shakespeare Company: ',
35
+ /RSC\.? Encore:\s*(.*)/ => 'Royal Shakespeare Company: '
31
36
  }
32
37
 
33
38
  # @param [String] title a film title
@@ -1,6 +1,6 @@
1
1
  # Ruby interface for http://www.picturehouses.co.uk
2
- # @version 2.0.1
2
+ # @version 2.0.2
3
3
  module PicturehouseUk
4
4
  # Gem version
5
- VERSION = '2.0.1'
5
+ VERSION = '2.0.2'
6
6
  end
@@ -0,0 +1,19 @@
1
+ <div class="item" style="height:80px;">
2
+ <div class="left a" style="height:80px;">
3
+ <a href="/cinema/York_Picturehouse/film/Basement_Komedias_Krater_Comedy_Club/">
4
+ <img src="/newman/static/atchs/Global/n9/n9jdm.jpeg" width="60" height="60" class="imageborder">
5
+ </a>
6
+ </div>
7
+ <div class="left b" style="width:300px;">
8
+ <a href="/cinema/York_Picturehouse/film/Basement_Komedias_Krater_Comedy_Club/" class="movielink" style="text-decoration:underline;">basement KOMEDIA'S KRATER COMEDY CLUB</a><br>
9
+ <div class="clear"></div>
10
+ <div class="padding txt1 film.subtitled" style="height:45px;overflow-y:hidden;padding-left:0;">
11
+ <div class="filmrating" content_id="ee39d11f9ffdf541ec44dcc1f03d8d6c"></div>
12
+ </div>
13
+ </div>
14
+ <div class="left" style="width:210px;">
15
+ <a rel="nofollow" bookable="" href="/cinema/York_Picturehouse/film/Basement_Komedias_Krater_Comedy_Club/show/3tbuwr/" id="3tbuwr" class="button_time " epoch="1413743400.0">19:30
16
+ </a>
17
+ </div>
18
+ <div style="clear:both;"></div>
19
+ </div>
@@ -23,6 +23,14 @@ describe PicturehouseUk::Internal::FilmWithScreeningsParser do
23
23
  subject.must_equal('The Judge')
24
24
  end
25
25
  end
26
+
27
+ describe 'passed basement from Cityscreen Picturehouse York' do
28
+ let(:film_html) { read_film_html('York_Picturehouse/basement') }
29
+
30
+ it 'returns nil' do
31
+ subject.must_equal(nil)
32
+ end
33
+ end
26
34
  end
27
35
 
28
36
  describe '#to_a' do
@@ -54,7 +62,7 @@ describe PicturehouseUk::Internal::FilmWithScreeningsParser do
54
62
  end
55
63
  end
56
64
 
57
- describe 'passed film html from top of dbox cinema page' do
65
+ describe 'passed film html from bottom of cinema page' do
58
66
  let(:film_html) { read_film_html('Duke_Of_Yorks/film_last') }
59
67
  let(:permitted_types) { %w(baby dbox hfr kids silver) }
60
68
 
@@ -67,6 +75,15 @@ describe PicturehouseUk::Internal::FilmWithScreeningsParser do
67
75
  end
68
76
  end
69
77
  end
78
+
79
+ describe 'passed basement from Cityscreen Picturehouse York' do
80
+ let(:film_html) { read_film_html('York_Picturehouse/basement') }
81
+
82
+ it 'returns an empty array' do
83
+ subject.must_be_instance_of(Array)
84
+ subject.must_be :empty?
85
+ end
86
+ end
70
87
  end
71
88
 
72
89
  private
@@ -22,6 +22,14 @@ describe PicturehouseUk::Internal::TitleSanitizer do
22
22
  end
23
23
  end
24
24
 
25
+ describe 'with (2d) in title' do
26
+ let(:title) { 'ParaNorman (2D)' }
27
+
28
+ it 'removes dimension' do
29
+ subject.must_equal('ParaNorman')
30
+ end
31
+ end
32
+
25
33
  describe 'with 3d in title' do
26
34
  let(:title) { 'Iron Man 3 3d' }
27
35
 
@@ -102,6 +110,38 @@ describe PicturehouseUk::Internal::TitleSanitizer do
102
110
  end
103
111
  end
104
112
 
113
+ describe 'with HOH Subtitled in the title' do
114
+ let(:title) { "'71 *HOH Subtitled*" }
115
+
116
+ it 'removes extra info' do
117
+ subject.must_equal("'71")
118
+ end
119
+ end
120
+
121
+ describe 'with Big Scream in the title' do
122
+ let(:title) { 'Big Scream - Effie Gray' }
123
+
124
+ it 'removes extra info' do
125
+ subject.must_equal('Effie Gray')
126
+ end
127
+ end
128
+
129
+ describe 'with kids club in the title' do
130
+ let(:title) { "ParaNorman (2D) - Kids' Club" }
131
+
132
+ it 'removes extra info' do
133
+ subject.must_equal('ParaNorman')
134
+ end
135
+ end
136
+
137
+ describe 'with reminiscence in the title' do
138
+ let(:title) { "Rosemary's Baby - Reminiscence" }
139
+
140
+ it 'removes extra info' do
141
+ subject.must_equal("Rosemary's Baby")
142
+ end
143
+ end
144
+
105
145
  describe 'Bolshoi screening' do
106
146
  let(:title) { 'Bolshoi: Spartacus [NO CERT]' }
107
147
 
@@ -183,5 +223,13 @@ describe PicturehouseUk::Internal::TitleSanitizer do
183
223
  subject.must_equal('Royal Shakespeare Company: Richard II')
184
224
  end
185
225
  end
226
+
227
+ describe 'Royal Opera House encore screening' do
228
+ let(:title) { 'ROH Encore: Swan Lake' }
229
+
230
+ it 'removes prefix' do
231
+ subject.must_equal('Royal Opera House: Swan Lake')
232
+ end
233
+ end
186
234
  end
187
235
  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: 2.0.1
4
+ version: 2.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Croll
@@ -141,6 +141,7 @@ files:
141
141
  - test/fixtures/cinema/Duke_Of_Yorks.html
142
142
  - test/fixtures/cinema/Duke_Of_Yorks/film_last.html
143
143
  - test/fixtures/cinema/Duke_Of_Yorks/film_second.html
144
+ - test/fixtures/cinema/York_Picturehouse/basement.html
144
145
  - test/fixtures/contact_us/Duke_Of_Yorks.html
145
146
  - test/fixtures/contact_us/Dukes_At_Komedia.html
146
147
  - test/fixtures/home.html
@@ -186,6 +187,7 @@ test_files:
186
187
  - test/fixtures/cinema/Duke_Of_Yorks.html
187
188
  - test/fixtures/cinema/Duke_Of_Yorks/film_last.html
188
189
  - test/fixtures/cinema/Duke_Of_Yorks/film_second.html
190
+ - test/fixtures/cinema/York_Picturehouse/basement.html
189
191
  - test/fixtures/contact_us/Duke_Of_Yorks.html
190
192
  - test/fixtures/contact_us/Dukes_At_Komedia.html
191
193
  - test/fixtures/home.html