mlb 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.
- data/README.rdoc +29 -0
- data/Rakefile +58 -0
- data/doc/classes/MLB.html +308 -0
- data/doc/created.rid +1 -0
- data/doc/files/LICENSE.html +129 -0
- data/doc/files/README_rdoc.html +146 -0
- data/doc/files/lib/mlb_rb.html +110 -0
- data/doc/fr_class_index.html +27 -0
- data/doc/fr_file_index.html +29 -0
- data/doc/fr_method_index.html +29 -0
- data/doc/index.html +24 -0
- data/doc/rdoc-style.css +208 -0
- data/lib/mlb.rb +63 -26
- metadata +15 -4
- data/README.markdown +0 -52
data/README.rdoc
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
= MLB.rb
|
2
|
+
==== MLB.rb is a Ruby library for retrieving current Major League Baseball players, managers, teams, divisions, and leagues.
|
3
|
+
|
4
|
+
=== Get it
|
5
|
+
At the command prompt, type:
|
6
|
+
gem install mlb -s http://gemcutter.org
|
7
|
+
|
8
|
+
=== Use it
|
9
|
+
$ irb
|
10
|
+
>> require 'mlb'
|
11
|
+
>> MLB.teams.first.name # => "Arizona Diamondbacks"
|
12
|
+
>> MLB.teams.first.league # => "National League"
|
13
|
+
>> MLB.teams.first.division # => "National League West"
|
14
|
+
>> MLB.teams.first.manager # => "Bob Melvin"
|
15
|
+
>> MLB.teams.first.wins # => 82
|
16
|
+
>> MLB.teams.first.losses # => 80
|
17
|
+
>> MLB.teams.first.founded # => 1998
|
18
|
+
>> MLB.teams.first.mascot # => nil
|
19
|
+
>> MLB.teams.first.ballpark # => "Chase Field"
|
20
|
+
>> MLB.teams.first.logo_url # => "http://img.freebase.com/api/trans/image_thumb/wikipedia/images/en_id/13104064"
|
21
|
+
>> MLB.teams.first.players.first.name # => "Alex Romero"
|
22
|
+
>> MLB.teams.first.players.first.number # => 28
|
23
|
+
>> MLB.teams.first.players.first.position # => "Right fielder"
|
24
|
+
|
25
|
+
=== Acknowledgements
|
26
|
+
Many thanks to:
|
27
|
+
* Freebase[http://www.freebase.com]
|
28
|
+
* httparty[http://github.com/jnunemaker/httparty]
|
29
|
+
Also, thanks to beer[http://www.21st-amendment.com].
|
data/Rakefile
ADDED
@@ -0,0 +1,58 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rake'
|
3
|
+
require 'rake/gempackagetask'
|
4
|
+
require 'rake/rdoctask'
|
5
|
+
|
6
|
+
GEM_NAME = "mlb"
|
7
|
+
AUTHOR = "Erik Michaels-Ober"
|
8
|
+
EMAIL = "sferik@gmail.com"
|
9
|
+
HOMEPAGE = "http://github.com/sferik/mlb"
|
10
|
+
SUMMARY = "MLB.rb is a Ruby library for retrieving current Major League Baseball players, managers, teams, divisions, and leagues."
|
11
|
+
GEM_VERSION = "0.0.4"
|
12
|
+
|
13
|
+
spec = Gem::Specification.new do |s|
|
14
|
+
s.name = GEM_NAME
|
15
|
+
s.version = GEM_VERSION
|
16
|
+
s.platform = Gem::Platform::RUBY
|
17
|
+
s.has_rdoc = true
|
18
|
+
s.extra_rdoc_files = ["README.rdoc", "LICENSE"]
|
19
|
+
s.summary = SUMMARY
|
20
|
+
s.description = s.summary
|
21
|
+
s.author = AUTHOR
|
22
|
+
s.email = EMAIL
|
23
|
+
s.homepage = HOMEPAGE
|
24
|
+
s.add_dependency("httparty", ">= 0.4.5")
|
25
|
+
s.add_dependency("json", ">= 1.1.9")
|
26
|
+
s.require_path = "lib"
|
27
|
+
s.files = %w(LICENSE README.rdoc Rakefile) + Dir.glob("{doc,lib}/**/*")
|
28
|
+
end
|
29
|
+
|
30
|
+
Rake::GemPackageTask.new(spec) do |pkg|
|
31
|
+
pkg.gem_spec = spec
|
32
|
+
end
|
33
|
+
|
34
|
+
desc "Install the gem"
|
35
|
+
task :install do
|
36
|
+
Merb::RakeHelper.install(GEM_NAME, :version => GEM_VERSION)
|
37
|
+
end
|
38
|
+
|
39
|
+
desc "Uninstall the gem"
|
40
|
+
task :uninstall do
|
41
|
+
Merb::RakeHelper.uninstall(GEM_NAME, :version => GEM_VERSION)
|
42
|
+
end
|
43
|
+
|
44
|
+
desc "Create a gemspec file"
|
45
|
+
task :gemspec do
|
46
|
+
File.open("#{GEM_NAME}.gemspec", "w") do |file|
|
47
|
+
file.puts spec.to_ruby
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
Rake::RDocTask.new do |rd|
|
52
|
+
rd.main = 'README.rdoc'
|
53
|
+
rd.rdoc_dir = 'doc'
|
54
|
+
rd.rdoc_files.include('README.rdoc', 'LICENSE', 'lib/**/*.rb')
|
55
|
+
rd.title = 'MLB.rb'
|
56
|
+
rd.options << '--inline-source'
|
57
|
+
rd.options << '--all'
|
58
|
+
end
|
@@ -0,0 +1,308 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>Class: MLB</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="classHeader">
|
50
|
+
<table class="header-table">
|
51
|
+
<tr class="top-aligned-row">
|
52
|
+
<td><strong>Class</strong></td>
|
53
|
+
<td class="class-name-in-header">MLB</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../files/lib/mlb_rb.html">
|
59
|
+
lib/mlb.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
</td>
|
63
|
+
</tr>
|
64
|
+
|
65
|
+
<tr class="top-aligned-row">
|
66
|
+
<td><strong>Parent:</strong></td>
|
67
|
+
<td>
|
68
|
+
Object
|
69
|
+
</td>
|
70
|
+
</tr>
|
71
|
+
</table>
|
72
|
+
</div>
|
73
|
+
<!-- banner header -->
|
74
|
+
|
75
|
+
<div id="bodyContent">
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
<div id="contextContent">
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
</div>
|
84
|
+
|
85
|
+
<div id="method-list">
|
86
|
+
<h3 class="section-bar">Methods</h3>
|
87
|
+
|
88
|
+
<div class="name-list">
|
89
|
+
<a href="#M000002">exec_mql</a>
|
90
|
+
<a href="#M000003">team_query</a>
|
91
|
+
<a href="#M000001">teams</a>
|
92
|
+
</div>
|
93
|
+
</div>
|
94
|
+
|
95
|
+
</div>
|
96
|
+
|
97
|
+
|
98
|
+
<!-- if includes -->
|
99
|
+
<div id="includes">
|
100
|
+
<h3 class="section-bar">Included Modules</h3>
|
101
|
+
|
102
|
+
<div id="includes-list">
|
103
|
+
<span class="include-name">HTTParty</span>
|
104
|
+
</div>
|
105
|
+
</div>
|
106
|
+
|
107
|
+
<div id="section">
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
|
116
|
+
<!-- if method_list -->
|
117
|
+
<div id="methods">
|
118
|
+
<h3 class="section-bar">Public Class methods</h3>
|
119
|
+
|
120
|
+
<div id="method-M000001" class="method-detail">
|
121
|
+
<a name="M000001"></a>
|
122
|
+
|
123
|
+
<div class="method-heading">
|
124
|
+
<a href="#M000001" class="method-signature">
|
125
|
+
<span class="method-name">teams</span><span class="method-args">()</span>
|
126
|
+
</a>
|
127
|
+
</div>
|
128
|
+
|
129
|
+
<div class="method-description">
|
130
|
+
<p>
|
131
|
+
Returns an array of objects, one for each Major League Baseball team
|
132
|
+
</p>
|
133
|
+
<pre>
|
134
|
+
MLB.teams.first.name # => "Arizona Diamondbacks"
|
135
|
+
MLB.teams.first.league # => "National League"
|
136
|
+
MLB.teams.first.division # => "National League West"
|
137
|
+
MLB.teams.first.manager # => "Bob Melvin"
|
138
|
+
MLB.teams.first.wins # => 82
|
139
|
+
MLB.teams.first.losses # => 80
|
140
|
+
MLB.teams.first.founded # => 1998
|
141
|
+
MLB.teams.first.mascot # => nil
|
142
|
+
MLB.teams.first.ballpark # => "Chase Field"
|
143
|
+
MLB.teams.first.logo_url # => "http://img.freebase.com/api/trans/image_thumb/wikipedia/images/en_id/13104064"
|
144
|
+
MLB.teams.first.players.first.name # => "Alex Romero"
|
145
|
+
MLB.teams.first.players.first.number # => 28
|
146
|
+
MLB.teams.first.players.first.position # => "Right fielder"
|
147
|
+
</pre>
|
148
|
+
<p><a class="source-toggle" href="#"
|
149
|
+
onclick="toggleCode('M000001-source');return false;">[Source]</a></p>
|
150
|
+
<div class="method-source-code" id="M000001-source">
|
151
|
+
<pre>
|
152
|
+
<span class="ruby-comment cmt"># File lib/mlb.rb, line 24</span>
|
153
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">teams</span>
|
154
|
+
<span class="ruby-identifier">format</span> <span class="ruby-identifier">:json</span>
|
155
|
+
<span class="ruby-ivar">@query</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">team_query</span>
|
156
|
+
<span class="ruby-ivar">@response</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">exec_mql</span>(<span class="ruby-ivar">@query</span>)
|
157
|
+
<span class="ruby-ivar">@results</span> <span class="ruby-operator">||=</span> []
|
158
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@results</span>.<span class="ruby-identifier">empty?</span>
|
159
|
+
<span class="ruby-ivar">@response</span>[<span class="ruby-value str">'result'</span>].<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">result</span><span class="ruby-operator">|</span>
|
160
|
+
<span class="ruby-ivar">@results</span> <span class="ruby-operator"><<</span> <span class="ruby-constant">OpenStruct</span>.<span class="ruby-identifier">new</span>({
|
161
|
+
<span class="ruby-identifier">:name</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">result</span>[<span class="ruby-value str">'name'</span>],
|
162
|
+
<span class="ruby-identifier">:league</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">result</span>[<span class="ruby-value str">'league'</span>][<span class="ruby-value str">'name'</span>],
|
163
|
+
<span class="ruby-identifier">:division</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">result</span>[<span class="ruby-value str">'division'</span>][<span class="ruby-value str">'name'</span>],
|
164
|
+
<span class="ruby-identifier">:manager</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">result</span>[<span class="ruby-value str">'current_manager'</span>][<span class="ruby-value str">'name'</span>],
|
165
|
+
<span class="ruby-identifier">:wins</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">result</span>[<span class="ruby-value str">'team_stats'</span>].<span class="ruby-identifier">first</span>[<span class="ruby-value str">'wins'</span>].<span class="ruby-identifier">to_i</span>,
|
166
|
+
<span class="ruby-identifier">:losses</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">result</span>[<span class="ruby-value str">'team_stats'</span>].<span class="ruby-identifier">first</span>[<span class="ruby-value str">'losses'</span>].<span class="ruby-identifier">to_i</span>,
|
167
|
+
<span class="ruby-identifier">:founded</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">result</span>[<span class="ruby-value str">'/sports/sports_team/founded'</span>].<span class="ruby-identifier">first</span>[<span class="ruby-value str">'value'</span>].<span class="ruby-identifier">to_i</span>,
|
168
|
+
<span class="ruby-identifier">:mascot</span> =<span class="ruby-operator">></span> (<span class="ruby-identifier">result</span>[<span class="ruby-value str">'/sports/sports_team/team_mascot'</span>].<span class="ruby-identifier">first</span> <span class="ruby-value">? </span><span class="ruby-identifier">result</span>[<span class="ruby-value str">'/sports/sports_team/team_mascot'</span>].<span class="ruby-identifier">first</span>[<span class="ruby-value str">'name'</span>] <span class="ruby-operator">:</span> <span class="ruby-keyword kw">nil</span>),
|
169
|
+
<span class="ruby-identifier">:ballpark</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">result</span>[<span class="ruby-value str">'/sports/sports_team/arena_stadium'</span>].<span class="ruby-identifier">first</span>[<span class="ruby-value str">'name'</span>],
|
170
|
+
<span class="ruby-identifier">:logo_url</span> =<span class="ruby-operator">></span> <span class="ruby-value str">'http://img.freebase.com/api/trans/image_thumb'</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">result</span>[<span class="ruby-value str">'/common/topic/image'</span>].<span class="ruby-identifier">first</span>[<span class="ruby-value str">'id'</span>],
|
171
|
+
<span class="ruby-identifier">:players</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">result</span>[<span class="ruby-value str">'current_roster'</span>].<span class="ruby-identifier">map</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">player</span><span class="ruby-operator">|</span>
|
172
|
+
<span class="ruby-constant">OpenStruct</span>.<span class="ruby-identifier">new</span>({
|
173
|
+
<span class="ruby-identifier">:name</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">player</span>[<span class="ruby-value str">'player'</span>],
|
174
|
+
<span class="ruby-identifier">:number</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">player</span>[<span class="ruby-value str">'number'</span>],
|
175
|
+
<span class="ruby-identifier">:position</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">player</span>[<span class="ruby-value str">'position'</span>],
|
176
|
+
})
|
177
|
+
},
|
178
|
+
})
|
179
|
+
<span class="ruby-keyword kw">end</span>
|
180
|
+
<span class="ruby-keyword kw">end</span>
|
181
|
+
<span class="ruby-ivar">@results</span>
|
182
|
+
<span class="ruby-keyword kw">end</span>
|
183
|
+
</pre>
|
184
|
+
</div>
|
185
|
+
</div>
|
186
|
+
</div>
|
187
|
+
|
188
|
+
<h3 class="section-bar">Private Class methods</h3>
|
189
|
+
|
190
|
+
<div id="method-M000002" class="method-detail">
|
191
|
+
<a name="M000002"></a>
|
192
|
+
|
193
|
+
<div class="method-heading">
|
194
|
+
<a href="#M000002" class="method-signature">
|
195
|
+
<span class="method-name">exec_mql</span><span class="method-args">(query)</span>
|
196
|
+
</a>
|
197
|
+
</div>
|
198
|
+
|
199
|
+
<div class="method-description">
|
200
|
+
<p>
|
201
|
+
Converts MQL query to JSON and sends to Freebase API
|
202
|
+
</p>
|
203
|
+
<p><a class="source-toggle" href="#"
|
204
|
+
onclick="toggleCode('M000002-source');return false;">[Source]</a></p>
|
205
|
+
<div class="method-source-code" id="M000002-source">
|
206
|
+
<pre>
|
207
|
+
<span class="ruby-comment cmt"># File lib/mlb.rb, line 58</span>
|
208
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">exec_mql</span>(<span class="ruby-identifier">query</span>)
|
209
|
+
<span class="ruby-keyword kw">begin</span>
|
210
|
+
<span class="ruby-identifier">response</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">get</span>(<span class="ruby-value str">'/service/mqlread?'</span>, <span class="ruby-identifier">:query</span> =<span class="ruby-operator">></span> {<span class="ruby-identifier">:query</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">query</span>.<span class="ruby-identifier">to_json</span>})
|
211
|
+
<span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">response</span>[<span class="ruby-value str">'code'</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">'/api/status/ok'</span>
|
212
|
+
<span class="ruby-identifier">errors</span> = <span class="ruby-constant">Array</span>(<span class="ruby-identifier">response</span>[<span class="ruby-value str">'messages'</span>]).<span class="ruby-identifier">map</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">m</span><span class="ruby-operator">|</span> <span class="ruby-identifier">m</span>.<span class="ruby-identifier">inspect</span>}.<span class="ruby-identifier">join</span>(<span class="ruby-value str">', '</span>)
|
213
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-node">"#{response['status']}: #{errors} (#{response['transaction_id']})"</span>
|
214
|
+
<span class="ruby-keyword kw">end</span>
|
215
|
+
<span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">SocketError</span>, <span class="ruby-constant">Errno</span><span class="ruby-operator">::</span><span class="ruby-constant">ECONNREFUSED</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">e</span>
|
216
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">Exception</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">"Could not connect. Unclog tubes and try again."</span>)
|
217
|
+
<span class="ruby-keyword kw">end</span>
|
218
|
+
<span class="ruby-identifier">response</span>
|
219
|
+
<span class="ruby-keyword kw">end</span>
|
220
|
+
</pre>
|
221
|
+
</div>
|
222
|
+
</div>
|
223
|
+
</div>
|
224
|
+
|
225
|
+
<div id="method-M000003" class="method-detail">
|
226
|
+
<a name="M000003"></a>
|
227
|
+
|
228
|
+
<div class="method-heading">
|
229
|
+
<a href="#M000003" class="method-signature">
|
230
|
+
<span class="method-name">team_query</span><span class="method-args">()</span>
|
231
|
+
</a>
|
232
|
+
</div>
|
233
|
+
|
234
|
+
<div class="method-description">
|
235
|
+
<p>
|
236
|
+
Returns the MQL query for <a href="MLB.html#M000001">teams</a>, as a Ruby
|
237
|
+
hash
|
238
|
+
</p>
|
239
|
+
<p><a class="source-toggle" href="#"
|
240
|
+
onclick="toggleCode('M000003-source');return false;">[Source]</a></p>
|
241
|
+
<div class="method-source-code" id="M000003-source">
|
242
|
+
<pre>
|
243
|
+
<span class="ruby-comment cmt"># File lib/mlb.rb, line 72</span>
|
244
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">team_query</span>
|
245
|
+
{
|
246
|
+
<span class="ruby-identifier">:query</span> =<span class="ruby-operator">></span> [
|
247
|
+
{
|
248
|
+
<span class="ruby-value str">'name'</span> =<span class="ruby-operator">></span> <span class="ruby-keyword kw">nil</span>,
|
249
|
+
<span class="ruby-value str">'league'</span> =<span class="ruby-operator">></span> {
|
250
|
+
<span class="ruby-value str">'name'</span> =<span class="ruby-operator">></span> <span class="ruby-keyword kw">nil</span>,
|
251
|
+
},
|
252
|
+
<span class="ruby-value str">'division'</span> =<span class="ruby-operator">></span> {
|
253
|
+
<span class="ruby-value str">'name'</span> =<span class="ruby-operator">></span> <span class="ruby-keyword kw">nil</span>,
|
254
|
+
},
|
255
|
+
<span class="ruby-value str">'current_manager'</span> =<span class="ruby-operator">></span> {
|
256
|
+
<span class="ruby-value str">'name'</span> =<span class="ruby-operator">></span> <span class="ruby-keyword kw">nil</span>,
|
257
|
+
},
|
258
|
+
<span class="ruby-value str">'team_stats'</span> =<span class="ruby-operator">></span> [{
|
259
|
+
<span class="ruby-value str">'wins'</span> =<span class="ruby-operator">></span> <span class="ruby-keyword kw">nil</span>,
|
260
|
+
<span class="ruby-value str">'losses'</span> =<span class="ruby-operator">></span> <span class="ruby-keyword kw">nil</span>,
|
261
|
+
<span class="ruby-value str">'season'</span> =<span class="ruby-operator">></span> <span class="ruby-keyword kw">nil</span>,
|
262
|
+
<span class="ruby-value str">'limit'</span> =<span class="ruby-operator">></span> <span class="ruby-value">1</span>,
|
263
|
+
<span class="ruby-value str">'sort'</span> =<span class="ruby-operator">></span> <span class="ruby-value str">'-season'</span>,
|
264
|
+
}],
|
265
|
+
<span class="ruby-value str">'current_roster'</span> =<span class="ruby-operator">></span> [{
|
266
|
+
<span class="ruby-value str">'player'</span> =<span class="ruby-operator">></span> <span class="ruby-keyword kw">nil</span>,
|
267
|
+
<span class="ruby-value str">'position'</span> =<span class="ruby-operator">></span> <span class="ruby-keyword kw">nil</span>,
|
268
|
+
<span class="ruby-value str">'number'</span> =<span class="ruby-operator">></span> <span class="ruby-keyword kw">nil</span>,
|
269
|
+
<span class="ruby-value str">'sort'</span> =<span class="ruby-operator">></span> <span class="ruby-value str">'player'</span>,
|
270
|
+
}],
|
271
|
+
<span class="ruby-value str">'/sports/sports_team/founded'</span> =<span class="ruby-operator">></span> [{
|
272
|
+
<span class="ruby-value str">'value'</span> =<span class="ruby-operator">></span> <span class="ruby-keyword kw">nil</span>,
|
273
|
+
}],
|
274
|
+
<span class="ruby-value str">'/sports/sports_team/team_mascot'</span> =<span class="ruby-operator">></span> [{
|
275
|
+
}],
|
276
|
+
<span class="ruby-value str">'/sports/sports_team/arena_stadium'</span> =<span class="ruby-operator">></span> [{
|
277
|
+
<span class="ruby-value str">'name'</span> =<span class="ruby-operator">></span> <span class="ruby-keyword kw">nil</span>,
|
278
|
+
}],
|
279
|
+
<span class="ruby-value str">'/common/topic/image'</span> =<span class="ruby-operator">></span> [{
|
280
|
+
<span class="ruby-value str">'id'</span> =<span class="ruby-operator">></span> <span class="ruby-keyword kw">nil</span>,
|
281
|
+
<span class="ruby-value str">'timestamp'</span> =<span class="ruby-operator">></span> <span class="ruby-keyword kw">nil</span>,
|
282
|
+
<span class="ruby-value str">'sort'</span> =<span class="ruby-operator">></span> <span class="ruby-value str">'-timestamp'</span>,
|
283
|
+
<span class="ruby-value str">'limit'</span> =<span class="ruby-operator">></span> <span class="ruby-value">1</span>,
|
284
|
+
}],
|
285
|
+
<span class="ruby-value str">'sort'</span> =<span class="ruby-operator">></span> <span class="ruby-value str">'name'</span>,
|
286
|
+
<span class="ruby-value str">'type'</span> =<span class="ruby-operator">></span> <span class="ruby-value str">'/baseball/baseball_team'</span>,
|
287
|
+
}
|
288
|
+
]
|
289
|
+
}
|
290
|
+
<span class="ruby-keyword kw">end</span>
|
291
|
+
</pre>
|
292
|
+
</div>
|
293
|
+
</div>
|
294
|
+
</div>
|
295
|
+
|
296
|
+
|
297
|
+
</div>
|
298
|
+
|
299
|
+
|
300
|
+
</div>
|
301
|
+
|
302
|
+
|
303
|
+
<div id="validator-badges">
|
304
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
305
|
+
</div>
|
306
|
+
|
307
|
+
</body>
|
308
|
+
</html>
|
data/doc/created.rid
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
Fri, 16 Oct 2009 16:33:38 -0700
|
@@ -0,0 +1,129 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>File: LICENSE</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="fileHeader">
|
50
|
+
<h1>LICENSE</h1>
|
51
|
+
<table class="header-table">
|
52
|
+
<tr class="top-aligned-row">
|
53
|
+
<td><strong>Path:</strong></td>
|
54
|
+
<td>LICENSE
|
55
|
+
</td>
|
56
|
+
</tr>
|
57
|
+
<tr class="top-aligned-row">
|
58
|
+
<td><strong>Last Update:</strong></td>
|
59
|
+
<td>Mon Oct 05 22:39:47 -0700 2009</td>
|
60
|
+
</tr>
|
61
|
+
</table>
|
62
|
+
</div>
|
63
|
+
<!-- banner header -->
|
64
|
+
|
65
|
+
<div id="bodyContent">
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
<div id="contextContent">
|
70
|
+
|
71
|
+
<div id="description">
|
72
|
+
<p>
|
73
|
+
Copyright (c) 2009 Erik Michaels-Ober
|
74
|
+
</p>
|
75
|
+
<p>
|
76
|
+
Permission is hereby granted, free of charge, to any person obtaining a
|
77
|
+
copy of this software and associated documentation files (the
|
78
|
+
"Software"), to deal in the Software without restriction,
|
79
|
+
including without limitation the rights to use, copy, modify, merge,
|
80
|
+
publish, distribute, sublicense, and/or sell copies of the Software, and to
|
81
|
+
permit persons to whom the Software is furnished to do so, subject to the
|
82
|
+
following conditions:
|
83
|
+
</p>
|
84
|
+
<p>
|
85
|
+
The above copyright notice and this permission notice shall be included in
|
86
|
+
all copies or substantial portions of the Software.
|
87
|
+
</p>
|
88
|
+
<p>
|
89
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
90
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
91
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
|
92
|
+
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
93
|
+
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
94
|
+
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
95
|
+
USE OR OTHER DEALINGS IN THE SOFTWARE.
|
96
|
+
</p>
|
97
|
+
|
98
|
+
</div>
|
99
|
+
|
100
|
+
|
101
|
+
</div>
|
102
|
+
|
103
|
+
|
104
|
+
</div>
|
105
|
+
|
106
|
+
|
107
|
+
<!-- if includes -->
|
108
|
+
|
109
|
+
<div id="section">
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
|
116
|
+
|
117
|
+
|
118
|
+
<!-- if method_list -->
|
119
|
+
|
120
|
+
|
121
|
+
</div>
|
122
|
+
|
123
|
+
|
124
|
+
<div id="validator-badges">
|
125
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
126
|
+
</div>
|
127
|
+
|
128
|
+
</body>
|
129
|
+
</html>
|