greenmonster 0.3.1 → 0.3.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.
- data/.gitignore +1 -0
- data/CHANGELOG.markdown +6 -0
- data/README.markdown +37 -2
- data/doc/Athlete.html +254 -0
- data/doc/Gemfile.html +20 -0
- data/doc/Greenmonster/Generators/InstallGenerator.html +253 -0
- data/doc/Greenmonster/Generators.html +147 -0
- data/doc/Greenmonster/Parser.html +263 -0
- data/doc/Greenmonster/Player.html +236 -0
- data/doc/Greenmonster/Spider.html +169 -21
- data/doc/Greenmonster.html +139 -2
- data/doc/GreenmonsterPlayerTest.html +199 -0
- data/doc/GreenmonsterSpiderTest.html +57 -4
- data/doc/GreenmonsterTest.html +20 -0
- data/doc/GreenmonsterTraversalTest.html +376 -0
- data/doc/InstallGreenmonster.html +260 -0
- data/doc/Rakefile.html +20 -0
- data/doc/TestCreatePlayersFromGamedayXMLGame.html +266 -0
- data/doc/TestParsePlayersFromGamedayXMLFiles.html +307 -0
- data/doc/created.rid +18 -9
- data/doc/index.html +20 -0
- data/doc/js/search_index.js +1 -1
- data/doc/table_of_contents.html +93 -1
- data/greenmonster.gemspec +4 -2
- data/lib/generators/greenmonster/install_mlb_games_generator.rb +20 -0
- data/lib/generators/greenmonster/install_players_generator.rb +20 -0
- data/lib/generators/templates/install_greenmonster_mlb_games_migration.rb +54 -0
- data/lib/generators/templates/install_greenmonster_players_migration.rb +37 -0
- data/lib/greenmonster/model_extensions/mlb_game.rb +106 -0
- data/lib/greenmonster/model_extensions/mlb_probable_pitcher.rb +11 -0
- data/lib/greenmonster/model_extensions/player.rb +16 -0
- data/lib/greenmonster/parser.rb +27 -0
- data/lib/greenmonster/spider.rb +7 -6
- data/lib/greenmonster/version.rb +1 -1
- data/lib/greenmonster.rb +46 -0
- data/test/games/mlb/year_2011/month_07/day_04/gid_2011_07_04_tormlb_bosmlb_1/boxscore.xml +5 -0
- data/test/games/mlb/year_2011/month_07/day_04/gid_2011_07_04_tormlb_bosmlb_1/eventLog.xml +1 -0
- data/test/games/mlb/year_2011/month_07/day_04/gid_2011_07_04_tormlb_bosmlb_1/inning/inning_all.xml +1 -0
- data/test/games/mlb/year_2011/month_07/day_04/gid_2011_07_04_tormlb_bosmlb_1/inning/inning_hit.xml +1 -0
- data/test/games/mlb/year_2011/month_07/day_04/gid_2011_07_04_tormlb_bosmlb_1/linescore.xml +117 -0
- data/test/games/mlb/year_2011/month_07/day_04/gid_2011_07_04_tormlb_bosmlb_1/players.xml +56 -0
- data/test/games/mlb/year_2012/month_03/day_27/gid_2012_03_27_aaamlb_aabmlb_1/blank.txt +0 -0
- data/test/games/tst/year_2012/month_03/day_27/gid_2012_03_27_aaamlb_aabmlb_1/blank.txt +0 -0
- data/test/test_create_mlb_game_from_gameday_xml_game.rb +12 -0
- data/test/test_create_players_from_gameday_xml_game.rb +8 -0
- data/test/test_greenmonster.rb +3 -6
- data/test/test_greenmonster_player.rb +7 -0
- data/test/test_greenmonster_spider.rb +24 -18
- data/test/test_greenmonster_traversal.rb +31 -0
- data/test/test_helper.rb +78 -0
- data/test/test_line_score.rb +12 -0
- data/test/test_parse_mlb_probable_pitchers_from_linescore_data.rb +14 -0
- data/test/test_parse_players_from_gameday_xml_files.rb +21 -0
- data/test/test_update_mlb_game_with_linescore_data.rb +23 -0
- metadata +103 -7
data/doc/Rakefile.html
CHANGED
@@ -63,12 +63,32 @@
|
|
63
63
|
|
64
64
|
<li><a href="./Greenmonster.html">Greenmonster</a>
|
65
65
|
|
66
|
+
<li><a href="./Greenmonster/Generators.html">Greenmonster::Generators</a>
|
67
|
+
|
68
|
+
<li><a href="./Greenmonster/Generators/InstallGenerator.html">Greenmonster::Generators::InstallGenerator</a>
|
69
|
+
|
70
|
+
<li><a href="./Greenmonster/Parser.html">Greenmonster::Parser</a>
|
71
|
+
|
72
|
+
<li><a href="./Greenmonster/Player.html">Greenmonster::Player</a>
|
73
|
+
|
66
74
|
<li><a href="./Greenmonster/Spider.html">Greenmonster::Spider</a>
|
67
75
|
|
76
|
+
<li><a href="./Athlete.html">Athlete</a>
|
77
|
+
|
78
|
+
<li><a href="./GreenmonsterPlayerTest.html">GreenmonsterPlayerTest</a>
|
79
|
+
|
68
80
|
<li><a href="./GreenmonsterSpiderTest.html">GreenmonsterSpiderTest</a>
|
69
81
|
|
70
82
|
<li><a href="./GreenmonsterTest.html">GreenmonsterTest</a>
|
71
83
|
|
84
|
+
<li><a href="./GreenmonsterTraversalTest.html">GreenmonsterTraversalTest</a>
|
85
|
+
|
86
|
+
<li><a href="./InstallGreenmonster.html">InstallGreenmonster</a>
|
87
|
+
|
88
|
+
<li><a href="./TestCreatePlayersFromGamedayXMLGame.html">TestCreatePlayersFromGamedayXMLGame</a>
|
89
|
+
|
90
|
+
<li><a href="./TestParsePlayersFromGamedayXMLFiles.html">TestParsePlayersFromGamedayXMLFiles</a>
|
91
|
+
|
72
92
|
</ul>
|
73
93
|
</nav>
|
74
94
|
|
@@ -0,0 +1,266 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
|
6
|
+
|
7
|
+
<title>class TestCreatePlayersFromGamedayXMLGame - RDoc Documentation</title>
|
8
|
+
|
9
|
+
<link type="text/css" media="screen" href="./rdoc.css" rel="stylesheet">
|
10
|
+
|
11
|
+
<script type="text/javascript">
|
12
|
+
var rdoc_rel_prefix = "./";
|
13
|
+
</script>
|
14
|
+
|
15
|
+
<script type="text/javascript" charset="utf-8" src="./js/jquery.js"></script>
|
16
|
+
<script type="text/javascript" charset="utf-8" src="./js/navigation.js"></script>
|
17
|
+
<script type="text/javascript" charset="utf-8" src="./js/search_index.js"></script>
|
18
|
+
<script type="text/javascript" charset="utf-8" src="./js/search.js"></script>
|
19
|
+
<script type="text/javascript" charset="utf-8" src="./js/searcher.js"></script>
|
20
|
+
<script type="text/javascript" charset="utf-8" src="./js/darkfish.js"></script>
|
21
|
+
|
22
|
+
|
23
|
+
<body id="top" class="class">
|
24
|
+
<nav id="metadata">
|
25
|
+
<nav id="home-section" class="section">
|
26
|
+
<h3 class="section-header">
|
27
|
+
<a href="./index.html">Home</a>
|
28
|
+
<a href="./table_of_contents.html#classes">Classes</a>
|
29
|
+
<a href="./table_of_contents.html#methods">Methods</a>
|
30
|
+
</h3>
|
31
|
+
</nav>
|
32
|
+
|
33
|
+
|
34
|
+
<nav id="search-section" class="section project-section" class="initially-hidden">
|
35
|
+
<form action="#" method="get" accept-charset="utf-8">
|
36
|
+
<h3 class="section-header">
|
37
|
+
<input type="text" name="search" placeholder="Search" id="search-field"
|
38
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
39
|
+
</h3>
|
40
|
+
</form>
|
41
|
+
|
42
|
+
<ul id="search-results" class="initially-hidden"></ul>
|
43
|
+
</nav>
|
44
|
+
|
45
|
+
|
46
|
+
<div id="file-metadata">
|
47
|
+
<nav id="file-list-section" class="section">
|
48
|
+
<h3 class="section-header">Defined In</h3>
|
49
|
+
<ul>
|
50
|
+
<li>test/test_create_players_from_gameday_xml_game.rb
|
51
|
+
</ul>
|
52
|
+
</nav>
|
53
|
+
|
54
|
+
|
55
|
+
</div>
|
56
|
+
|
57
|
+
<div id="class-metadata">
|
58
|
+
|
59
|
+
<nav id="parent-class-section" class="section">
|
60
|
+
<h3 class="section-header">Parent</h3>
|
61
|
+
|
62
|
+
<p class="link">MiniTest::Unit::TestCase
|
63
|
+
|
64
|
+
</nav>
|
65
|
+
|
66
|
+
|
67
|
+
<!-- Method Quickref -->
|
68
|
+
<nav id="method-list-section" class="section">
|
69
|
+
<h3 class="section-header">Methods</h3>
|
70
|
+
|
71
|
+
<ul class="link-list">
|
72
|
+
|
73
|
+
<li><a href="#method-i-setup">#setup</a>
|
74
|
+
|
75
|
+
<li><a href="#method-i-teardown">#teardown</a>
|
76
|
+
|
77
|
+
<li><a href="#method-i-test_create_players_from_gameday_xml_game">#test_create_players_from_gameday_xml_game</a>
|
78
|
+
|
79
|
+
</ul>
|
80
|
+
</nav>
|
81
|
+
|
82
|
+
</div>
|
83
|
+
|
84
|
+
<div id="project-metadata">
|
85
|
+
<nav id="fileindex-section" class="section project-section">
|
86
|
+
<h3 class="section-header">Pages</h3>
|
87
|
+
|
88
|
+
<ul>
|
89
|
+
|
90
|
+
<li class="file"><a href="./Gemfile.html">Gemfile</a>
|
91
|
+
|
92
|
+
<li class="file"><a href="./Rakefile.html">Rakefile</a>
|
93
|
+
|
94
|
+
</ul>
|
95
|
+
</nav>
|
96
|
+
|
97
|
+
<nav id="classindex-section" class="section project-section">
|
98
|
+
<h3 class="section-header">Class and Module Index</h3>
|
99
|
+
|
100
|
+
<ul class="link-list">
|
101
|
+
|
102
|
+
<li><a href="./Greenmonster.html">Greenmonster</a>
|
103
|
+
|
104
|
+
<li><a href="./Greenmonster/Generators.html">Greenmonster::Generators</a>
|
105
|
+
|
106
|
+
<li><a href="./Greenmonster/Generators/InstallGenerator.html">Greenmonster::Generators::InstallGenerator</a>
|
107
|
+
|
108
|
+
<li><a href="./Greenmonster/Parser.html">Greenmonster::Parser</a>
|
109
|
+
|
110
|
+
<li><a href="./Greenmonster/Player.html">Greenmonster::Player</a>
|
111
|
+
|
112
|
+
<li><a href="./Greenmonster/Spider.html">Greenmonster::Spider</a>
|
113
|
+
|
114
|
+
<li><a href="./Athlete.html">Athlete</a>
|
115
|
+
|
116
|
+
<li><a href="./GreenmonsterPlayerTest.html">GreenmonsterPlayerTest</a>
|
117
|
+
|
118
|
+
<li><a href="./GreenmonsterSpiderTest.html">GreenmonsterSpiderTest</a>
|
119
|
+
|
120
|
+
<li><a href="./GreenmonsterTest.html">GreenmonsterTest</a>
|
121
|
+
|
122
|
+
<li><a href="./GreenmonsterTraversalTest.html">GreenmonsterTraversalTest</a>
|
123
|
+
|
124
|
+
<li><a href="./InstallGreenmonster.html">InstallGreenmonster</a>
|
125
|
+
|
126
|
+
<li><a href="./TestCreatePlayersFromGamedayXMLGame.html">TestCreatePlayersFromGamedayXMLGame</a>
|
127
|
+
|
128
|
+
<li><a href="./TestParsePlayersFromGamedayXMLFiles.html">TestParsePlayersFromGamedayXMLFiles</a>
|
129
|
+
|
130
|
+
</ul>
|
131
|
+
</nav>
|
132
|
+
|
133
|
+
</div>
|
134
|
+
</nav>
|
135
|
+
|
136
|
+
<div id="documentation">
|
137
|
+
<h1 class="class">class TestCreatePlayersFromGamedayXMLGame</h1>
|
138
|
+
|
139
|
+
<div id="description" class="description">
|
140
|
+
|
141
|
+
</div><!-- description -->
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
|
146
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
147
|
+
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
<!-- Methods -->
|
156
|
+
|
157
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section section">
|
158
|
+
<h3 class="section-header">Public Instance Methods</h3>
|
159
|
+
|
160
|
+
|
161
|
+
<div id="method-i-setup" class="method-detail ">
|
162
|
+
|
163
|
+
<div class="method-heading">
|
164
|
+
<span class="method-name">setup</span><span
|
165
|
+
class="method-args">()</span>
|
166
|
+
<span class="method-click-advice">click to toggle source</span>
|
167
|
+
</div>
|
168
|
+
|
169
|
+
|
170
|
+
<div class="method-description">
|
171
|
+
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
|
176
|
+
<div class="method-source-code" id="setup-source">
|
177
|
+
<pre><span class="ruby-comment"># File test/test_create_players_from_gameday_xml_game.rb, line 29</span>
|
178
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">setup</span>
|
179
|
+
<span class="ruby-constant">Greenmonster</span>.<span class="ruby-identifier">set_games_folder</span>(<span class="ruby-string">'./greenmonster_test_games'</span>)
|
180
|
+
<span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">mkdir_p</span> <span class="ruby-constant">Greenmonster</span>.<span class="ruby-identifier">games_folder</span>
|
181
|
+
<span class="ruby-constant">Greenmonster</span><span class="ruby-operator">::</span><span class="ruby-constant">Spider</span>.<span class="ruby-identifier">pull_game</span>(<span class="ruby-string">'gid_2011_07_04_tormlb_bosmlb_1'</span>, {<span class="ruby-value">:print_games</span> =<span class="ruby-operator">></span> <span class="ruby-keyword">false</span>})
|
182
|
+
<span class="ruby-keyword">end</span></pre>
|
183
|
+
</div><!-- setup-source -->
|
184
|
+
|
185
|
+
</div>
|
186
|
+
|
187
|
+
|
188
|
+
|
189
|
+
|
190
|
+
</div><!-- setup-method -->
|
191
|
+
|
192
|
+
|
193
|
+
<div id="method-i-teardown" class="method-detail ">
|
194
|
+
|
195
|
+
<div class="method-heading">
|
196
|
+
<span class="method-name">teardown</span><span
|
197
|
+
class="method-args">()</span>
|
198
|
+
<span class="method-click-advice">click to toggle source</span>
|
199
|
+
</div>
|
200
|
+
|
201
|
+
|
202
|
+
<div class="method-description">
|
203
|
+
|
204
|
+
|
205
|
+
|
206
|
+
|
207
|
+
|
208
|
+
<div class="method-source-code" id="teardown-source">
|
209
|
+
<pre><span class="ruby-comment"># File test/test_create_players_from_gameday_xml_game.rb, line 35</span>
|
210
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">teardown</span>
|
211
|
+
<span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">remove_dir</span> <span class="ruby-constant">Greenmonster</span>.<span class="ruby-identifier">games_folder</span>
|
212
|
+
<span class="ruby-keyword">end</span></pre>
|
213
|
+
</div><!-- teardown-source -->
|
214
|
+
|
215
|
+
</div>
|
216
|
+
|
217
|
+
|
218
|
+
|
219
|
+
|
220
|
+
</div><!-- teardown-method -->
|
221
|
+
|
222
|
+
|
223
|
+
<div id="method-i-test_create_players_from_gameday_xml_game" class="method-detail ">
|
224
|
+
|
225
|
+
<div class="method-heading">
|
226
|
+
<span class="method-name">test_create_players_from_gameday_xml_game</span><span
|
227
|
+
class="method-args">()</span>
|
228
|
+
<span class="method-click-advice">click to toggle source</span>
|
229
|
+
</div>
|
230
|
+
|
231
|
+
|
232
|
+
<div class="method-description">
|
233
|
+
|
234
|
+
|
235
|
+
|
236
|
+
|
237
|
+
|
238
|
+
<div class="method-source-code" id="test_create_players_from_gameday_xml_game-source">
|
239
|
+
<pre><span class="ruby-comment"># File test/test_create_players_from_gameday_xml_game.rb, line 24</span>
|
240
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">test_create_players_from_gameday_xml_game</span>
|
241
|
+
<span class="ruby-constant">Athlete</span>.<span class="ruby-identifier">create_from_gameday_xml_game</span>(<span class="ruby-string">'gid_2011_07_04_tormlb_bosmlb_1'</span>)
|
242
|
+
<span class="ruby-identifier">assert_equal</span> <span class="ruby-value">50</span>, <span class="ruby-constant">Athlete</span>.<span class="ruby-identifier">all</span>.<span class="ruby-identifier">count</span>
|
243
|
+
<span class="ruby-keyword">end</span></pre>
|
244
|
+
</div><!-- test_create_players_from_gameday_xml_game-source -->
|
245
|
+
|
246
|
+
</div>
|
247
|
+
|
248
|
+
|
249
|
+
|
250
|
+
|
251
|
+
</div><!-- test_create_players_from_gameday_xml_game-method -->
|
252
|
+
|
253
|
+
|
254
|
+
</section><!-- public-instance-method-details -->
|
255
|
+
|
256
|
+
</section><!-- 5Buntitled-5D -->
|
257
|
+
|
258
|
+
</div><!-- documentation -->
|
259
|
+
|
260
|
+
|
261
|
+
<footer id="validator-badges">
|
262
|
+
<p><a href="http://validator.w3.org/check/referer">[Validate]</a>
|
263
|
+
<p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.
|
264
|
+
<p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
|
265
|
+
</footer>
|
266
|
+
|
@@ -0,0 +1,307 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
|
6
|
+
|
7
|
+
<title>class TestParsePlayersFromGamedayXMLFiles - RDoc Documentation</title>
|
8
|
+
|
9
|
+
<link type="text/css" media="screen" href="./rdoc.css" rel="stylesheet">
|
10
|
+
|
11
|
+
<script type="text/javascript">
|
12
|
+
var rdoc_rel_prefix = "./";
|
13
|
+
</script>
|
14
|
+
|
15
|
+
<script type="text/javascript" charset="utf-8" src="./js/jquery.js"></script>
|
16
|
+
<script type="text/javascript" charset="utf-8" src="./js/navigation.js"></script>
|
17
|
+
<script type="text/javascript" charset="utf-8" src="./js/search_index.js"></script>
|
18
|
+
<script type="text/javascript" charset="utf-8" src="./js/search.js"></script>
|
19
|
+
<script type="text/javascript" charset="utf-8" src="./js/searcher.js"></script>
|
20
|
+
<script type="text/javascript" charset="utf-8" src="./js/darkfish.js"></script>
|
21
|
+
|
22
|
+
|
23
|
+
<body id="top" class="class">
|
24
|
+
<nav id="metadata">
|
25
|
+
<nav id="home-section" class="section">
|
26
|
+
<h3 class="section-header">
|
27
|
+
<a href="./index.html">Home</a>
|
28
|
+
<a href="./table_of_contents.html#classes">Classes</a>
|
29
|
+
<a href="./table_of_contents.html#methods">Methods</a>
|
30
|
+
</h3>
|
31
|
+
</nav>
|
32
|
+
|
33
|
+
|
34
|
+
<nav id="search-section" class="section project-section" class="initially-hidden">
|
35
|
+
<form action="#" method="get" accept-charset="utf-8">
|
36
|
+
<h3 class="section-header">
|
37
|
+
<input type="text" name="search" placeholder="Search" id="search-field"
|
38
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
39
|
+
</h3>
|
40
|
+
</form>
|
41
|
+
|
42
|
+
<ul id="search-results" class="initially-hidden"></ul>
|
43
|
+
</nav>
|
44
|
+
|
45
|
+
|
46
|
+
<div id="file-metadata">
|
47
|
+
<nav id="file-list-section" class="section">
|
48
|
+
<h3 class="section-header">Defined In</h3>
|
49
|
+
<ul>
|
50
|
+
<li>test/test_parse_players_from_gameday_xml_files.rb
|
51
|
+
</ul>
|
52
|
+
</nav>
|
53
|
+
|
54
|
+
|
55
|
+
</div>
|
56
|
+
|
57
|
+
<div id="class-metadata">
|
58
|
+
|
59
|
+
<nav id="parent-class-section" class="section">
|
60
|
+
<h3 class="section-header">Parent</h3>
|
61
|
+
|
62
|
+
<p class="link">MiniTest::Unit::TestCase
|
63
|
+
|
64
|
+
</nav>
|
65
|
+
|
66
|
+
|
67
|
+
<!-- Method Quickref -->
|
68
|
+
<nav id="method-list-section" class="section">
|
69
|
+
<h3 class="section-header">Methods</h3>
|
70
|
+
|
71
|
+
<ul class="link-list">
|
72
|
+
|
73
|
+
<li><a href="#method-i-setup">#setup</a>
|
74
|
+
|
75
|
+
<li><a href="#method-i-teardown">#teardown</a>
|
76
|
+
|
77
|
+
<li><a href="#method-i-test_parse_players_from_game">#test_parse_players_from_game</a>
|
78
|
+
|
79
|
+
<li><a href="#method-i-test_player_ids_stored_as_integers">#test_player_ids_stored_as_integers</a>
|
80
|
+
|
81
|
+
</ul>
|
82
|
+
</nav>
|
83
|
+
|
84
|
+
</div>
|
85
|
+
|
86
|
+
<div id="project-metadata">
|
87
|
+
<nav id="fileindex-section" class="section project-section">
|
88
|
+
<h3 class="section-header">Pages</h3>
|
89
|
+
|
90
|
+
<ul>
|
91
|
+
|
92
|
+
<li class="file"><a href="./Gemfile.html">Gemfile</a>
|
93
|
+
|
94
|
+
<li class="file"><a href="./Rakefile.html">Rakefile</a>
|
95
|
+
|
96
|
+
</ul>
|
97
|
+
</nav>
|
98
|
+
|
99
|
+
<nav id="classindex-section" class="section project-section">
|
100
|
+
<h3 class="section-header">Class and Module Index</h3>
|
101
|
+
|
102
|
+
<ul class="link-list">
|
103
|
+
|
104
|
+
<li><a href="./Greenmonster.html">Greenmonster</a>
|
105
|
+
|
106
|
+
<li><a href="./Greenmonster/Generators.html">Greenmonster::Generators</a>
|
107
|
+
|
108
|
+
<li><a href="./Greenmonster/Generators/InstallGenerator.html">Greenmonster::Generators::InstallGenerator</a>
|
109
|
+
|
110
|
+
<li><a href="./Greenmonster/Parser.html">Greenmonster::Parser</a>
|
111
|
+
|
112
|
+
<li><a href="./Greenmonster/Player.html">Greenmonster::Player</a>
|
113
|
+
|
114
|
+
<li><a href="./Greenmonster/Spider.html">Greenmonster::Spider</a>
|
115
|
+
|
116
|
+
<li><a href="./Athlete.html">Athlete</a>
|
117
|
+
|
118
|
+
<li><a href="./GreenmonsterPlayerTest.html">GreenmonsterPlayerTest</a>
|
119
|
+
|
120
|
+
<li><a href="./GreenmonsterSpiderTest.html">GreenmonsterSpiderTest</a>
|
121
|
+
|
122
|
+
<li><a href="./GreenmonsterTest.html">GreenmonsterTest</a>
|
123
|
+
|
124
|
+
<li><a href="./GreenmonsterTraversalTest.html">GreenmonsterTraversalTest</a>
|
125
|
+
|
126
|
+
<li><a href="./InstallGreenmonster.html">InstallGreenmonster</a>
|
127
|
+
|
128
|
+
<li><a href="./TestCreatePlayersFromGamedayXMLGame.html">TestCreatePlayersFromGamedayXMLGame</a>
|
129
|
+
|
130
|
+
<li><a href="./TestParsePlayersFromGamedayXMLFiles.html">TestParsePlayersFromGamedayXMLFiles</a>
|
131
|
+
|
132
|
+
</ul>
|
133
|
+
</nav>
|
134
|
+
|
135
|
+
</div>
|
136
|
+
</nav>
|
137
|
+
|
138
|
+
<div id="documentation">
|
139
|
+
<h1 class="class">class TestParsePlayersFromGamedayXMLFiles</h1>
|
140
|
+
|
141
|
+
<div id="description" class="description">
|
142
|
+
|
143
|
+
</div><!-- description -->
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
149
|
+
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
|
156
|
+
|
157
|
+
<!-- Methods -->
|
158
|
+
|
159
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section section">
|
160
|
+
<h3 class="section-header">Public Instance Methods</h3>
|
161
|
+
|
162
|
+
|
163
|
+
<div id="method-i-setup" class="method-detail ">
|
164
|
+
|
165
|
+
<div class="method-heading">
|
166
|
+
<span class="method-name">setup</span><span
|
167
|
+
class="method-args">()</span>
|
168
|
+
<span class="method-click-advice">click to toggle source</span>
|
169
|
+
</div>
|
170
|
+
|
171
|
+
|
172
|
+
<div class="method-description">
|
173
|
+
|
174
|
+
|
175
|
+
|
176
|
+
|
177
|
+
|
178
|
+
<div class="method-source-code" id="setup-source">
|
179
|
+
<pre><span class="ruby-comment"># File test/test_parse_players_from_gameday_xml_files.rb, line 6</span>
|
180
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">setup</span>
|
181
|
+
<span class="ruby-constant">Greenmonster</span>.<span class="ruby-identifier">set_games_folder</span>(<span class="ruby-string">'./greenmonster_test_games'</span>)
|
182
|
+
<span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">mkdir_p</span> <span class="ruby-constant">Greenmonster</span>.<span class="ruby-identifier">games_folder</span>
|
183
|
+
<span class="ruby-constant">Greenmonster</span><span class="ruby-operator">::</span><span class="ruby-constant">Spider</span>.<span class="ruby-identifier">pull_game</span>(<span class="ruby-string">'gid_2011_07_04_tormlb_bosmlb_1'</span>, {<span class="ruby-value">:print_games</span> =<span class="ruby-operator">></span> <span class="ruby-keyword">false</span>})
|
184
|
+
<span class="ruby-keyword">end</span></pre>
|
185
|
+
</div><!-- setup-source -->
|
186
|
+
|
187
|
+
</div>
|
188
|
+
|
189
|
+
|
190
|
+
|
191
|
+
|
192
|
+
</div><!-- setup-method -->
|
193
|
+
|
194
|
+
|
195
|
+
<div id="method-i-teardown" class="method-detail ">
|
196
|
+
|
197
|
+
<div class="method-heading">
|
198
|
+
<span class="method-name">teardown</span><span
|
199
|
+
class="method-args">()</span>
|
200
|
+
<span class="method-click-advice">click to toggle source</span>
|
201
|
+
</div>
|
202
|
+
|
203
|
+
|
204
|
+
<div class="method-description">
|
205
|
+
|
206
|
+
|
207
|
+
|
208
|
+
|
209
|
+
|
210
|
+
<div class="method-source-code" id="teardown-source">
|
211
|
+
<pre><span class="ruby-comment"># File test/test_parse_players_from_gameday_xml_files.rb, line 30</span>
|
212
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">teardown</span>
|
213
|
+
<span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">remove_dir</span> <span class="ruby-constant">Greenmonster</span>.<span class="ruby-identifier">games_folder</span>
|
214
|
+
<span class="ruby-keyword">end</span></pre>
|
215
|
+
</div><!-- teardown-source -->
|
216
|
+
|
217
|
+
</div>
|
218
|
+
|
219
|
+
|
220
|
+
|
221
|
+
|
222
|
+
</div><!-- teardown-method -->
|
223
|
+
|
224
|
+
|
225
|
+
<div id="method-i-test_parse_players_from_game" class="method-detail ">
|
226
|
+
|
227
|
+
<div class="method-heading">
|
228
|
+
<span class="method-name">test_parse_players_from_game</span><span
|
229
|
+
class="method-args">()</span>
|
230
|
+
<span class="method-click-advice">click to toggle source</span>
|
231
|
+
</div>
|
232
|
+
|
233
|
+
|
234
|
+
<div class="method-description">
|
235
|
+
|
236
|
+
|
237
|
+
|
238
|
+
|
239
|
+
|
240
|
+
<div class="method-source-code" id="test_parse_players_from_game-source">
|
241
|
+
<pre><span class="ruby-comment"># File test/test_parse_players_from_gameday_xml_files.rb, line 12</span>
|
242
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">test_parse_players_from_game</span>
|
243
|
+
<span class="ruby-identifier">players</span> = []
|
244
|
+
<span class="ruby-constant">Greenmonster</span><span class="ruby-operator">::</span><span class="ruby-constant">Parser</span>.<span class="ruby-identifier">extract_players_from_game</span>(<span class="ruby-string">'gid_2011_07_04_tormlb_bosmlb_1'</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">p</span><span class="ruby-operator">|</span>
|
245
|
+
<span class="ruby-identifier">players</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">p</span>
|
246
|
+
<span class="ruby-keyword">end</span>
|
247
|
+
<span class="ruby-identifier">players</span>.<span class="ruby-identifier">sort!</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">x</span>,<span class="ruby-identifier">y</span><span class="ruby-operator">|</span> <span class="ruby-identifier">x</span>[<span class="ruby-value">:id</span>] <span class="ruby-operator"><=></span> <span class="ruby-identifier">y</span>[<span class="ruby-value">:id</span>]}
|
248
|
+
|
249
|
+
<span class="ruby-identifier">assert_equal</span> <span class="ruby-value">50</span>, <span class="ruby-identifier">players</span>.<span class="ruby-identifier">count</span>
|
250
|
+
<span class="ruby-keyword">end</span></pre>
|
251
|
+
</div><!-- test_parse_players_from_game-source -->
|
252
|
+
|
253
|
+
</div>
|
254
|
+
|
255
|
+
|
256
|
+
|
257
|
+
|
258
|
+
</div><!-- test_parse_players_from_game-method -->
|
259
|
+
|
260
|
+
|
261
|
+
<div id="method-i-test_player_ids_stored_as_integers" class="method-detail ">
|
262
|
+
|
263
|
+
<div class="method-heading">
|
264
|
+
<span class="method-name">test_player_ids_stored_as_integers</span><span
|
265
|
+
class="method-args">()</span>
|
266
|
+
<span class="method-click-advice">click to toggle source</span>
|
267
|
+
</div>
|
268
|
+
|
269
|
+
|
270
|
+
<div class="method-description">
|
271
|
+
|
272
|
+
|
273
|
+
|
274
|
+
|
275
|
+
|
276
|
+
<div class="method-source-code" id="test_player_ids_stored_as_integers-source">
|
277
|
+
<pre><span class="ruby-comment"># File test/test_parse_players_from_gameday_xml_files.rb, line 22</span>
|
278
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">test_player_ids_stored_as_integers</span>
|
279
|
+
<span class="ruby-identifier">players</span> = []
|
280
|
+
<span class="ruby-constant">Greenmonster</span><span class="ruby-operator">::</span><span class="ruby-constant">Parser</span>.<span class="ruby-identifier">extract_players_from_game</span>(<span class="ruby-string">'gid_2011_07_04_tormlb_bosmlb_1'</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">p</span><span class="ruby-operator">|</span>
|
281
|
+
<span class="ruby-identifier">players</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">p</span>
|
282
|
+
<span class="ruby-keyword">end</span>
|
283
|
+
<span class="ruby-identifier">assert</span> <span class="ruby-identifier">players</span>.<span class="ruby-identifier">first</span>[<span class="ruby-value">:id</span>].<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">Integer</span>
|
284
|
+
<span class="ruby-keyword">end</span></pre>
|
285
|
+
</div><!-- test_player_ids_stored_as_integers-source -->
|
286
|
+
|
287
|
+
</div>
|
288
|
+
|
289
|
+
|
290
|
+
|
291
|
+
|
292
|
+
</div><!-- test_player_ids_stored_as_integers-method -->
|
293
|
+
|
294
|
+
|
295
|
+
</section><!-- public-instance-method-details -->
|
296
|
+
|
297
|
+
</section><!-- 5Buntitled-5D -->
|
298
|
+
|
299
|
+
</div><!-- documentation -->
|
300
|
+
|
301
|
+
|
302
|
+
<footer id="validator-badges">
|
303
|
+
<p><a href="http://validator.w3.org/check/referer">[Validate]</a>
|
304
|
+
<p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.
|
305
|
+
<p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
|
306
|
+
</footer>
|
307
|
+
|
data/doc/created.rid
CHANGED
@@ -1,9 +1,18 @@
|
|
1
|
-
|
2
|
-
./
|
3
|
-
./
|
4
|
-
./lib/greenmonster/
|
5
|
-
./lib/
|
6
|
-
./
|
7
|
-
./
|
8
|
-
./
|
9
|
-
./
|
1
|
+
Sun, 18 Mar 2012 23:12:58 -0400
|
2
|
+
./db/schema.rb Thu, 15 Mar 2012 00:06:57 -0400
|
3
|
+
./Gemfile Sun, 18 Mar 2012 20:59:05 -0400
|
4
|
+
./lib/generators/greenmonster/install_generator.rb Sun, 18 Mar 2012 20:59:05 -0400
|
5
|
+
./lib/generators/templates/migration.rb Sun, 18 Mar 2012 20:59:05 -0400
|
6
|
+
./lib/greenmonster/greenmonster.rb Sun, 18 Mar 2012 20:59:05 -0400
|
7
|
+
./lib/greenmonster/model_extensions/player.rb Sun, 18 Mar 2012 21:54:28 -0400
|
8
|
+
./lib/greenmonster/parser.rb Sun, 18 Mar 2012 20:59:05 -0400
|
9
|
+
./lib/greenmonster/spider.rb Sun, 18 Mar 2012 20:59:05 -0400
|
10
|
+
./lib/greenmonster/version.rb Sun, 18 Mar 2012 21:45:55 -0400
|
11
|
+
./lib/greenmonster.rb Sun, 18 Mar 2012 22:16:43 -0400
|
12
|
+
./Rakefile Sun, 18 Mar 2012 20:59:05 -0400
|
13
|
+
./test/test_create_players_from_gameday_xml_game.rb Sun, 18 Mar 2012 22:55:14 -0400
|
14
|
+
./test/test_greenmonster.rb Sun, 18 Mar 2012 20:59:05 -0400
|
15
|
+
./test/test_greenmonster_player.rb Sun, 18 Mar 2012 22:17:18 -0400
|
16
|
+
./test/test_greenmonster_spider.rb Sun, 18 Mar 2012 20:59:05 -0400
|
17
|
+
./test/test_greenmonster_traversal.rb Sun, 18 Mar 2012 20:59:05 -0400
|
18
|
+
./test/test_parse_players_from_gameday_xml_files.rb Sun, 18 Mar 2012 22:34:30 -0400
|
data/doc/index.html
CHANGED
@@ -63,12 +63,32 @@
|
|
63
63
|
|
64
64
|
<li><a href="./Greenmonster.html">Greenmonster</a>
|
65
65
|
|
66
|
+
<li><a href="./Greenmonster/Generators.html">Greenmonster::Generators</a>
|
67
|
+
|
68
|
+
<li><a href="./Greenmonster/Generators/InstallGenerator.html">Greenmonster::Generators::InstallGenerator</a>
|
69
|
+
|
70
|
+
<li><a href="./Greenmonster/Parser.html">Greenmonster::Parser</a>
|
71
|
+
|
72
|
+
<li><a href="./Greenmonster/Player.html">Greenmonster::Player</a>
|
73
|
+
|
66
74
|
<li><a href="./Greenmonster/Spider.html">Greenmonster::Spider</a>
|
67
75
|
|
76
|
+
<li><a href="./Athlete.html">Athlete</a>
|
77
|
+
|
78
|
+
<li><a href="./GreenmonsterPlayerTest.html">GreenmonsterPlayerTest</a>
|
79
|
+
|
68
80
|
<li><a href="./GreenmonsterSpiderTest.html">GreenmonsterSpiderTest</a>
|
69
81
|
|
70
82
|
<li><a href="./GreenmonsterTest.html">GreenmonsterTest</a>
|
71
83
|
|
84
|
+
<li><a href="./GreenmonsterTraversalTest.html">GreenmonsterTraversalTest</a>
|
85
|
+
|
86
|
+
<li><a href="./InstallGreenmonster.html">InstallGreenmonster</a>
|
87
|
+
|
88
|
+
<li><a href="./TestCreatePlayersFromGamedayXMLGame.html">TestCreatePlayersFromGamedayXMLGame</a>
|
89
|
+
|
90
|
+
<li><a href="./TestParsePlayersFromGamedayXMLFiles.html">TestParsePlayersFromGamedayXMLFiles</a>
|
91
|
+
|
72
92
|
</ul>
|
73
93
|
</nav>
|
74
94
|
|