showtimes 0.2.2 → 0.2.3
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 +4 -4
- data/bin/showtimes +1 -1
- data/lib/showtimes/app.rb +4 -4
- data/lib/showtimes/theater.rb +8 -16
- 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: 96d53fc22af8b67cc2d7a8a3b5aa609872161d41
|
4
|
+
data.tar.gz: 2b8b56a5eb68f440440e9d86108ecbff9098d0b3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 05d394d8234ef489f57a65f25c9bb4a5c8047515dbf4c2805ef8565b4b2b6cdd0588ce3cb249c7e7517a38dedd9df23c362b2033b92f5cd755330217ad7c997d
|
7
|
+
data.tar.gz: 41cbc0c2c8ffd21f5dfb11dd83ebaf8ba9eb9498bca3225d71bed8d680b62d3b267838cef6b6f48fdc97984fc46751301d409683cb4213ac1d4fac631ba49500
|
data/bin/showtimes
CHANGED
data/lib/showtimes/app.rb
CHANGED
@@ -8,10 +8,10 @@ class Showtimes::App
|
|
8
8
|
puts "********** Movie Showtimes Near You **********"
|
9
9
|
puts "**********************************************"
|
10
10
|
puts "\n"
|
11
|
-
|
11
|
+
get_zip_code
|
12
12
|
end
|
13
13
|
|
14
|
-
def
|
14
|
+
def get_zip_code
|
15
15
|
Showtimes::Theater.clear
|
16
16
|
|
17
17
|
puts "What is your zipcode?"
|
@@ -23,7 +23,7 @@ class Showtimes::App
|
|
23
23
|
puts "***** Whoops. Looks like you entered an invalid zipcode. 😩 *****"
|
24
24
|
puts "*****************************************************************"
|
25
25
|
puts "\n"
|
26
|
-
|
26
|
+
get_zip_code
|
27
27
|
end
|
28
28
|
|
29
29
|
Showtimes::Scraper.new.scrape_showtimes(zipcode)
|
@@ -39,7 +39,7 @@ class Showtimes::App
|
|
39
39
|
puts "3: exit"
|
40
40
|
next_up = gets.strip
|
41
41
|
if next_up == "1"
|
42
|
-
|
42
|
+
get_zip_code
|
43
43
|
elsif next_up == "2"
|
44
44
|
theater_selection
|
45
45
|
else
|
data/lib/showtimes/theater.rb
CHANGED
@@ -4,29 +4,21 @@ class Showtimes::Theater
|
|
4
4
|
|
5
5
|
@@all_theaters = []
|
6
6
|
|
7
|
-
def initialize(name=nil, movies=nil)
|
7
|
+
def initialize(name = nil, movies = nil)
|
8
8
|
@name = name
|
9
9
|
@movies = movies
|
10
10
|
@@all_theaters << self
|
11
11
|
end
|
12
12
|
|
13
|
-
def self.new_from_index_page(
|
13
|
+
def self.new_from_index_page(showtimes)
|
14
14
|
movies = []
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
end
|
21
|
-
|
22
|
-
m.css(".times").map do |movie_time|
|
23
|
-
movie[:movie_times] = movie_time.text.split("  ")
|
24
|
-
end
|
25
|
-
|
26
|
-
movies << movie
|
15
|
+
showtimes.css(".showtimes .movie").each do |movie|
|
16
|
+
movies << {
|
17
|
+
movie_name: movie.css(".name a").text,
|
18
|
+
movie_times: movie.css(".times").text.split("  ")
|
19
|
+
}
|
27
20
|
end
|
28
|
-
|
29
|
-
self.new(t.css("h2.name a").text, movies)
|
21
|
+
self.new(showtimes.css("h2.name a").text, movies)
|
30
22
|
end
|
31
23
|
|
32
24
|
def self.all
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: showtimes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marine Boudeau
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-10-
|
11
|
+
date: 2016-10-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|