cineworld_uk 1.0.0 → 1.0.1

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,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- Yjc5NWQ4NDdkYzUwN2NmMzRkMzBhZGZhNjM4NWRiNDQ1ZmQ0N2JmZQ==
4
+ N2U0MGM3ZjlkNTc1OGNiMmY2YTM0Yjg1MGQ0ZDY3MTA4ZjY4YzNjMw==
5
5
  data.tar.gz: !binary |-
6
- ZjkxNGU0ODcwNTQyYTcxOWQxZjQ1OGE4MGUxYTc2YTQ2NzNjYzc1NQ==
6
+ YjQwMWJjZmM4YTE5OWM5YWM0NTNjOWM3NzNjMmY2NTAyZTEyZmNhYQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MDQyNDYwMTcxYWNiZGU2ZjEzYzZkMzU1YjJkYjQzZDEzNmYyZmIxNjE0ZTFj
10
- MGRhMzRmZjVkNDY4ZTVlODczMjQ3MWE0NjczZGZlZTgzOWFjOGE4M2FiZjEz
11
- Y2YzOWNlMzJhMDY5NmM4YzZlMzlkYmZjNmJjNTUzMWI5MGY5Y2U=
9
+ MGZhMTk0ZWM4OTJmZjc4MmVmODEwY2U0ZDQ0ODVmNGViMTU5OWM2ZmI0NjUx
10
+ Y2JjZjNhNmViNDYyMGZmNjhkMDc2ZTY1MmFiMjU0NzQ2NmE2ZmI0MTJiZDI4
11
+ YWE3ODUzOTgxM2MwZTRhZTA2NGQ5MzgwOGZiMzNjZDA4NDFkZDk=
12
12
  data.tar.gz: !binary |-
13
- YTU3ZjQ1YjM2N2RkZTI3YTRkYzlhY2UxMDYwOWE1Njg3MjBkNWEyYjU0ZjRj
14
- ZGY0MWMxZDViOTUyY2NkN2NiYTBhNTVlYWM5MjE1YjcxYjkyOTlhMTQ2OWM3
15
- NzljMzkyZDVjMDUyZmQ5MmUyZDNiN2MzODc3NDI5ODFhN2YwY2M=
13
+ ODQyMTFmZTU0ODgxZTkwNTIzZjNlYjE3NmVmNmRiZTdhYzQ0MmI5NjQ2MDhj
14
+ M2EzYmU3NjAwZjIxZjRkODdhMDBjNjM1ODc1NjBhMDEyNWQ0NGExMjM5ZDg0
15
+ NmE0NGRlNjhjMmUzMzg4NGY0OTg1YjMwYjdjMGMzYzE2OTU3MDQ=
data/README.md CHANGED
@@ -41,13 +41,13 @@ cinema.films
41
41
  #=> [<CineworldUK::Film name="Iron Man 3">, <CineworldUK::Film name="Star Trek: Into Darkness">]
42
42
 
43
43
  cinema.screenings
44
- #=> [<CineworldUK::Screening film="About Time" when="2013-09-09 11:00 UTC" varient="3d">, <CineworldUK::Screening film="Iron Man 3" when="2013-09-09 13:50 UTC" varient="kids">, <CineworldUK::Screening ..>, <CineworldUK::Screening ...>]
44
+ #=> [<CineworldUK::Screening film="About Time" when="2013-09-09 11:00 UTC" variant="3d">, <CineworldUK::Screening film="Iron Man 3" when="2013-09-09 13:50 UTC" variant="kids">, <CineworldUK::Screening ..>, <CineworldUK::Screening ...>]
45
45
 
46
46
  cinema.screenings_of 'Iron Man 3'
47
- #=> [<CineworldUK::Screening film="Iron Man 3" when="2013-09-09 11:00 UTC" varient="3d">, <CineworldUK::Screening film="Iron Man 3" when="2013-09-09 13:50 UTC" varient="kids">]
47
+ #=> [<CineworldUK::Screening film="Iron Man 3" when="2013-09-09 11:00 UTC" variant="3d">, <CineworldUK::Screening film="Iron Man 3" when="2013-09-09 13:50 UTC" variant="kids">]
48
48
 
49
49
  cinema.screenings_of <CineworldUK::Film name="Iron Man 3">
50
- #=> [<CineworldUK::Screening film="Iron Man 3" when="2013-09-09 11:00 UTC" varient="3d">, <CineworldUK::Screening film="Iron Man 3" when="2013-09-09 13:50 UTC" varient="kids">]
50
+ #=> [<CineworldUK::Screening film="Iron Man 3" when="2013-09-09 11:00 UTC" variant="3d">, <CineworldUK::Screening film="Iron Man 3" when="2013-09-09 13:50 UTC" variant="kids">]
51
51
  ```
52
52
 
53
53
  ## Contributing
@@ -134,7 +134,7 @@ module CineworldUk
134
134
  # @example
135
135
  # cinema = CineworldUk::Cinema.find(3)
136
136
  # cinema.screenings
137
- # # => [<CineworldUk::Screening film_name="Iron Man 3" cinema_name="Brighton" when="..." varient="...">, <CineworldUk::Screening ...>]
137
+ # # => [<CineworldUk::Screening film_name="Iron Man 3" cinema_name="Brighton" when="..." variant="...">, <CineworldUk::Screening ...>]
138
138
  def screenings
139
139
  film_nodes.map do |node|
140
140
  parser = CineworldUk::Internal::FilmWithScreeningsParser.new node.to_s
@@ -60,7 +60,7 @@ module CineworldUk
60
60
  def showings
61
61
  tz = TZInfo::Timezone.get('Europe/London')
62
62
  @nokogiri_html.css('.schedule .performances > li').inject({}) do |result, li|
63
- key = performance_varient(li)
63
+ key = performance_variant(li)
64
64
 
65
65
  if has_bookable_link_node?(li)
66
66
  time_array = performance_date_array(li) + performance_time_array(li)
@@ -120,7 +120,7 @@ module CineworldUk
120
120
  end
121
121
  end
122
122
 
123
- def performance_varient(node)
123
+ def performance_variant(node)
124
124
  dimension(node) + "#{ ' D-BOX' if dbox?(node) }#{ ' IMAX' if imax?(node) }"
125
125
  end
126
126
  end
@@ -12,15 +12,15 @@ module CineworldUk
12
12
  # @return [Time] the UTC time of the screening
13
13
  attr_reader :when
14
14
  # @return [String] the type of screening (2D, 3D, IMAX...)
15
- attr_reader :varient
15
+ attr_reader :variant
16
16
 
17
17
  # @param [String] film_name the film name
18
18
  # @param [String] cinema_name the cinema name
19
19
  # @param [Time] time datetime of the screening (UTC preferred)
20
20
  # @param [String] booking_url direct link to the booking page for this screening
21
- # @param [String] varient the type of showing (e.g. 3d/baby/live)
22
- def initialize(film_name, cinema_name, time, booking_url=nil, varient=nil)
23
- @booking_url, @cinema_name, @film_name, @varient = booking_url, cinema_name, film_name, varient
21
+ # @param [String] variant the type of showing (e.g. 3d/baby/live)
22
+ def initialize(film_name, cinema_name, time, booking_url=nil, variant=nil)
23
+ @booking_url, @cinema_name, @film_name, @variant = booking_url, cinema_name, film_name, variant
24
24
  @when = time.utc? ? time : TZInfo::Timezone.get('Europe/London').local_to_utc(time)
25
25
  end
26
26
 
@@ -29,5 +29,11 @@ module CineworldUk
29
29
  def date
30
30
  @when.to_date
31
31
  end
32
+
33
+ # @deprecated Please use {#variant} instead, I can't spell
34
+ def varient
35
+ warn "Please use #variant instead, I can't spell"
36
+ variant
37
+ end
32
38
  end
33
39
  end
@@ -1,6 +1,6 @@
1
1
  # Ruby interface for http://www.cineworld.co.uk
2
- # @version 1.0.0
2
+ # @version 1.0.1
3
3
  module CineworldUk
4
4
  # Gem version
5
- VERSION = "1.0.0"
5
+ VERSION = "1.0.1"
6
6
  end
@@ -1,23 +1,23 @@
1
1
  require_relative '../../test_helper'
2
2
 
3
3
  describe CineworldUk::Screening do
4
- describe '#new film_name, cinema_name, date, time, varient' do
4
+ describe '#new film_name, cinema_name, date, time, variant' do
5
5
  it 'stores film_name, cinema_name & when (in UTC)' do
6
6
  screening = CineworldUk::Screening.new 'Iron Man 3', "Duke's At Komedia", Time.parse('2013-09-12 11:00')
7
7
  screening.film_name.must_equal 'Iron Man 3'
8
8
  screening.cinema_name.must_equal "Duke's At Komedia"
9
9
  screening.when.must_equal Time.utc(2013, 9, 12, 10, 0)
10
10
  screening.booking_url.must_equal nil
11
- screening.varient.must_equal nil
11
+ screening.variant.must_equal nil
12
12
  end
13
13
 
14
- it 'stores varient if passed' do
14
+ it 'stores variant if passed' do
15
15
  screening = CineworldUk::Screening.new 'Iron Man 3', "Duke's At Komedia", Time.utc(2013, 9, 12, 11, 0), 'http://link.com', '2d'
16
16
  screening.film_name.must_equal 'Iron Man 3'
17
17
  screening.cinema_name.must_equal "Duke's At Komedia"
18
18
  screening.when.must_equal Time.utc(2013, 9, 12, 11, 0)
19
19
  screening.booking_url.must_equal 'http://link.com'
20
- screening.varient.must_equal '2d'
20
+ screening.variant.must_equal '2d'
21
21
  end
22
22
  end
23
23
 
@@ -28,4 +28,13 @@ describe CineworldUk::Screening do
28
28
  subject.must_equal Date.new(2013, 9, 12)
29
29
  end
30
30
  end
31
+
32
+ describe '#varient (DEPRECATED)' do
33
+ subject { screening.varient }
34
+ let(:screening) { CineworldUk::Screening.new 'Iron Man 3', "Duke's At Komedia", Time.utc(2013, 9, 12, 11, 0), 'http://link.com', '2d' }
35
+
36
+ it 'should return variant' do
37
+ subject.must_equal '2d'
38
+ end
39
+ end
31
40
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cineworld_uk
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Croll
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-06 00:00:00.000000000 Z
11
+ date: 2014-01-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -216,4 +216,3 @@ test_files:
216
216
  - test/lib/cineworld_uk/screening_test.rb
217
217
  - test/lib/cineworld_uk/version_test.rb
218
218
  - test/test_helper.rb
219
- has_rdoc: