soccer-quiz 0.1.3 → 0.1.4
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/Gemfile.lock +1 -1
- data/bin/console +1 -1
- data/lib/quiz/champion_league.rb +1 -1
- data/lib/quiz/cli.rb +9 -9
- data/lib/quiz/scraper.rb +7 -7
- data/lib/quiz/version.rb +1 -1
- data/soccer-quiz-0.1.3.gem +0 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3c348b134cf12846801932d50d8a101c486106d3a6e1f8f9fb575b7557779f00
|
4
|
+
data.tar.gz: 3a3acc0c49092cee71ee78138b681d8d88993c37946e3fd33d1c06f07c228c44
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: db4ed830f5c676a96d03bbff0c2f1012df85356754c85ab8540aaf036adb5c0047400ae6979096ac1efda2bd59e4e3e27bd7f317939919562db33a4854a0c831
|
7
|
+
data.tar.gz: d7275e8873b9193f17e9feed5ade9891fd11cc5fe31382b15e4f5cca1f9d24e10845dbf180a53843920910966251f6b1c8377cc2ee3eccf913fe5d932030ca5c
|
data/Gemfile.lock
CHANGED
data/bin/console
CHANGED
data/lib/quiz/champion_league.rb
CHANGED
data/lib/quiz/cli.rb
CHANGED
@@ -58,13 +58,9 @@ class Quiz::CLI
|
|
58
58
|
runner_ups = objects.map{|item|item.runner_up}
|
59
59
|
random_year = years.sample
|
60
60
|
random_winner = winners.sample
|
61
|
-
|
62
|
-
instace_for_answers = objects.select{|item|item.year == random_year}
|
63
|
-
|
61
|
+
instace_for_answers = objects.select{|item|item.year == random_year}
|
64
62
|
answer_for_how_many = objects.select{|item|item.winner == random_winner}.size
|
65
|
-
|
66
|
-
winner = instace_for_answers[0].winner
|
67
|
-
|
63
|
+
winner = instace_for_answers[0].winner
|
68
64
|
host = instace_for_answers[0].host
|
69
65
|
runner_up = instace_for_answers[0].runner_up
|
70
66
|
if all_question("none",random_year)[question].include?("host")
|
@@ -81,7 +77,7 @@ class Quiz::CLI
|
|
81
77
|
while obtions.size < 13
|
82
78
|
obtions << counter
|
83
79
|
counter += 1
|
84
|
-
end
|
80
|
+
end
|
85
81
|
multiple_choice(answer_for_how_many,obtions)
|
86
82
|
else
|
87
83
|
puts all_question(winner,random_year)[question]
|
@@ -111,7 +107,6 @@ class Quiz::CLI
|
|
111
107
|
champion_league = Quiz::CHAMPIONLEAGUE.all
|
112
108
|
world_cup = Quiz::Worldcup.all
|
113
109
|
balon_d_or = Quiz::BALONDOR.all
|
114
|
-
|
115
110
|
last_20_champions = []
|
116
111
|
counter = 44
|
117
112
|
while counter < champion_league.size
|
@@ -137,13 +132,17 @@ class Quiz::CLI
|
|
137
132
|
Quiz::CLI.clear
|
138
133
|
end
|
139
134
|
|
135
|
+
|
136
|
+
|
137
|
+
|
140
138
|
def self.points
|
141
139
|
@@points
|
142
140
|
end
|
143
141
|
|
144
142
|
def self.clear
|
145
143
|
@@points.clear
|
146
|
-
end
|
144
|
+
end
|
145
|
+
|
147
146
|
end
|
148
147
|
|
149
148
|
|
@@ -152,3 +151,4 @@ end
|
|
152
151
|
|
153
152
|
|
154
153
|
|
154
|
+
|
data/lib/quiz/scraper.rb
CHANGED
@@ -18,8 +18,8 @@ class Quiz::Scraper
|
|
18
18
|
while counter < players[0].size
|
19
19
|
all_players << {:winner => players[0][counter],:year => players[0][counter + 1]}
|
20
20
|
counter += 2
|
21
|
-
end
|
22
|
-
|
21
|
+
end
|
22
|
+
all_players
|
23
23
|
end
|
24
24
|
|
25
25
|
|
@@ -32,17 +32,17 @@ class Quiz::Scraper
|
|
32
32
|
while counter < world_cup[0].size
|
33
33
|
all_countries << {:year => world_cup[0][counter], :host => world_cup[0][counter + 1], :winner => world_cup[0][counter + 2], :runner_up => world_cup[0][counter + 3], :thirth_place => world_cup[0][counter + 4]}
|
34
34
|
counter += 9
|
35
|
-
end
|
36
|
-
|
35
|
+
end
|
36
|
+
all_countries
|
37
37
|
end
|
38
38
|
|
39
39
|
def self.champion_league
|
40
40
|
champion_league_url = "https://en.wikipedia.org/wiki/List_of_European_Cup_and_UEFA_Champions_League_finals"
|
41
41
|
champion_league_file = "tbody"
|
42
|
-
champions = self.scraper(champion_league_url,champion_league_file).map{|l|l.text.split("\n").reject{|e|e.empty?}}
|
42
|
+
champions = self.scraper(champion_league_url,champion_league_file).map{|l|l.text.split("\n").reject{|e| e.empty?}}
|
43
43
|
2.times{champions.shift}
|
44
44
|
10.times{champions[0].shift}
|
45
|
-
|
45
|
+
23.times{champions[0].pop}#22
|
46
46
|
champions[0].map{|item|item.strip}
|
47
47
|
counter = 0
|
48
48
|
all_teams = []
|
@@ -50,7 +50,7 @@ class Quiz::Scraper
|
|
50
50
|
all_teams << {:year => champions[0][counter], :winner => champions[0][counter + 2], :score => champions[0][counter + 3], :runner_up => champions[0][counter + 5], :host => champions[0][counter + 6]}
|
51
51
|
counter += 8
|
52
52
|
end
|
53
|
-
|
53
|
+
all_teams
|
54
54
|
end
|
55
55
|
end
|
56
56
|
|
data/lib/quiz/version.rb
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: soccer-quiz
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yarvin Hernandez
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-09-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -93,6 +93,7 @@ files:
|
|
93
93
|
- lib/quiz/version.rb
|
94
94
|
- lib/quiz/world_cup.rb
|
95
95
|
- quiz.gemspec
|
96
|
+
- soccer-quiz-0.1.3.gem
|
96
97
|
homepage: https://rubygems.org/gems/soccer_quiz
|
97
98
|
licenses:
|
98
99
|
- MIT
|