vscinemas 0.1.0 → 0.2.0

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
  SHA256:
3
- metadata.gz: b53ff9765fe92baea00224c6c1fe082bf96c5ef98c4d8a21b0cea34fb17c116f
4
- data.tar.gz: 600cb860e6c2e7a0f68f595a34095bb970dcbc1b4658130324c30bf1b9fce968
3
+ metadata.gz: b80d9859148d4ccccc02ac053d136e4f5829f9caf77b2bfa70525a1745b0a6b1
4
+ data.tar.gz: e6c9395c72782104aa449f191dd5a1766dd94365405aa415abd77bc4ea346295
5
5
  SHA512:
6
- metadata.gz: e1840d6186f0013eb980255c9af63da3e38504d698aaee0e6bd6a9010a02a49e060b4522af3612d183bb5d97db5f1a1d13b222d9209f199c872605782bd49179
7
- data.tar.gz: bab8865e553d9926a14984b0f96617c561cb4f540a9c189b9a1118456107e367c868afb5a6b0b7bd7da0326ac15cdfd821613317a7c1386528ce31698e80716c
6
+ metadata.gz: 80ae3258fb7b9dad7fb80e3009d1d7c4d2536bfcceedceef57bb17ba73df68a88d8793fd582d6285c0f97b2c3b293911f239db9edf79c1c1033bc94f84113847
7
+ data.tar.gz: 1720344bf8c2682b228c051745a603606aad96044e7fbd49adc3389b6003a4aee61264e2235e2d39f8013b3b34a29a27a110de9144f2be9521b4ef04516bc0b4
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- vscinemas (0.1.0)
4
+ vscinemas (0.2.0)
5
5
  nokogiri
6
6
 
7
7
  GEM
@@ -22,8 +22,6 @@ GEM
22
22
  iniparse (1.5.0)
23
23
  nokogiri (1.12.5-x86_64-darwin)
24
24
  racc (~> 1.4)
25
- nokogiri (1.12.5-x86_64-linux)
26
- racc (~> 1.4)
27
25
  overcommit (0.58.0)
28
26
  childprocess (>= 0.6.3, < 5)
29
27
  iniparse (~> 1.4)
data/README.md CHANGED
@@ -32,6 +32,16 @@ movies.each do |movie|
32
32
  end
33
33
  ```
34
34
 
35
+ ### Get Coming Movies
36
+
37
+ ```ruby
38
+ movies = VSCinemas.coming
39
+ movies.each do |movie|
40
+ puts "Title: #{movie.title}"
41
+ puts "Release Date: #{movie.date}"
42
+ end
43
+ ```
44
+
35
45
  ### Specify Page
36
46
 
37
47
  ```ruby
@@ -44,7 +54,7 @@ end
44
54
  ## Roadmap
45
55
 
46
56
  * [x] Playing Movies
47
- * [ ] Coming Movies
57
+ * [x] Coming Movies
48
58
  * [ ] Movie Detail
49
59
  * [ ] Description
50
60
  * [ ] Playing Version
@@ -8,13 +8,15 @@ module VSCinemas
8
8
  include Enumerable
9
9
 
10
10
  # @since 0.1.0
11
- attr_reader :page, :continue
11
+ attr_reader :type, :page, :continue
12
12
 
13
+ # @param type [String] the list type film or coming
13
14
  # @param page [Number]
14
15
  # @param continue [Boolean]
15
16
  #
16
17
  # @since 0.1.0
17
- def initialize(page: 1, continue: false)
18
+ def initialize(type: 'film', page: 1, continue: false)
19
+ @type = type
18
20
  @page = page
19
21
  @continue = continue
20
22
  end
@@ -42,7 +44,7 @@ module VSCinemas
42
44
  #
43
45
  # @since 0.1.0
44
46
  def uri
45
- @uri ||= URI("#{ENDPOINT}#{PATH}?p=#{page}")
47
+ @uri ||= URI("#{ENDPOINT}/vsweb/film/#{@type == 'coming' ? 'coming' : 'index'}.aspx?p=#{page}")
46
48
  end
47
49
 
48
50
  # Downloaded Web Page
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module VSCinemas
4
- VERSION = '0.1.0'
4
+ VERSION = '0.2.0'
5
5
  end
data/lib/vscinemas.rb CHANGED
@@ -12,9 +12,6 @@ module VSCinemas
12
12
  # @since 0.1.0
13
13
  ENDPOINT = 'https://www.vscinemas.com.tw'
14
14
 
15
- # @since 0.1.0
16
- PATH = '/vsweb/film/index.aspx'
17
-
18
15
  require_relative 'vscinemas/movie_item'
19
16
  require_relative 'vscinemas/movie_list'
20
17
 
@@ -30,4 +27,13 @@ module VSCinemas
30
27
  end
31
28
 
32
29
  alias films movies
30
+
31
+ # Return Comings Movie List
32
+ #
33
+ # @return [VSCinemas::MovieList]
34
+ #
35
+ # @since 0.2.0
36
+ def coming
37
+ MovieList.new(type: 'coming', continue: true)
38
+ end
33
39
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vscinemas
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - 蒼時弦也
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-12-20 00:00:00.000000000 Z
11
+ date: 2021-12-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri