-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathwatchman.rb
More file actions
62 lines (51 loc) · 1.02 KB
/
watchman.rb
File metadata and controls
62 lines (51 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
require 'rubygems'
require 'bundler/setup'
require "./db/setup"
Dir.glob('./models/*').each { |r| require r}
require "./db/seed"
puts "There are #{Show.count} in the database"
# output by network
#Network.all.each do |network|
# puts "Shows airing on #{network}"
# network.shows.each do |show|
# puts show
# end
#end
# output all shows
Show.all.each do |show|
puts show
end
puts
puts "What day are you interested in? (eg, Friday)"
answer = gets.chomp
shows = []
Show.all.each do |show|
if show.day_of_week == answer
shows << show
end
end
if shows.size != 0
shows.each do |s|
puts "#{s.name} at #{s.hour_of_day} on #{s.network}"
end
else
puts 'No shows found.'
end
# output all my knitting projects
puts
puts "My current knitting projects: "
Project.all.each do |project|
puts project
end
puts
puts "Which project would you like to see details for?"
answer = gets.chomp
counter = 0
Project.all.each do |proj|
if proj.name == answer
counter += 1
puts proj
break
end
end
puts 'Sorry, project not found.' if counter == 0