picturehouse_uk 3.0.10 → 3.0.11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0ab5a283ee762cee5bb1c508017fd2fc9235123c
4
- data.tar.gz: 8f3191bab2b0b97afe355189aea8b2276bbb52de
3
+ metadata.gz: 9c55a396b0cc0237fce8db0de30fd4b37240e9d6
4
+ data.tar.gz: 81b7a2c9c87b2f8d1631dd66905a4681337f40ae
5
5
  SHA512:
6
- metadata.gz: 13f5b6c54ef1482de12f8277595ae682bc52ed6ebf66acaa9304d7faaa356da3a77ddb498cfb2d5175c21c85b10827a62dd0f66bf942bd7b7cf646a758e9d1fc
7
- data.tar.gz: 7e6c2f85f8f1c7b21f6ff7fa278a0a25ffbee40ab6e2697c761840cf87e7e3aa36d1be34219dab679dc8f67e128983b45f970aed78e0eda3a28871cf2691f4d0
6
+ metadata.gz: 99f9f4b2c2452830dbf3e7576bd9d7b53e2742d16e5fca9184bfcd572f8f0a656c1495d926077d28e3f5236468805fcaf836eab15c9c873912e96ef0ca5b1afc
7
+ data.tar.gz: 87976c1fdcf3fe9d31ed161b2264b7b231c2c1a0bd8d95a2f21d387cf9288bbb8bae21be24757f90f8bf4cd992216edf98d75917d751249ea0d9ccb557c512ec
data/CHANGELOG.md CHANGED
@@ -1,6 +1,13 @@
1
1
  # Change Log
2
2
  All notable changes to this project will be documented in this file.
3
3
 
4
+ ## [3.0.11] - 2015-05-03
5
+
6
+ ### Added
7
+ - Variants work. 'arts', 'baby', 'kids', 'imax', 'senior'
8
+ - Test for screening booking urls
9
+ - Test for screenings at National Museum IMAX picturehouse
10
+
4
11
  ## [3.0.10] - 2015-04-12
5
12
 
6
13
  ### Changed
@@ -81,9 +81,19 @@ module PicturehouseUk
81
81
 
82
82
  # variants can have multiple screenings
83
83
  Variant = Struct.new(:node, :date) do
84
- SHOWTIMES = '.btn'
85
- VARIANT = '.film-type-desc'
86
-
84
+ SHOWTIMES = '.btn'
85
+ VARIANT = '.film-type-desc'
86
+ TRANSLATOR = {
87
+ 'Big Scream' => 'baby',
88
+ 'IMAX' => 'imax',
89
+ "Kids' Club" => 'kids',
90
+ 'NT Live' => 'arts',
91
+ 'Screen Arts' => 'arts',
92
+ 'Silver Screen' => 'senior'
93
+ }
94
+
95
+ # Variant arrays
96
+ # @return [Array<Hash>]
87
97
  def to_a
88
98
  node.css(SHOWTIMES).map do |node|
89
99
  { variant: variant }.merge(Showtime.new(node, date).to_hash)
@@ -93,21 +103,16 @@ module PicturehouseUk
93
103
  private
94
104
 
95
105
  def variant
96
- @variant ||= []
106
+ @variant ||= TRANSLATOR.select { |k, _| variant_text.include?(k) }.values
107
+ end
108
+
109
+ def variant_text
110
+ @variant_text ||= node.css(VARIANT).to_s
97
111
  end
98
112
  end
99
113
 
100
114
  # parse an individual screening node
101
115
  Showtime = Struct.new(:node, :date) do
102
- # the attributes of a single screening
103
- # @return [Hash]
104
- # @example
105
- # PicturehouseUk::Internal::ScreeningParser.new(html).to_hash
106
- # => {
107
- # booking_url: 'http://...',
108
- # time: <Time>,
109
- # variant: ['imax']
110
- # }
111
116
  def to_hash
112
117
  {
113
118
  booking_url: node['href'],
@@ -1,6 +1,6 @@
1
1
  # Ruby interface for http://www.picturehouses.co.uk
2
- # @version 3.0.10
2
+ # @version 3.0.11
3
3
  module PicturehouseUk
4
4
  # Gem version
5
- VERSION = '3.0.10'
5
+ VERSION = '3.0.11'
6
6
  end
@@ -44,3 +44,10 @@ File.open(fixture('info/Phoenix_Picturehouse'), 'w') do |file|
44
44
  puts '* Pheonix Oxford Information'
45
45
  file.write PicturehouseUk::Internal::Website.new.info('Phoenix_Picturehouse')
46
46
  end
47
+
48
+ # NATIONAL MEDIA MUSEUM (IMAX)
49
+
50
+ File.open(fixture('cinema/National_Media_Museum'), 'w') do |file|
51
+ puts '* National Media Museum'
52
+ file.write PicturehouseUk::Internal::Website.new.cinema('National_Media_Museum')
53
+ end