greenmonster 0.5.0 → 1.0.0

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.
Files changed (57) hide show
  1. checksums.yaml +7 -0
  2. data/CODE_OF_CONDUCT.md +13 -0
  3. data/LICENSE.txt +21 -0
  4. data/README.markdown +11 -28
  5. data/Rakefile +3 -8
  6. data/doc/Gemfile.html +6 -24
  7. data/doc/Greenmonster/Spider.html +47 -258
  8. data/doc/Greenmonster.html +25 -86
  9. data/doc/Rakefile.html +10 -25
  10. data/doc/created.rid +12 -18
  11. data/doc/index.html +6 -24
  12. data/doc/js/search_index.js +1 -1
  13. data/doc/table_of_contents.html +12 -129
  14. data/greenmonster.gemspec +16 -13
  15. data/lib/greenmonster/day_spider.rb +61 -0
  16. data/lib/greenmonster/file_downloader.rb +38 -0
  17. data/lib/greenmonster/game_spider.rb +100 -0
  18. data/lib/greenmonster/innings_downloader.rb +41 -0
  19. data/lib/greenmonster/spider.rb +1 -0
  20. data/lib/greenmonster/version.rb +2 -2
  21. data/lib/greenmonster.rb +16 -82
  22. data/spec/cassettes/aaa/year_2015/month_05/day_09.yml +153 -0
  23. data/spec/cassettes/gid_2007_10_01_sdnmlb_colmlb_1/innings.yml +135 -0
  24. data/spec/cassettes/gid_2015_04_18_balmlb_bos_mlb_1/players_xml.yml +292 -0
  25. data/spec/cassettes/gid_2015_04_18_balmlb_bos_mlb_2/players_xml.yml +46 -0
  26. data/spec/cassettes/mlb/year_2015/month_04/day_18.yml +170 -0
  27. data/spec/day_spider_spec.rb +80 -0
  28. data/spec/file_downloader_spec.rb +51 -0
  29. data/spec/fixtures/aaa_players.xml +70 -0
  30. data/spec/fixtures/boxscore.xml +1147 -0
  31. data/spec/fixtures/inning_all.xml +1 -0
  32. data/spec/fixtures/inning_hit.xml +1 -0
  33. data/spec/fixtures/linescore.xml +131 -0
  34. data/spec/fixtures/players.xml +63 -0
  35. data/spec/game_spider_spec.rb +116 -0
  36. data/spec/greenmonster_spec.rb +22 -34
  37. data/spec/innings_downloader_spec.rb +44 -0
  38. data/spec/spec_helper.rb +13 -21
  39. data/spec/support/path_helpers.rb +21 -0
  40. data/spec/support/vcr.rb +11 -0
  41. metadata +91 -67
  42. data/doc/Athlete.html +0 -254
  43. data/doc/Greenmonster/Generators/InstallGenerator.html +0 -253
  44. data/doc/Greenmonster/Generators.html +0 -147
  45. data/doc/Greenmonster/Parser.html +0 -263
  46. data/doc/Greenmonster/Player.html +0 -236
  47. data/doc/GreenmonsterPlayerTest.html +0 -199
  48. data/doc/GreenmonsterSpiderTest.html +0 -668
  49. data/doc/GreenmonsterTest.html +0 -262
  50. data/doc/GreenmonsterTraversalTest.html +0 -376
  51. data/doc/InstallGreenmonster.html +0 -260
  52. data/doc/TestCreatePlayersFromGamedayXMLGame.html +0 -266
  53. data/doc/TestParsePlayersFromGamedayXMLFiles.html +0 -307
  54. data/spec/games/tst/year_2012/month_03/day_27/gid_2012_03_27_aaamlb_aabmlb_1/blank.txt +0 -0
  55. data/spec/games/tst/year_2012/month_03/day_27/gid_2012_03_27_aaamlb_aabmlb_1_bak/blank.txt +0 -0
  56. data/spec/games/tst/year_2012/month_03/day_27/not_2012_03_27_aaamlb_aabmlb_1/blank.txt +0 -0
  57. data/spec/greenmonster/spider_spec.rb +0 -85
@@ -1,236 +0,0 @@
1
- <!DOCTYPE html>
2
-
3
- <html>
4
- <head>
5
- <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
6
-
7
- <title>module Greenmonster::Player - 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="module">
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>lib/greenmonster/model_extensions/player.rb
51
- </ul>
52
- </nav>
53
-
54
-
55
- </div>
56
-
57
- <div id="class-metadata">
58
-
59
-
60
-
61
- <!-- Method Quickref -->
62
- <nav id="method-list-section" class="section">
63
- <h3 class="section-header">Methods</h3>
64
-
65
- <ul class="link-list">
66
-
67
- <li><a href="#method-c-included">::included</a>
68
-
69
- <li><a href="#method-i-to_s">#to_s</a>
70
-
71
- </ul>
72
- </nav>
73
-
74
- </div>
75
-
76
- <div id="project-metadata">
77
- <nav id="fileindex-section" class="section project-section">
78
- <h3 class="section-header">Pages</h3>
79
-
80
- <ul>
81
-
82
- <li class="file"><a href="../Gemfile.html">Gemfile</a>
83
-
84
- <li class="file"><a href="../Rakefile.html">Rakefile</a>
85
-
86
- </ul>
87
- </nav>
88
-
89
- <nav id="classindex-section" class="section project-section">
90
- <h3 class="section-header">Class and Module Index</h3>
91
-
92
- <ul class="link-list">
93
-
94
- <li><a href="../Greenmonster.html">Greenmonster</a>
95
-
96
- <li><a href="../Greenmonster/Generators.html">Greenmonster::Generators</a>
97
-
98
- <li><a href="../Greenmonster/Generators/InstallGenerator.html">Greenmonster::Generators::InstallGenerator</a>
99
-
100
- <li><a href="../Greenmonster/Parser.html">Greenmonster::Parser</a>
101
-
102
- <li><a href="../Greenmonster/Player.html">Greenmonster::Player</a>
103
-
104
- <li><a href="../Greenmonster/Spider.html">Greenmonster::Spider</a>
105
-
106
- <li><a href="../Athlete.html">Athlete</a>
107
-
108
- <li><a href="../GreenmonsterPlayerTest.html">GreenmonsterPlayerTest</a>
109
-
110
- <li><a href="../GreenmonsterSpiderTest.html">GreenmonsterSpiderTest</a>
111
-
112
- <li><a href="../GreenmonsterTest.html">GreenmonsterTest</a>
113
-
114
- <li><a href="../GreenmonsterTraversalTest.html">GreenmonsterTraversalTest</a>
115
-
116
- <li><a href="../InstallGreenmonster.html">InstallGreenmonster</a>
117
-
118
- <li><a href="../TestCreatePlayersFromGamedayXMLGame.html">TestCreatePlayersFromGamedayXMLGame</a>
119
-
120
- <li><a href="../TestParsePlayersFromGamedayXMLFiles.html">TestParsePlayersFromGamedayXMLFiles</a>
121
-
122
- </ul>
123
- </nav>
124
-
125
- </div>
126
- </nav>
127
-
128
- <div id="documentation">
129
- <h1 class="module">module Greenmonster::Player</h1>
130
-
131
- <div id="description" class="description">
132
-
133
- </div><!-- description -->
134
-
135
-
136
-
137
-
138
- <section id="5Buntitled-5D" class="documentation-section">
139
-
140
-
141
-
142
-
143
-
144
-
145
-
146
-
147
- <!-- Methods -->
148
-
149
- <section id="public-class-5Buntitled-5D-method-details" class="method-section section">
150
- <h3 class="section-header">Public Class Methods</h3>
151
-
152
-
153
- <div id="method-c-included" class="method-detail ">
154
-
155
- <div class="method-heading">
156
- <span class="method-name">included</span><span
157
- class="method-args">(k)</span>
158
- <span class="method-click-advice">click to toggle source</span>
159
- </div>
160
-
161
-
162
- <div class="method-description">
163
-
164
-
165
-
166
-
167
-
168
- <div class="method-source-code" id="included-source">
169
- <pre><span class="ruby-comment"># File lib/greenmonster/model_extensions/player.rb, line 7</span>
170
- <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">included</span>(<span class="ruby-identifier">k</span>)
171
- <span class="ruby-keyword">def</span> <span class="ruby-identifier">k</span>.<span class="ruby-identifier">create_from_gameday_xml_game</span>(<span class="ruby-identifier">gid</span>, <span class="ruby-identifier">args</span> = {})
172
- <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-identifier">gid</span>, <span class="ruby-identifier">args</span> = {}) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">p</span><span class="ruby-operator">|</span>
173
- <span class="ruby-identifier">player</span> = <span class="ruby-keyword">self</span>.<span class="ruby-identifier">find_or_initialize_by_id</span>(<span class="ruby-identifier">p</span>[<span class="ruby-value">:id</span>])
174
- <span class="ruby-identifier">player</span>.<span class="ruby-identifier">update_attributes!</span>(<span class="ruby-identifier">p</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">player</span>.<span class="ruby-identifier">new_record?</span>
175
- <span class="ruby-keyword">end</span>
176
- <span class="ruby-keyword">end</span>
177
- <span class="ruby-keyword">end</span></pre>
178
- </div><!-- included-source -->
179
-
180
- </div>
181
-
182
-
183
-
184
-
185
- </div><!-- included-method -->
186
-
187
-
188
- </section><!-- public-class-method-details -->
189
-
190
- <section id="public-instance-5Buntitled-5D-method-details" class="method-section section">
191
- <h3 class="section-header">Public Instance Methods</h3>
192
-
193
-
194
- <div id="method-i-to_s" class="method-detail ">
195
-
196
- <div class="method-heading">
197
- <span class="method-name">to_s</span><span
198
- class="method-args">()</span>
199
- <span class="method-click-advice">click to toggle source</span>
200
- </div>
201
-
202
-
203
- <div class="method-description">
204
-
205
-
206
-
207
-
208
-
209
- <div class="method-source-code" id="to_s-source">
210
- <pre><span class="ruby-comment"># File lib/greenmonster/model_extensions/player.rb, line 3</span>
211
- <span class="ruby-keyword">def</span> <span class="ruby-identifier">to_s</span>
212
- <span class="ruby-node">&quot;#{self.first} #{self.last}&quot;</span>
213
- <span class="ruby-keyword">end</span></pre>
214
- </div><!-- to_s-source -->
215
-
216
- </div>
217
-
218
-
219
-
220
-
221
- </div><!-- to_s-method -->
222
-
223
-
224
- </section><!-- public-instance-method-details -->
225
-
226
- </section><!-- 5Buntitled-5D -->
227
-
228
- </div><!-- documentation -->
229
-
230
-
231
- <footer id="validator-badges">
232
- <p><a href="http://validator.w3.org/check/referer">[Validate]</a>
233
- <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.
234
- <p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
235
- </footer>
236
-
@@ -1,199 +0,0 @@
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">&quot;Roy Hobbs&quot;</span>, <span class="ruby-constant">Athlete</span>.<span class="ruby-identifier">new</span>({<span class="ruby-value">:first</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-string">'Roy'</span>, <span class="ruby-value">:last</span> =<span class="ruby-operator">&gt;</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
-