avi_says_shit 0.0.3 → 0.0.4

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: 47fe8458935fa23c0cf8c2b7d16dd9408b082fe8
4
- data.tar.gz: 7239d552621f19ed57a02bdbbdb1af21e6f09d8c
3
+ metadata.gz: 9eb36d65dfa8e9f908608d07e8ca0bc29dcc0158
4
+ data.tar.gz: 932f1350aa87bd4774f0d0e6709c8ea2f477f607
5
5
  SHA512:
6
- metadata.gz: 6e0f2216b357a02f916ce743e8765b00714226fbe19634d5a1a6a44a35f0574c6768db0831888ab7c7500e39f3f690fac5245bc339c48ba2a01f2e4921c958a4
7
- data.tar.gz: 0c9dfa41fc91756ef3ded98e6849119b8974eff45e277905f908d418a4b53531d78c1dbcbb9d6161299a4b7346427d7aaeb303adf6fabb28653d9fdb363e4713
6
+ metadata.gz: 5b0ee503f62bb120c788430252558a638beeca386cda93a7b12ce62447f88127492124cc7c9036b2e8f66f636b31fb0463f8afeae91a69100891b92fef36b1fc
7
+ data.tar.gz: 4b6a68c24bad60fdbd55264e1b1bfabb4c46f941ef84be6a6157b3becfaaa56ae7c220d064e0c92eb959f027d854800d8baaf574a009f4f15d853529654f174f
Binary file
Binary file
@@ -2,7 +2,7 @@ require 'rubygems'
2
2
 
3
3
  SPEC = Gem::Specification.new do |s|
4
4
  s.name = "avi_says_shit"
5
- s.version = "0.0.3"
5
+ s.version = "0.0.4"
6
6
  s.author = "Ice-Breakers"
7
7
  s.email = "captaingrover@gmail.com"
8
8
  s.platform = Gem::Platform::RUBY
data/bin/avi CHANGED
@@ -1,228 +1,3 @@
1
1
  #!/usr/bin/env ruby
2
2
  require 'optparse'
3
-
4
- class Hashketball
5
- def initialize
6
- @hashketball = Hash.new
7
- end
8
-
9
- def add_team(team)
10
- @hashketball[team.to_sym] ||= {}
11
- end
12
-
13
- def add_colors(team, color1, color2)
14
- @hashketball[@team.to_sym][:colors] ||= [color1, color2]
15
- end
16
-
17
- def get_colors(team)
18
- @hashketball[team.to_sym][:colors]
19
- end
20
-
21
- def add_player(team, player)
22
- @hashketball[team.to_sym][player.to_sym] ||=Hash.new
23
- end
24
-
25
- ###I would like to make these setters and getters more like attr accessors
26
-
27
- ###I would like to make set_stats capable of taking some but not all values
28
- ###without having to be in order
29
-
30
- def set_stats(team, player, number = nil, shoe_size = nil, pointsdata = nil, reboundsdata = nil, assistsdata = nil, stealsdata = nil, blocksdata = nil, dunksdata = nil)
31
- @hashketball[team.to_sym][player.to_sym][:number] = numberdata
32
- @hashketball[team.to_sym][player.to_sym][:shoe_size] = shoe_sizedata
33
- @hashketball[team.to_sym][player.to_sym][:points] = pointsdata
34
- @hashketball[team.to_sym][player.to_sym][:rebounds] = reboundsdata
35
- @hashketball[team.to_sym][player.to_sym][:assists] = assistsdata
36
- @hashketball[team.to_sym][player.to_sym][:steals] = stealsdata
37
- @hashketball[team.to_sym][player.to_sym][:blocks] = blocksdata
38
- @hashketball[team.to_sym][player.to_sym][:dunks] = dunksdata
39
- end
40
-
41
- def get_stats(team, player)
42
- @hashketball[team.to_sym][player.to_sym]
43
- end
44
-
45
- def set_number(team, player, number)
46
- @hashketball[team.to_sym][player.to_sym][:number] = number
47
- end
48
-
49
- def get_number(team, player)
50
- @hashketball[team.to_sym][player.to_sym][:number]
51
- end
52
-
53
- def set_shoe_size(team, player, shoe_size)
54
- @hashketball[team.to_sym][player.to_sym][:shoe_size] = shoe_size
55
- end
56
-
57
- def get_shoe_size(team, player)
58
- @hashketball[team.to_sym][player.to_sym][:shoe_size]
59
- end
60
-
61
-
62
- def set_points(team, player, points)
63
- @hashketball[team.to_sym][player.to_sym][:points] = points
64
- end
65
-
66
- def get_points(team, player)
67
- @hashketball[team.to_sym][player.to_sym][:points]
68
- end
69
-
70
- def set_rebounds(team, player, rebounds)
71
- @hashketball[team.to_sym][player.to_sym][:rebounds] = rebounds
72
- end
73
-
74
- def get_rebounds(team, player)
75
- @hashketball[team.to_sym][player.to_sym][:rebounds]
76
- end
77
-
78
- def set_assists(team, player, assists)
79
- @hashketball[team.to_sym][player.to_sym][:assists] = assists
80
- end
81
-
82
- def get_assists(team, player)
83
- @hashketball[team.to_sym][player.to_sym][:assists]
84
- end
85
-
86
- def set_steals(team, player, steals)
87
- @hashketball[team.to_sym][player.to_sym][:steals] = steals
88
- end
89
-
90
- def get_steals(team, player)
91
- @hashketball[team.to_sym][player.to_sym][:steals]
92
- end
93
-
94
- def set_blocks(team, player, blocks)
95
- @hashketball[team.to_sym][player.to_sym][:blocks] = blocks
96
- end
97
-
98
- def get_blocks(team, player)
99
- @hashketball[team.to_sym][player.to_sym][:blocks]
100
- end
101
-
102
- def set_dunks(team, player, dunks)
103
- @hashketball[team.to_sym][player.to_sym][:dunks] = dunks
104
- end
105
-
106
- def get_dunks(team, player)
107
- @hashketball[team.to_sym][player.to_sym][:dunks]
108
- end
109
-
110
- def show
111
- puts @hashketball.inspect
112
- end
113
-
114
- def mvp
115
- mvp = Hash.new
116
- temp_max = 0
117
- @hashketball.each_key do |team|
118
- @hashketball[team.to_sym].each_key do |player|
119
- mvp[player.to_sym] = @hashketball[team.to_sym][player.to_sym][:points]
120
- end
121
- end
122
- mvp.each do |key,value|
123
- if value > temp_max
124
- temp_max = value
125
- else
126
- next
127
- end
128
- temp_max
129
- end
130
- mvp_name = mvp.invert[temp_max].to_s
131
- end
132
-
133
- def winner
134
- team_scores = Hash.new
135
- temp_max = 0
136
- @hashketball.each_key do |team|
137
- score = 0
138
- @hashketball[team.to_sym].each_key do |player|
139
- score += @hashketball[team.to_sym][player.to_sym][:points]
140
- team_scores[team.to_sym] = score
141
- end
142
- end
143
- team_scores.each do |key,value|
144
- if value > temp_max
145
- temp_max = value
146
- else
147
- next
148
- end
149
- temp_max
150
- end
151
- winner = team_scores.invert[temp_max].to_s
152
- end
153
-
154
- def longest_name
155
- team_scores = Hash.new
156
- names = []
157
- @hashketball.each_key do |team|
158
- @hashketball[team.to_sym].each_key do |player|
159
- if player != :colors
160
- names << player.to_s
161
- else
162
- next
163
- end
164
- end
165
- end
166
- longest_name = names.sort{|x,y| y.length <=> x.length}[0]
167
- end
168
-
169
- end
170
-
171
-
172
- ###########Sample Data##################
173
-
174
- # bball=Hashketball.new
175
- # bball.add_team("Sonics")
176
- # bball.add_team("Hoyas")
177
- # bball.add_player("Hoyas", "Roy Hibbert")
178
- # bball.add_player("Hoyas", "Jeff Greene")
179
- # bball.add_player("Hoyas", "Greg Monroe")
180
- # bball.add_player("Hoyas", "Tikembe Mathambo")
181
- # bball.add_player("Sonics", "Ray Allen")
182
- # bball.add_player("Sonics", "Gary Payton")
183
- # bball.set_stats("Hoyas", "Roy Hibbert", 1, 14, 27, 10, 6, 1, 1, 1)
184
- # bball.set_stats("Hoyas", "Jeff Greene", 2, 12, 20)
185
- # bball.set_stats("Hoyas", "Greg Monroe", 3, 13, 23)
186
- # bball.set_stats("Hoyas", "Tikembe Mathambo", 4, 15, 15)
187
- # bball.set_stats("Sonics", "Ray Allen", 1, 11, 51)
188
- # bball.set_stats("Sonics", "Gary Payton", 2, 11, 50)
189
-
190
-
191
- ################################ Planning Phase ##################################
192
-
193
- # game => team1, team2
194
- # team 1 => name, colors, players ##array of hashes
195
- # name = DATA(primary)
196
- # colors = DATA, DATA ##array
197
- # players => name, points, rebounds, assists, steals, blocks, dunks ##hash of arrays
198
- # name = DATA(primary)
199
- # points = DATA
200
- # rebounds = DATA
201
- # assists = DATA
202
- # steals = DATA
203
- # blocks = DATA
204
- # dunks = DATA
205
- # team 2 => name, colors, players
206
- # name = DATA(primary)
207
- # colors = DATA, DATA
208
- # players => name, points, rebounds, assists, steals, blocks, dunks
209
- # name = DATA(primary)
210
- # points = DATA
211
- # rebounds = DATA
212
- # assists = DATA
213
- # steals = DATA
214
- # blocks = DATA
215
- # dunks = DATA
216
-
217
- # vs. the model:
218
-
219
- # organized_library => artist, artist, artist
220
- # artist => name, album, album, album ##hash of hashes
221
- # name = DATA(primary)
222
- # album = name, tracks ##hash of arrays
223
- # name = DATA(primary)
224
- # tracks = DATA
225
-
226
- # organized_library[artist.to_sym] ||={}
227
- # organized_library[artist.to_sym][album.to_sym] ||=[]
228
- # organized_library[artist.to_sym][album.to_sym] << track
3
+ subl test.rb
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: avi_says_shit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ice-Breakers
@@ -20,6 +20,7 @@ files:
20
20
  - avi-0.0.1.gem
21
21
  - avi_says_shit-0.0.1.gem
22
22
  - avi_says_shit-0.0.2.gem
23
+ - avi_says_shit-0.0.3.gem
23
24
  - avi_says_shit.gemspec
24
25
  - bin/avi
25
26
  homepage: https://github.com/desmondrawls/avi_says_shit.git