soccer-quiz 0.1.4 → 0.1.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3c348b134cf12846801932d50d8a101c486106d3a6e1f8f9fb575b7557779f00
4
- data.tar.gz: 3a3acc0c49092cee71ee78138b681d8d88993c37946e3fd33d1c06f07c228c44
3
+ metadata.gz: 83d1b7f0a4503c846912b2cee8e99ab83e7c5f63598515f51fda558e7c26bb56
4
+ data.tar.gz: a2948b710b67d54274803adcaab90db96f1b0efc96511c282dabd8221c1772ad
5
5
  SHA512:
6
- metadata.gz: db4ed830f5c676a96d03bbff0c2f1012df85356754c85ab8540aaf036adb5c0047400ae6979096ac1efda2bd59e4e3e27bd7f317939919562db33a4854a0c831
7
- data.tar.gz: d7275e8873b9193f17e9feed5ade9891fd11cc5fe31382b15e4f5cca1f9d24e10845dbf180a53843920910966251f6b1c8377cc2ee3eccf913fe5d932030ca5c
6
+ metadata.gz: 1e4c00a7bd40185b53d25d08f7b1d6e16cd3b10dbcd2930295b3483a8e0d830ffed001cb2515da648c654e7d01e37e0899e49ce21023d8a2f361ff731bf8f7f2
7
+ data.tar.gz: 1722039f50710738648b6c7f81d7e979266b40849ad3a2f59ae6369ebae678aeb4cc805583a0ad447b60ebf483c9c34af8104ce5dbbc24654ae30f19717a71f5
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- soccer-quiz (0.1.4)
4
+ soccer-quiz (0.1.5)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/bin/quiz CHANGED
@@ -1,3 +1,29 @@
1
1
  #!/usr/bin/env ruby
2
- require_relative '../lib/quiz'
3
- Quiz::CLI.new.call
2
+ # frozen_string_literal: true
3
+
4
+ #
5
+ # This file was generated by Bundler.
6
+ #
7
+ # The application 'quiz' is installed as part of a gem, and
8
+ # this file is here to facilitate running it.
9
+ #
10
+
11
+ require "pathname"
12
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
13
+ Pathname.new(__FILE__).realpath)
14
+
15
+ bundle_binstub = File.expand_path("../bundle", __FILE__)
16
+
17
+ if File.file?(bundle_binstub)
18
+ if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
19
+ load(bundle_binstub)
20
+ else
21
+ abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
22
+ Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
23
+ end
24
+ end
25
+
26
+ require "rubygems"
27
+ require "bundler/setup"
28
+
29
+ load Gem.bin_path("soccer-quiz", "quiz")
data/lib/quiz/cli.rb CHANGED
@@ -1,6 +1,8 @@
1
1
 
2
2
  class Quiz::CLI
3
3
  @@points = []
4
+ def initialize
5
+ end
4
6
  def call
5
7
  puts "Welcome to football soccer quiz."
6
8
  start_quiz
@@ -58,11 +60,16 @@ class Quiz::CLI
58
60
  runner_ups = objects.map{|item|item.runner_up}
59
61
  random_year = years.sample
60
62
  random_winner = winners.sample
61
- instace_for_answers = objects.select{|item|item.year == random_year}
63
+
64
+ instace_for_answers = objects.select{|item|item.year == random_year}
65
+
62
66
  answer_for_how_many = objects.select{|item|item.winner == random_winner}.size
63
- winner = instace_for_answers[0].winner
67
+
68
+ winner = instace_for_answers[0].winner
69
+
64
70
  host = instace_for_answers[0].host
65
71
  runner_up = instace_for_answers[0].runner_up
72
+
66
73
  if all_question("none",random_year)[question].include?("host")
67
74
  puts all_question(host,random_year)[question]
68
75
  multiple_choice(host,hosts)
@@ -77,7 +84,7 @@ class Quiz::CLI
77
84
  while obtions.size < 13
78
85
  obtions << counter
79
86
  counter += 1
80
- end
87
+ end
81
88
  multiple_choice(answer_for_how_many,obtions)
82
89
  else
83
90
  puts all_question(winner,random_year)[question]
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
- all_players
21
+ end
22
+ all_players
23
23
  end
24
24
 
25
25
 
@@ -32,25 +32,28 @@ 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
35
+ end
36
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?}}
43
- 2.times{champions.shift}
42
+
43
+ champions = self.scraper(champion_league_url,champion_league_file).map{|l|l.text.split("\n").reject{|e|e.empty?}}
44
+ champions[0].shift
45
+ champions.shift
46
+ champions.shift
44
47
  10.times{champions[0].shift}
45
- 23.times{champions[0].pop}#22
46
- champions[0].map{|item|item.strip}
48
+ 23.times{champions[0].pop}
49
+ 7.times{champions[0].delete_at(145)}
47
50
  counter = 0
48
51
  all_teams = []
49
52
  while counter < champions[0].size
50
53
  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
54
  counter += 8
52
55
  end
53
- all_teams
56
+ all_teams
54
57
  end
55
58
  end
56
59
 
data/lib/quiz/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Quiz
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
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
4
+ version: 0.1.5
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-09-26 00:00:00.000000000 Z
11
+ date: 2021-11-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -93,7 +93,6 @@ 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
97
96
  homepage: https://rubygems.org/gems/soccer_quiz
98
97
  licenses:
99
98
  - MIT
Binary file