hof_stats 0.1.1 → 0.1.2

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
  SHA1:
3
- metadata.gz: 365fc2f581ee930f1f66d6f7f3223a1fe0c8f165
4
- data.tar.gz: 3c9b94f183a8869f0f9bc64b44e7ed98b0a822fb
3
+ metadata.gz: 0af5b08e65d9347908e2ef9ae4cb76748e5374b9
4
+ data.tar.gz: 37f8ad3b5657f76c6f4c9f2c3454da5fe8a669e9
5
5
  SHA512:
6
- metadata.gz: 895d32466a73a898da1ba486be88d4a1c3f043d62371c300d2c2bd8f39e808468b0e787dea08ccd86f7d4d9c453310077cebab2f8b689c9bc0016de9d73985d5
7
- data.tar.gz: b3d7528e526026687135f269742e8b794b3dab73e990a5cdb26b66d496322255c191e2c1f23671e42d8be811d504ffeaff06feae3212a1655cded637a0503732
6
+ metadata.gz: ab8f4364e806f97cf183820b5022f56e77b47100395471379cb9572195721d6839674f122c8aa83c3311b6a96949c3be9db10f4ccc5988ce4c44d0cfb44b620a
7
+ data.tar.gz: 4faed3f8db0ea6b3b2b7669a14a99a3ef47b96b76182b11c144ef9fe990c290d7eac0699a4019577dfe186870ce4d2723d67f04a702f35448f443ee9db2cea65
Binary file
data/lib/hof_stats/cli.rb CHANGED
@@ -21,16 +21,16 @@ class HofStats::CLI
21
21
  puts "No stats available for #{player.name}."
22
22
  else
23
23
  puts "Position: #{player.position}"
24
- if player.position != "Pitcher"
24
+ if player.position.include? "Pitcher"
25
+ puts "ERA: #{player.era}"
26
+ puts "W/L %: #{player.wlpercent}"
27
+ puts "Strikeouts: #{player.strikeouts}"
28
+ else
25
29
  puts "Games: #{player.games}"
26
30
  puts "Hits: #{player.hits}"
27
31
  puts "Runs: #{player.runs}"
28
32
  puts "Homers: #{player.homers}"
29
33
  puts "Batting Average: #{player.batting_avg}"
30
- else
31
- puts "ERA: #{player.era}"
32
- puts "W/L %: #{player.wlpercent}"
33
- puts "Strikeouts: #{player.strikeouts}"
34
34
  end
35
35
  end
36
36
  end
@@ -42,16 +42,25 @@ class HofStats::CLI
42
42
  puts "Type 'exit' to exit."
43
43
 
44
44
  input = gets.strip.downcase
45
- player = HofStats::Player.all[input.to_i - 1]
46
-
47
- puts "***************************"
48
- list_individual_player(player)
49
- puts "***************************"
50
45
 
51
- puts "Would you like to see another player? (Y or N)"
52
- input = gets.strip.downcase
53
- if input == "y"
46
+ if input == "exit"
47
+ goodbye
48
+ exit()
49
+ elsif input.to_i < 1 || input.to_i > HofStats::Player.all.length
50
+ puts "Please enter a valid line number."
54
51
  menu
52
+ else
53
+ player = HofStats::Player.all[input.to_i - 1]
54
+
55
+ puts "***************************"
56
+ list_individual_player(player)
57
+ puts "***************************"
58
+
59
+ puts "Would you like to see another player? (Y or N)"
60
+ input = gets.strip.downcase
61
+ if input == "y"
62
+ menu
63
+ end
55
64
  end
56
65
  end
57
66
 
@@ -1,3 +1,3 @@
1
1
  module HofStats
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hof_stats
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tony Mastrorio
@@ -98,6 +98,7 @@ files:
98
98
  - bin/console
99
99
  - bin/hof_stats
100
100
  - bin/setup
101
+ - hof_stats-0.1.1.gem
101
102
  - hof_stats.gemspec
102
103
  - lib/hof_stats.rb
103
104
  - lib/hof_stats/cli.rb