picturehouse_uk 3.0.7 → 3.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/picturehouse_uk/internal/parser/screenings.rb +8 -2
- data/lib/picturehouse_uk/version.rb +2 -2
- data/test/fixtures/cinema/Duke_Of_Yorks.html +2310 -2672
- data/test/fixtures/cinema/Dukes_At_Komedia.html +4325 -3656
- data/test/fixtures/cinema/Phoenix_Picturehouse.html +3060 -3901
- data/test/fixtures/home.html +72 -51
- data/test/fixtures/info/Duke_Of_Yorks.html +26 -22
- data/test/fixtures/info/Dukes_At_Komedia.html +26 -22
- data/test/fixtures/info/Phoenix_Picturehouse.html +26 -22
- data/test/lib/picturehouse_uk/cinema_test.rb +1 -1
- data/test/lib/picturehouse_uk/screening_test.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4f6fb1d47bad9c9222aa24f5782e3dacf9dfdf4f
|
4
|
+
data.tar.gz: 0c4675d6002c48e5a3d060ae77f14286df40dc16
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 724b00074362866f62645fb0ee3cdce265e2ed50566e72a0bbcd9dab474ce247e67ee76a7c4e0dfd9fe4bd20aa7e6e3954e197349f33f48a0a68a3c68156cdd4
|
7
|
+
data.tar.gz: 1880388a8387f29b76d005477195d59aea20c789bd121b3901cbb2e1d083fa83ad2779bf1c52102d68124e4c3d39bf3872be7f6498fcdb5e0109ae2343ff6924
|
data/CHANGELOG.md
CHANGED
@@ -13,8 +13,8 @@ module PicturehouseUk
|
|
13
13
|
def to_a
|
14
14
|
date = nil
|
15
15
|
doc.css(LISTINGS).each_with_object([]) do |node, result|
|
16
|
-
if node.
|
17
|
-
date =
|
16
|
+
if date_parse(node.text)
|
17
|
+
date = date_parse(node.text)
|
18
18
|
else
|
19
19
|
result << FilmWithShowtimes.new(node, date).to_a
|
20
20
|
end
|
@@ -23,6 +23,12 @@ module PicturehouseUk
|
|
23
23
|
|
24
24
|
private
|
25
25
|
|
26
|
+
def date_parse(text)
|
27
|
+
Date.parse(text)
|
28
|
+
rescue ArgumentError
|
29
|
+
nil
|
30
|
+
end
|
31
|
+
|
26
32
|
def doc
|
27
33
|
@doc ||= Nokogiri::HTML(page)
|
28
34
|
end
|