kandianying 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/kandianying/ambassador.rb +9 -4
- data/lib/kandianying/version.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: 34f5f12b037668581e8409e436b57182d4c95e6a
|
4
|
+
data.tar.gz: fe2152abdad80bb67349aa15c7a66224cc0c7c4b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8f84c73702e9e86e24226de5cda135faa02e32ef9cd3cbf3d189fbc875e9650436e8a82f44b54d5c902a320c70ef519e2a21815eedf671bcc4397aa829a65168
|
7
|
+
data.tar.gz: b065b1d95633ac22db77dc47af8e37cf4e313cb65491b8c24fb89ea265fc4fd7c94a8107b5a729b42f440df25fd686804850cd62fc20368ac0bb201969eda936
|
@@ -8,20 +8,25 @@ require_relative 'search'
|
|
8
8
|
|
9
9
|
# Scraper for Ambassador
|
10
10
|
module Ambassador
|
11
|
+
INIT_ERR = 'id out of range'
|
12
|
+
LANGUAGE_ERROR = 'language must be one of \'english\' or \'chinese\''
|
13
|
+
LANGUAGES = %w(english chinese)
|
14
|
+
|
11
15
|
# Class for Vieshow films
|
12
16
|
class Ambassador
|
13
17
|
include AmbassadorScrape, Search
|
14
18
|
attr_reader :movie_table, :theater_id_table, :cinema_name
|
15
19
|
|
16
|
-
def initialize(id,
|
20
|
+
def initialize(id, lang)
|
17
21
|
@movie_table = {}
|
18
22
|
@theater_id_table = fetch_theater_id_table(AMBASSADOR_THEATER_ID_URL)
|
23
|
+
fail INIT_ERR unless theater_id_table.keys.any? { |key| key.include? id }
|
24
|
+
fail LANGUAGE_ERROR unless LANGUAGES.include? lang
|
19
25
|
theater_id_table.each do |theater_id, theater_name|
|
20
26
|
next unless theater_id.include? id
|
21
|
-
|
27
|
+
dates = fetch_theater_date(theater_id)
|
22
28
|
@cinema_name = theater_name
|
23
|
-
@movie_table[theater_name] = fetch_movie_info(theater_id,
|
24
|
-
language)
|
29
|
+
@movie_table[theater_name] = fetch_movie_info(theater_id, dates, lang)
|
25
30
|
end
|
26
31
|
end
|
27
32
|
|
data/lib/kandianying/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kandianying
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- stonegold546
|
@@ -178,7 +178,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
178
178
|
version: '0'
|
179
179
|
requirements: []
|
180
180
|
rubyforge_project:
|
181
|
-
rubygems_version: 2.4.
|
181
|
+
rubygems_version: 2.4.6
|
182
182
|
signing_key:
|
183
183
|
specification_version: 4
|
184
184
|
summary: Get movie information in Hsin Chu
|