soccer-quiz 0.1.3 → 0.1.7

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: 02aea3869baa3870430cce2767790a980664079402e3d24d79ff0548c9b34d4f
4
- data.tar.gz: c546abcab96cfb08bcde91da97f41afa95115748b37461e5ff97a7abd94ab89a
3
+ metadata.gz: c797f4bccd8328bdf00c32a36cf4ead489448089047090ae5bec45250377903f
4
+ data.tar.gz: 78499c586db13a4a13bebdc28a2bbb9718b8abb00b06e2b6e859620fbb7720cd
5
5
  SHA512:
6
- metadata.gz: 821d9505685d56f4109b9841140517587b8734745b885ebc4acb410540ecfa158d674ac20faf1266b359c69c1d1245c814b5e07c6db7112e8bedd3f4b0c6b628
7
- data.tar.gz: 2e8ff93c464c5441451bc13a9aff5d76bbde2e41c2e77b4afaceed97733260fd844a7d80d04ba9155fcee65374e59dbb456cae2ce774e6a73218168efb2f9185
6
+ metadata.gz: 315284119de5ee4ef26878f5ff0ba6253a9013e912b5dc92c3220bc5023381cea3935524671fd080548d9e5b167be3891cc1fb4048488c3e43b6d7a80b5a3206
7
+ data.tar.gz: 509e41490c52d49b3e5791ea0ee310ed1e32773143f49f3046282595d99d55b36377fc2007eb823cb0ab3e5e0cd751331db3577ad2457464e3094be1dc758e59
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- soccer-quiz (0.1.2)
4
+ soccer-quiz (0.1.6)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/bin/bundle ADDED
@@ -0,0 +1,114 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ #
5
+ # This file was generated by Bundler.
6
+ #
7
+ # The application 'bundle' is installed as part of a gem, and
8
+ # this file is here to facilitate running it.
9
+ #
10
+
11
+ require "rubygems"
12
+
13
+ m = Module.new do
14
+ module_function
15
+
16
+ def invoked_as_script?
17
+ File.expand_path($0) == File.expand_path(__FILE__)
18
+ end
19
+
20
+ def env_var_version
21
+ ENV["BUNDLER_VERSION"]
22
+ end
23
+
24
+ def cli_arg_version
25
+ return unless invoked_as_script? # don't want to hijack other binstubs
26
+ return unless "update".start_with?(ARGV.first || " ") # must be running `bundle update`
27
+ bundler_version = nil
28
+ update_index = nil
29
+ ARGV.each_with_index do |a, i|
30
+ if update_index && update_index.succ == i && a =~ Gem::Version::ANCHORED_VERSION_PATTERN
31
+ bundler_version = a
32
+ end
33
+ next unless a =~ /\A--bundler(?:[= ](#{Gem::Version::VERSION_PATTERN}))?\z/
34
+ bundler_version = $1
35
+ update_index = i
36
+ end
37
+ bundler_version
38
+ end
39
+
40
+ def gemfile
41
+ gemfile = ENV["BUNDLE_GEMFILE"]
42
+ return gemfile if gemfile && !gemfile.empty?
43
+
44
+ File.expand_path("../../Gemfile", __FILE__)
45
+ end
46
+
47
+ def lockfile
48
+ lockfile =
49
+ case File.basename(gemfile)
50
+ when "gems.rb" then gemfile.sub(/\.rb$/, gemfile)
51
+ else "#{gemfile}.lock"
52
+ end
53
+ File.expand_path(lockfile)
54
+ end
55
+
56
+ def lockfile_version
57
+ return unless File.file?(lockfile)
58
+ lockfile_contents = File.read(lockfile)
59
+ return unless lockfile_contents =~ /\n\nBUNDLED WITH\n\s{2,}(#{Gem::Version::VERSION_PATTERN})\n/
60
+ Regexp.last_match(1)
61
+ end
62
+
63
+ def bundler_version
64
+ @bundler_version ||=
65
+ env_var_version || cli_arg_version ||
66
+ lockfile_version
67
+ end
68
+
69
+ def bundler_requirement
70
+ return "#{Gem::Requirement.default}.a" unless bundler_version
71
+
72
+ bundler_gem_version = Gem::Version.new(bundler_version)
73
+
74
+ requirement = bundler_gem_version.approximate_recommendation
75
+
76
+ return requirement unless Gem::Version.new(Gem::VERSION) < Gem::Version.new("2.7.0")
77
+
78
+ requirement += ".a" if bundler_gem_version.prerelease?
79
+
80
+ requirement
81
+ end
82
+
83
+ def load_bundler!
84
+ ENV["BUNDLE_GEMFILE"] ||= gemfile
85
+
86
+ activate_bundler
87
+ end
88
+
89
+ def activate_bundler
90
+ gem_error = activation_error_handling do
91
+ gem "bundler", bundler_requirement
92
+ end
93
+ return if gem_error.nil?
94
+ require_error = activation_error_handling do
95
+ require "bundler/version"
96
+ end
97
+ return if require_error.nil? && Gem::Requirement.new(bundler_requirement).satisfied_by?(Gem::Version.new(Bundler::VERSION))
98
+ warn "Activating bundler (#{bundler_requirement}) failed:\n#{gem_error.message}\n\nTo install the version of bundler this project requires, run `gem install bundler -v '#{bundler_requirement}'`"
99
+ exit 42
100
+ end
101
+
102
+ def activation_error_handling
103
+ yield
104
+ nil
105
+ rescue StandardError, LoadError => e
106
+ e
107
+ end
108
+ end
109
+
110
+ m.load_bundler!
111
+
112
+ if m.invoked_as_script?
113
+ load Gem.bin_path("bundler", "bundle")
114
+ end
data/bin/console CHANGED
@@ -5,7 +5,7 @@ require "quiz"
5
5
 
6
6
  # (If you use this, don't forget to add pry to your Gemfile!)
7
7
  # require "pry"
8
- # Pry.start
8
+ # Pry.start
9
9
 
10
10
  require "irb"
11
11
  IRB.start(__FILE__)
data/bin/htmldiff ADDED
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ #
5
+ # This file was generated by Bundler.
6
+ #
7
+ # The application 'htmldiff' 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("diff-lcs", "htmldiff")
data/bin/ldiff ADDED
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ #
5
+ # This file was generated by Bundler.
6
+ #
7
+ # The application 'ldiff' 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("diff-lcs", "ldiff")
data/bin/nokogiri ADDED
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ #
5
+ # This file was generated by Bundler.
6
+ #
7
+ # The application 'nokogiri' 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("nokogiri", "nokogiri")
data/bin/quiz CHANGED
@@ -1,3 +1,12 @@
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_relative '../lib/quiz'
12
+ Quiz::CLI.new.call
data/bin/rake ADDED
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ #
5
+ # This file was generated by Bundler.
6
+ #
7
+ # The application 'rake' 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("rake", "rake")
data/bin/rspec ADDED
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ #
5
+ # This file was generated by Bundler.
6
+ #
7
+ # The application 'rspec' 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("rspec-core", "rspec")
@@ -5,7 +5,7 @@ class Quiz::CHAMPIONLEAGUE
5
5
  @@all << self
6
6
  file.each{|key,value|
7
7
  self.send("#{key}=", value)}
8
-
8
+
9
9
  end
10
10
  def self.champion_league_files(file)
11
11
  file.each{|e|Quiz::CHAMPIONLEAGUE.new(e)}
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
@@ -67,6 +69,7 @@ class Quiz::CLI
67
69
 
68
70
  host = instace_for_answers[0].host
69
71
  runner_up = instace_for_answers[0].runner_up
72
+
70
73
  if all_question("none",random_year)[question].include?("host")
71
74
  puts all_question(host,random_year)[question]
72
75
  multiple_choice(host,hosts)
@@ -111,7 +114,6 @@ class Quiz::CLI
111
114
  champion_league = Quiz::CHAMPIONLEAGUE.all
112
115
  world_cup = Quiz::Worldcup.all
113
116
  balon_d_or = Quiz::BALONDOR.all
114
-
115
117
  last_20_champions = []
116
118
  counter = 44
117
119
  while counter < champion_league.size
@@ -137,13 +139,17 @@ class Quiz::CLI
137
139
  Quiz::CLI.clear
138
140
  end
139
141
 
142
+
143
+
144
+
140
145
  def self.points
141
146
  @@points
142
147
  end
143
148
 
144
149
  def self.clear
145
150
  @@points.clear
146
- end
151
+ end
152
+
147
153
  end
148
154
 
149
155
 
@@ -152,3 +158,4 @@ end
152
158
 
153
159
 
154
160
 
161
+
data/lib/quiz/scraper.rb CHANGED
@@ -33,17 +33,20 @@ class Quiz::Scraper
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
35
  end
36
- all_countries
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
+
42
43
  champions = self.scraper(champion_league_url,champion_league_file).map{|l|l.text.split("\n").reject{|e|e.empty?}}
43
- 2.times{champions.shift}
44
+ champions[0].shift
45
+ champions.shift
46
+ champions.shift
44
47
  10.times{champions[0].shift}
45
- 25.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
data/lib/quiz/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Quiz
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.7"
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.3
4
+ version: 0.1.7
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-06-23 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
@@ -81,8 +81,14 @@ files:
81
81
  - LICENSE.txt
82
82
  - README.md
83
83
  - Rakefile
84
+ - bin/bundle
84
85
  - bin/console
86
+ - bin/htmldiff
87
+ - bin/ldiff
88
+ - bin/nokogiri
85
89
  - bin/quiz
90
+ - bin/rake
91
+ - bin/rspec
86
92
  - bin/setup
87
93
  - config/environment.rb
88
94
  - lib/quiz.rb