fantasyCompare 0.1.2 → 0.1.3

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: 5f13cca1083a8f67c798109b9493c1a26594b0cc
4
- data.tar.gz: a9d0f0a5541a0874594385e7132fff10dc588a4f
3
+ metadata.gz: f53d9e37a3e024dce12d2639d8fefb60ddde1077
4
+ data.tar.gz: 1d7125c423992754bd92c71e18b42d9b19d3e897
5
5
  SHA512:
6
- metadata.gz: 8eaba05b6f380ca50ae063bb4eb848b6da137a94d8697e5b90ef879bb82c65e5cbe5dca1707faaa48d537605ac2e8193ba2703822907d26a87c303722b165ae8
7
- data.tar.gz: 54cb3697d9960ce52cfbf543c47290a188215a57ae36640412c769ae8adb9d04df9fea0a88dbee1e0db7a7c13b9ff3c0a373ebb0f6d55ac7dcef3fad19102077
6
+ metadata.gz: e0df96c022c878c21608b32356579c27e7e0b39655434ccca36b00d888989a467cd4fefff07fb069ab45edb77a9c8afea3af37fa99fecbece0578ca31e4d63b0
7
+ data.tar.gz: 8f8a6fbbcf7d9770825374ec082af0e23ca37ec2b2626eaa36c6569f0d78f209823da28f53259df0fdf57ea04b4eba5142c0dec970190175d5583bbbb0bfb774
data/.gitignore CHANGED
@@ -8,3 +8,5 @@
8
8
  /spec/reports/
9
9
  /tmp/
10
10
  fantasyCompare-0.1.0.gem
11
+ fantasyCompare-0.1.2.gem
12
+ fantasyCompare-0.1.3.gem
@@ -54,7 +54,7 @@ class FantasyCompare::NFLJSON
54
54
 
55
55
  #obtain detail veiw of player
56
56
  def self.detail_player_view(info)
57
- info = info.to_i - 1
57
+ info
58
58
  @playerId = @top_ten[info][:playerId]
59
59
  @playerName = @top_ten[info][:name]
60
60
  @projectedPoints = @top_ten[info][:weekProjectedPts]
@@ -72,27 +72,34 @@ class FantasyCompare::NFLJSON
72
72
  @note << "Date: #{key["timestamp"]}\n #{key["body"] + key["analysis"]}"
73
73
  end
74
74
  end
75
- @detail = "Status: #{status} \nInjury Status: #{injury} \n #{@note.first}"
76
-
75
+ @detail = "Status: #{status} \nInjury Status: #{injury}\n"
77
76
  end
78
77
 
79
78
  #used to display addtional notes
80
- def self.next_note(note_number)
81
- puts "\nWould you like to see additional notes (Y/N)?"
82
- addtional_notes = gets.chomp
83
- if addtional_notes[0].capitalize == "Y" && note_number <= @note.length-1
84
- puts @note[note_number]
85
- note_number += 1
86
- self.next_note(note_number)
87
- elsif note_number > @note.length-1 && addtional_notes[0].capitalize == "Y"
88
- puts "There are no more notes"
89
- puts "Would You like to see details on another player(Y/N)?"
90
- do_again = gets.chomp
91
- elsif addtional_notes[0].capitalize == "N"
92
- puts "Would You like to see details on another position(Y/N)?"
93
- do_again = gets.chomp
94
- elsif do_again[0].capitalize == "Y"
95
- FantasyCompare::CLI.new.call
79
+ def self.next_note
80
+ addtional_notes = "Y"
81
+ note_number = 1
82
+
83
+ while note_number < @note.length - 1 && addtional_notes[0].capitalize == "Y"
84
+ puts @note[note_number]
85
+ note_number += 1
86
+
87
+ if note_number >= @note.length-1
88
+ puts "\nThere are no more notes"
89
+ puts "\nWould you like to see additional positions (Y/N)?"
90
+ FantasyCompare::CLI.new.call if gets.chomp[0].capitalize == "Y"
91
+ addtional_notes = "N"
92
+ else
93
+ puts "\nWould you like to see additional notes (Y/N)?"
94
+ addtional_notes = gets.chomp
95
+
96
+ if addtional_notes[0].capitalize == "N"
97
+ puts "\nWould you like to see additional positions (Y/N)?"
98
+ FantasyCompare::CLI.new.call if gets.chomp[0].capitalize == "Y"
99
+ end
100
+ end
96
101
  end
102
+
97
103
  end
104
+
98
105
  end
@@ -1,5 +1,4 @@
1
1
  class FantasyCompare::CLI
2
- attr_accessor :list
3
2
 
4
3
  def call
5
4
  inputs
@@ -9,28 +8,57 @@ class FantasyCompare::CLI
9
8
  # Mai CLI functionality
10
9
  def inputs
11
10
  positions = ["QB","RB","WR","TE","K","DEF"]
11
+
12
+ # Select position to look at
12
13
  puts "Please pick a position (1-6) \n1.QB\n2.RB\n3.WR\n4.Te\n5.K\n6.DEF"
13
14
  pos_input = gets.chomp
14
15
  pos_input = pos_input.to_i-1
15
- if !pos_input.between?(0,5)
16
- puts "Invalid Input"
17
- inputs
18
- else
19
- @position = positions[pos_input]
16
+
17
+ # Validate position data
18
+ while !pos_input.between?(0,5)
19
+ puts "Invalid Input\n"
20
+ puts "Please pick a position (1-6) \n1.QB\n2.RB\n3.WR\n4.Te\n5.K\n6.DEF"
21
+ pos_input = gets.chomp
22
+ pos_input = pos_input.to_i-1
23
+ end
24
+ position = positions[pos_input]
25
+
26
+ # Select week
27
+ puts "Please select a week for stats (1-17)"
28
+ week = gets.chomp
29
+ week = week.to_i
30
+
31
+ # Validate week data
32
+ while !week.between?(1,17)
33
+ puts "Invalid Input\n"
34
+ puts "Please select a week for stats (1-17)"
35
+ week = gets.chomp
36
+ week = week.to_i
20
37
  end
21
- puts "Please select a week for stats"
22
- @week = gets.chomp
23
- FantasyCompare::NFLJSON.url(@position, @week)
38
+
39
+ FantasyCompare::NFLJSON.url(position, week)
24
40
  FantasyCompare::NFLJSON.players
25
- puts "Please select a team to find out more info"
41
+ puts "Please select a team to find out more info (1-10)\n\n"
26
42
  FantasyCompare::NFLJSON.list
27
- @info = gets.chomp
28
- FantasyCompare::NFLJSON.detail_player_view(@info)
29
- puts "Information for this team is as follows"
43
+
44
+ #Select player for detail veiw
45
+ info = gets.chomp
46
+ info = info.to_i
47
+
48
+ #Validate input
49
+ while !info.between?(1,10)
50
+ puts "Invalid Input\n"
51
+ puts "Please select a team to find out more info (1-10)\n\n"
52
+ FantasyCompare::NFLJSON.list
53
+ info = gets.chomp
54
+ info = info.to_i
55
+ end
56
+
57
+ FantasyCompare::NFLJSON.detail_player_view(info)
58
+ puts "Information for this team is as follows\n\n"
30
59
  FantasyCompare::NFLJSON.detail_url
31
60
  puts FantasyCompare::NFLJSON.show_detail_veiw
32
- puts @detail
33
- FantasyCompare::NFLJSON.next_note(1) #increments notes
34
- puts "Goodbye"
61
+ FantasyCompare::NFLJSON.next_note
62
+
35
63
  end
36
64
  end
@@ -1,3 +1,3 @@
1
1
  module FantasyCompare
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fantasyCompare
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Verdone