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 +4 -4
- data/.gitignore +2 -0
- data/lib/fantasyCompare/NFLJSON.rb +26 -19
- data/lib/fantasyCompare/cli.rb +44 -16
- data/lib/fantasyCompare/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f53d9e37a3e024dce12d2639d8fefb60ddde1077
|
4
|
+
data.tar.gz: 1d7125c423992754bd92c71e18b42d9b19d3e897
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e0df96c022c878c21608b32356579c27e7e0b39655434ccca36b00d888989a467cd4fefff07fb069ab45edb77a9c8afea3af37fa99fecbece0578ca31e4d63b0
|
7
|
+
data.tar.gz: 8f8a6fbbcf7d9770825374ec082af0e23ca37ec2b2626eaa36c6569f0d78f209823da28f53259df0fdf57ea04b4eba5142c0dec970190175d5583bbbb0bfb774
|
data/.gitignore
CHANGED
@@ -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
|
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}
|
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
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
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
|
data/lib/fantasyCompare/cli.rb
CHANGED
@@ -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
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
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
|
-
|
22
|
-
|
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
|
-
|
28
|
-
|
29
|
-
|
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
|
-
|
33
|
-
|
34
|
-
puts "Goodbye"
|
61
|
+
FantasyCompare::NFLJSON.next_note
|
62
|
+
|
35
63
|
end
|
36
64
|
end
|