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
@@ -0,0 +1,199 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
|
6
|
+
|
7
|
+
<title>class GreenmonsterPlayerTest - 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_greenmonster_player.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-test_to_s">#test_to_s</a>
|
74
|
+
|
75
|
+
</ul>
|
76
|
+
</nav>
|
77
|
+
|
78
|
+
</div>
|
79
|
+
|
80
|
+
<div id="project-metadata">
|
81
|
+
<nav id="fileindex-section" class="section project-section">
|
82
|
+
<h3 class="section-header">Pages</h3>
|
83
|
+
|
84
|
+
<ul>
|
85
|
+
|
86
|
+
<li class="file"><a href="./Gemfile.html">Gemfile</a>
|
87
|
+
|
88
|
+
<li class="file"><a href="./Rakefile.html">Rakefile</a>
|
89
|
+
|
90
|
+
</ul>
|
91
|
+
</nav>
|
92
|
+
|
93
|
+
<nav id="classindex-section" class="section project-section">
|
94
|
+
<h3 class="section-header">Class and Module Index</h3>
|
95
|
+
|
96
|
+
<ul class="link-list">
|
97
|
+
|
98
|
+
<li><a href="./Greenmonster.html">Greenmonster</a>
|
99
|
+
|
100
|
+
<li><a href="./Greenmonster/Generators.html">Greenmonster::Generators</a>
|
101
|
+
|
102
|
+
<li><a href="./Greenmonster/Generators/InstallGenerator.html">Greenmonster::Generators::InstallGenerator</a>
|
103
|
+
|
104
|
+
<li><a href="./Greenmonster/Parser.html">Greenmonster::Parser</a>
|
105
|
+
|
106
|
+
<li><a href="./Greenmonster/Player.html">Greenmonster::Player</a>
|
107
|
+
|
108
|
+
<li><a href="./Greenmonster/Spider.html">Greenmonster::Spider</a>
|
109
|
+
|
110
|
+
<li><a href="./Athlete.html">Athlete</a>
|
111
|
+
|
112
|
+
<li><a href="./GreenmonsterPlayerTest.html">GreenmonsterPlayerTest</a>
|
113
|
+
|
114
|
+
<li><a href="./GreenmonsterSpiderTest.html">GreenmonsterSpiderTest</a>
|
115
|
+
|
116
|
+
<li><a href="./GreenmonsterTest.html">GreenmonsterTest</a>
|
117
|
+
|
118
|
+
<li><a href="./GreenmonsterTraversalTest.html">GreenmonsterTraversalTest</a>
|
119
|
+
|
120
|
+
<li><a href="./InstallGreenmonster.html">InstallGreenmonster</a>
|
121
|
+
|
122
|
+
<li><a href="./TestCreatePlayersFromGamedayXMLGame.html">TestCreatePlayersFromGamedayXMLGame</a>
|
123
|
+
|
124
|
+
<li><a href="./TestParsePlayersFromGamedayXMLFiles.html">TestParsePlayersFromGamedayXMLFiles</a>
|
125
|
+
|
126
|
+
</ul>
|
127
|
+
</nav>
|
128
|
+
|
129
|
+
</div>
|
130
|
+
</nav>
|
131
|
+
|
132
|
+
<div id="documentation">
|
133
|
+
<h1 class="class">class GreenmonsterPlayerTest</h1>
|
134
|
+
|
135
|
+
<div id="description" class="description">
|
136
|
+
|
137
|
+
</div><!-- description -->
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
|
142
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
143
|
+
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
<!-- Methods -->
|
152
|
+
|
153
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section section">
|
154
|
+
<h3 class="section-header">Public Instance Methods</h3>
|
155
|
+
|
156
|
+
|
157
|
+
<div id="method-i-test_to_s" class="method-detail ">
|
158
|
+
|
159
|
+
<div class="method-heading">
|
160
|
+
<span class="method-name">test_to_s</span><span
|
161
|
+
class="method-args">()</span>
|
162
|
+
<span class="method-click-advice">click to toggle source</span>
|
163
|
+
</div>
|
164
|
+
|
165
|
+
|
166
|
+
<div class="method-description">
|
167
|
+
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
|
172
|
+
<div class="method-source-code" id="test_to_s-source">
|
173
|
+
<pre><span class="ruby-comment"># File test/test_greenmonster_player.rb, line 11</span>
|
174
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">test_to_s</span>
|
175
|
+
<span class="ruby-identifier">assert_equal</span> <span class="ruby-string">"Roy Hobbs"</span>, <span class="ruby-constant">Athlete</span>.<span class="ruby-identifier">new</span>({<span class="ruby-value">:first</span> =<span class="ruby-operator">></span> <span class="ruby-string">'Roy'</span>, <span class="ruby-value">:last</span> =<span class="ruby-operator">></span> <span class="ruby-string">'Hobbs'</span>}).<span class="ruby-identifier">to_s</span>
|
176
|
+
<span class="ruby-keyword">end</span></pre>
|
177
|
+
</div><!-- test_to_s-source -->
|
178
|
+
|
179
|
+
</div>
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
|
184
|
+
</div><!-- test_to_s-method -->
|
185
|
+
|
186
|
+
|
187
|
+
</section><!-- public-instance-method-details -->
|
188
|
+
|
189
|
+
</section><!-- 5Buntitled-5D -->
|
190
|
+
|
191
|
+
</div><!-- documentation -->
|
192
|
+
|
193
|
+
|
194
|
+
<footer id="validator-badges">
|
195
|
+
<p><a href="http://validator.w3.org/check/referer">[Validate]</a>
|
196
|
+
<p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.
|
197
|
+
<p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
|
198
|
+
</footer>
|
199
|
+
|
@@ -47,7 +47,6 @@
|
|
47
47
|
<nav id="file-list-section" class="section">
|
48
48
|
<h3 class="section-header">Defined In</h3>
|
49
49
|
<ul>
|
50
|
-
<li>test/temp_test.rb
|
51
50
|
<li>test/test_greenmonster_spider.rb
|
52
51
|
</ul>
|
53
52
|
</nav>
|
@@ -97,6 +96,8 @@
|
|
97
96
|
|
98
97
|
<li><a href="#method-i-test_pull_single_game_by_game_id">#test_pull_single_game_by_game_id</a>
|
99
98
|
|
99
|
+
<li><a href="#method-i-test_sport_code_argument_as_array">#test_sport_code_argument_as_array</a>
|
100
|
+
|
100
101
|
</ul>
|
101
102
|
</nav>
|
102
103
|
|
@@ -122,12 +123,32 @@
|
|
122
123
|
|
123
124
|
<li><a href="./Greenmonster.html">Greenmonster</a>
|
124
125
|
|
126
|
+
<li><a href="./Greenmonster/Generators.html">Greenmonster::Generators</a>
|
127
|
+
|
128
|
+
<li><a href="./Greenmonster/Generators/InstallGenerator.html">Greenmonster::Generators::InstallGenerator</a>
|
129
|
+
|
130
|
+
<li><a href="./Greenmonster/Parser.html">Greenmonster::Parser</a>
|
131
|
+
|
132
|
+
<li><a href="./Greenmonster/Player.html">Greenmonster::Player</a>
|
133
|
+
|
125
134
|
<li><a href="./Greenmonster/Spider.html">Greenmonster::Spider</a>
|
126
135
|
|
136
|
+
<li><a href="./Athlete.html">Athlete</a>
|
137
|
+
|
138
|
+
<li><a href="./GreenmonsterPlayerTest.html">GreenmonsterPlayerTest</a>
|
139
|
+
|
127
140
|
<li><a href="./GreenmonsterSpiderTest.html">GreenmonsterSpiderTest</a>
|
128
141
|
|
129
142
|
<li><a href="./GreenmonsterTest.html">GreenmonsterTest</a>
|
130
143
|
|
144
|
+
<li><a href="./GreenmonsterTraversalTest.html">GreenmonsterTraversalTest</a>
|
145
|
+
|
146
|
+
<li><a href="./InstallGreenmonster.html">InstallGreenmonster</a>
|
147
|
+
|
148
|
+
<li><a href="./TestCreatePlayersFromGamedayXMLGame.html">TestCreatePlayersFromGamedayXMLGame</a>
|
149
|
+
|
150
|
+
<li><a href="./TestParsePlayersFromGamedayXMLFiles.html">TestParsePlayersFromGamedayXMLFiles</a>
|
151
|
+
|
131
152
|
</ul>
|
132
153
|
</nav>
|
133
154
|
|
@@ -175,7 +196,7 @@
|
|
175
196
|
|
176
197
|
|
177
198
|
<div class="method-source-code" id="setup-source">
|
178
|
-
<pre><span class="ruby-comment"># File test/
|
199
|
+
<pre><span class="ruby-comment"># File test/test_greenmonster_spider.rb, line 5</span>
|
179
200
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">setup</span>
|
180
201
|
<span class="ruby-ivar">@local_test_data_location</span> = <span class="ruby-string">"./greenmonster_test_games"</span>
|
181
202
|
<span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">mkdir_p</span> <span class="ruby-ivar">@local_test_data_location</span>
|
@@ -206,7 +227,7 @@
|
|
206
227
|
|
207
228
|
|
208
229
|
<div class="method-source-code" id="teardown-source">
|
209
|
-
<pre><span class="ruby-comment"># File test/
|
230
|
+
<pre><span class="ruby-comment"># File test/test_greenmonster_spider.rb, line 110</span>
|
210
231
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">teardown</span>
|
211
232
|
<span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">remove_dir</span> <span class="ruby-ivar">@local_test_data_location</span>
|
212
233
|
<span class="ruby-keyword">end</span></pre>
|
@@ -309,7 +330,7 @@
|
|
309
330
|
|
310
331
|
|
311
332
|
<div class="method-source-code" id="test_local_file_not_created_if_remote_file_does_not_exist-source">
|
312
|
-
<pre><span class="ruby-comment"># File test/
|
333
|
+
<pre><span class="ruby-comment"># File test/test_greenmonster_spider.rb, line 98</span>
|
313
334
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">test_local_file_not_created_if_remote_file_does_not_exist</span>
|
314
335
|
<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_01_xxxmlb_yyymlb_1'</span>, {<span class="ruby-value">:games_folder</span> =<span class="ruby-operator">></span> <span class="ruby-ivar">@local_test_data_location</span>, <span class="ruby-value">:print_games</span> =<span class="ruby-operator">></span> <span class="ruby-keyword">false</span>})
|
315
336
|
|
@@ -600,6 +621,38 @@
|
|
600
621
|
</div><!-- test_pull_single_game_by_game_id-method -->
|
601
622
|
|
602
623
|
|
624
|
+
<div id="method-i-test_sport_code_argument_as_array" class="method-detail ">
|
625
|
+
|
626
|
+
<div class="method-heading">
|
627
|
+
<span class="method-name">test_sport_code_argument_as_array</span><span
|
628
|
+
class="method-args">()</span>
|
629
|
+
<span class="method-click-advice">click to toggle source</span>
|
630
|
+
</div>
|
631
|
+
|
632
|
+
|
633
|
+
<div class="method-description">
|
634
|
+
|
635
|
+
|
636
|
+
|
637
|
+
|
638
|
+
|
639
|
+
<div class="method-source-code" id="test_sport_code_argument_as_array-source">
|
640
|
+
<pre><span class="ruby-comment"># File test/test_greenmonster_spider.rb, line 104</span>
|
641
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">test_sport_code_argument_as_array</span>
|
642
|
+
<span class="ruby-constant">Greenmonster</span><span class="ruby-operator">::</span><span class="ruby-constant">Spider</span>.<span class="ruby-identifier">pull_day</span>({<span class="ruby-value">:date</span> =<span class="ruby-operator">></span> <span class="ruby-constant">Date</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">2011</span>,<span class="ruby-value">8</span>,<span class="ruby-value">1</span>), <span class="ruby-value">:sport_code</span> =<span class="ruby-operator">></span> [<span class="ruby-string">'mlb'</span>,<span class="ruby-string">'rok'</span>], <span class="ruby-value">:print_games</span> =<span class="ruby-operator">></span> <span class="ruby-keyword">false</span>, <span class="ruby-value">:games_folder</span> =<span class="ruby-operator">></span> <span class="ruby-ivar">@local_test_data_location</span>})
|
643
|
+
|
644
|
+
<span class="ruby-identifier">assert_equal</span> <span class="ruby-value">4</span>, <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">entries</span>(<span class="ruby-ivar">@local_test_data_location</span>).<span class="ruby-identifier">count</span>
|
645
|
+
<span class="ruby-keyword">end</span></pre>
|
646
|
+
</div><!-- test_sport_code_argument_as_array-source -->
|
647
|
+
|
648
|
+
</div>
|
649
|
+
|
650
|
+
|
651
|
+
|
652
|
+
|
653
|
+
</div><!-- test_sport_code_argument_as_array-method -->
|
654
|
+
|
655
|
+
|
603
656
|
</section><!-- public-instance-method-details -->
|
604
657
|
|
605
658
|
</section><!-- 5Buntitled-5D -->
|
data/doc/GreenmonsterTest.html
CHANGED
@@ -101,12 +101,32 @@
|
|
101
101
|
|
102
102
|
<li><a href="./Greenmonster.html">Greenmonster</a>
|
103
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
|
+
|
104
112
|
<li><a href="./Greenmonster/Spider.html">Greenmonster::Spider</a>
|
105
113
|
|
114
|
+
<li><a href="./Athlete.html">Athlete</a>
|
115
|
+
|
116
|
+
<li><a href="./GreenmonsterPlayerTest.html">GreenmonsterPlayerTest</a>
|
117
|
+
|
106
118
|
<li><a href="./GreenmonsterSpiderTest.html">GreenmonsterSpiderTest</a>
|
107
119
|
|
108
120
|
<li><a href="./GreenmonsterTest.html">GreenmonsterTest</a>
|
109
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
|
+
|
110
130
|
</ul>
|
111
131
|
</nav>
|
112
132
|
|