sofa 0.1.0 → 0.1.1
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/spec/sofa/tvrage/episode_spec.rb +11 -0
- data/spec/spec_helper.rb +2 -2
- metadata +111 -122
- data/.document +0 -5
- data/.gitignore +0 -22
- data/.yardopts +0 -6
- data/Rakefile +0 -76
- data/doc/Sofa.html +0 -85
- data/doc/Sofa/Mapping.html +0 -168
- data/doc/Sofa/Mapping/ClassMethods.html +0 -314
- data/doc/Sofa/Mapping/InstanceMethods.html +0 -358
- data/doc/Sofa/TVRage.html +0 -85
- data/doc/Sofa/TVRage/Episode.html +0 -358
- data/doc/Sofa/TVRage/Schedule.html +0 -207
- data/doc/Sofa/TVRage/Season.html +0 -236
- data/doc/Sofa/TVRage/Show.html +0 -904
- data/doc/Sofa/TVRage/Show/ShowNotFound.html +0 -92
- data/doc/Sofa/Version.html +0 -100
- data/doc/_index.html +0 -206
- data/doc/class_list.html +0 -137
- data/doc/css/common.css +0 -1
- data/doc/css/full_list.css +0 -23
- data/doc/css/style.css +0 -261
- data/doc/file.README.html +0 -120
- data/doc/file_list.html +0 -29
- data/doc/index.html +0 -120
- data/doc/js/app.js +0 -91
- data/doc/js/full_list.js +0 -39
- data/doc/js/jquery.js +0 -19
- data/doc/method_list.html +0 -192
- data/doc/top-level-namespace.html +0 -80
- data/lib/sofa.rb +0 -5
- data/lib/sofa/mapping.rb +0 -108
- data/lib/sofa/tvrage.rb +0 -10
- data/lib/sofa/tvrage/episode.rb +0 -39
- data/lib/sofa/tvrage/schedule.rb +0 -25
- data/lib/sofa/tvrage/season.rb +0 -36
- data/lib/sofa/tvrage/show.rb +0 -132
- data/lib/sofa/version.rb +0 -8
- data/sofa.gemspec +0 -126
- data/spec/fixtures/tvrage/cases/castle.xml +0 -228
- data/spec/fixtures/tvrage/cases/community.xml +0 -109
- data/spec/fixtures/tvrage/cases/live_with_regis_and_kelly.xml +0 -56237
- data/spec/fixtures/tvrage/episode_list.xml +0 -1183
- data/spec/fixtures/tvrage/episode_list_one_season.xml +0 -17
- data/spec/fixtures/tvrage/episode_list_two_episodes.xml +0 -25
- data/spec/fixtures/tvrage/full_schedule.xml +0 -4731
- data/spec/fixtures/tvrage/full_show_info.xml +0 -1291
- data/spec/fixtures/tvrage/quickinfo.html +0 -17
- data/spec/fixtures/tvrage/quickinfo_missing.html +0 -1
- data/spec/fixtures/tvrage/search.xml +0 -151
- data/spec/fixtures/tvrage/show_info.xml +0 -42
- data/spec/fixtures/tvrage/show_info_blank.xml +0 -3
- data/spec/fixtures/tvrage/single_episode.xml +0 -8
- data/spec/spec.opts +0 -1
data/doc/Sofa/Mapping.html
DELETED
@@ -1,168 +0,0 @@
|
|
1
|
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
-
<head>
|
5
|
-
<meta name="Content-Type" content="text/html; charset=UTF-8" />
|
6
|
-
<title>Module: Sofa::Mapping</title>
|
7
|
-
<link rel="stylesheet" href="../css/style.css" type="text/css" media="screen" charset="utf-8" />
|
8
|
-
<link rel="stylesheet" href="../css/common.css" type="text/css" media="screen" charset="utf-8" />
|
9
|
-
|
10
|
-
<script type="text/javascript" charset="utf-8">
|
11
|
-
relpath = '..';
|
12
|
-
if (relpath != '') relpath += '/';
|
13
|
-
</script>
|
14
|
-
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
15
|
-
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
16
|
-
|
17
|
-
</head>
|
18
|
-
<body>
|
19
|
-
<div id="header">
|
20
|
-
<div id="menu">
|
21
|
-
|
22
|
-
<a href="../_index.html">Index (M)</a> »
|
23
|
-
<a title="Sofa" href="../Sofa.html">Sofa</a>
|
24
|
-
»
|
25
|
-
<span class="title">Mapping</span>
|
26
|
-
|
27
|
-
</div>
|
28
|
-
|
29
|
-
<div id="search">
|
30
|
-
<a id="class_list_link" href="#">Namespace List</a>
|
31
|
-
<a id="method_list_link" href="#">Method List</a>
|
32
|
-
<a id ="file_list_link" href="#">File List</a>
|
33
|
-
</div>
|
34
|
-
|
35
|
-
<div class="clear"></div>
|
36
|
-
</div>
|
37
|
-
|
38
|
-
<iframe id="search_frame"></iframe>
|
39
|
-
|
40
|
-
<div id="content"><h1>Module: Sofa::Mapping
|
41
|
-
|
42
|
-
|
43
|
-
</h1>
|
44
|
-
|
45
|
-
<dl class="box">
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
<dt class="r1 last">Defined in:</dt>
|
54
|
-
<dd class="r1 last">lib/sofa/mapping.rb</dd>
|
55
|
-
|
56
|
-
</dl>
|
57
|
-
<div class="clear"></div>
|
58
|
-
|
59
|
-
<h2>Defined Under Namespace</h2>
|
60
|
-
<p class="children">
|
61
|
-
|
62
|
-
|
63
|
-
<strong class="modules">Modules:</strong> <a title="ClassMethods" href="Mapping/ClassMethods.html">ClassMethods</a>, <a title="InstanceMethods" href="Mapping/InstanceMethods.html">InstanceMethods</a>
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
</p>
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
<h2>Method Summary</h2>
|
73
|
-
<ul class="summary">
|
74
|
-
|
75
|
-
<li class="public ">
|
76
|
-
<span class="summary_signature"><a title="included (class method)" href="#included-class_method">+ (Object) <strong>included</strong>(base) </a>
|
77
|
-
|
78
|
-
</span>
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
<span class="summary_desc">This method is automatically called when <tt><a title="Mapping" href="">Mapping</a></tt> is included in a module.</span>
|
86
|
-
|
87
|
-
</li>
|
88
|
-
|
89
|
-
|
90
|
-
</ul>
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
<div id="method_details">
|
95
|
-
<h2>Method Details</h2>
|
96
|
-
|
97
|
-
<div class="method_details first">
|
98
|
-
<p class="signature first" id="included-class_method">
|
99
|
-
|
100
|
-
+ (<tt>Object</tt>) <strong>included</strong>(base)
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
</p><div class="docstring">
|
105
|
-
<div class="discussion">
|
106
|
-
<p>This method is automatically called when <tt><a title="Mapping" href="">Mapping</a></tt> is included in a module. It automatically adds <tt><a title="InstanceMethods" href="Mapping/InstanceMethods.html">InstanceMethods</a></tt>, <tt><a title="ClassMethods" href="Mapping/ClassMethods.html">ClassMethods</a></tt> and initializes @mappings and @mappings_procs to empty Hashes.</p>
|
107
|
-
|
108
|
-
</div>
|
109
|
-
</div>
|
110
|
-
<div class="tags">
|
111
|
-
<h3>Parameters:</h3>
|
112
|
-
<ul class="param">
|
113
|
-
|
114
|
-
<li>
|
115
|
-
|
116
|
-
<span class='type'>(<tt>Module</tt>, <tt>Class</tt>)</span>
|
117
|
-
|
118
|
-
|
119
|
-
<span class='name'>base</span>
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
—
|
124
|
-
The module that this is included in
|
125
|
-
|
126
|
-
</li>
|
127
|
-
|
128
|
-
</ul>
|
129
|
-
|
130
|
-
</div><table class="source_code">
|
131
|
-
<tr>
|
132
|
-
<td>
|
133
|
-
<pre class="lines">
|
134
|
-
|
135
|
-
|
136
|
-
8
|
137
|
-
9
|
138
|
-
10
|
139
|
-
11
|
140
|
-
12
|
141
|
-
13</pre>
|
142
|
-
</td>
|
143
|
-
<td>
|
144
|
-
<pre class="code"><span class="info file"># File 'lib/sofa/mapping.rb', line 8</span>
|
145
|
-
|
146
|
-
def self.included(base)
|
147
|
-
base.send(:include, InstanceMethods)
|
148
|
-
base.extend(ClassMethods)
|
149
|
-
base.instance_variable_set("@mappings", {})
|
150
|
-
base.instance_variable_set("@mappings_procs", {})
|
151
|
-
end</pre>
|
152
|
-
</td>
|
153
|
-
</tr>
|
154
|
-
</table>
|
155
|
-
</div>
|
156
|
-
|
157
|
-
</div>
|
158
|
-
|
159
|
-
</div>
|
160
|
-
|
161
|
-
<div id="footer">
|
162
|
-
Generated on Sat Nov 21 20:13:53 2009 by
|
163
|
-
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool">yard</a>
|
164
|
-
0.4.0 (ruby-1.8.7).
|
165
|
-
</div>
|
166
|
-
|
167
|
-
</body>
|
168
|
-
</html>
|
@@ -1,314 +0,0 @@
|
|
1
|
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
-
<head>
|
5
|
-
<meta name="Content-Type" content="text/html; charset=UTF-8" />
|
6
|
-
<title>Module: Sofa::Mapping::ClassMethods</title>
|
7
|
-
<link rel="stylesheet" href="../../css/style.css" type="text/css" media="screen" charset="utf-8" />
|
8
|
-
<link rel="stylesheet" href="../../css/common.css" type="text/css" media="screen" charset="utf-8" />
|
9
|
-
|
10
|
-
<script type="text/javascript" charset="utf-8">
|
11
|
-
relpath = '../..';
|
12
|
-
if (relpath != '') relpath += '/';
|
13
|
-
</script>
|
14
|
-
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
15
|
-
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
16
|
-
|
17
|
-
</head>
|
18
|
-
<body>
|
19
|
-
<div id="header">
|
20
|
-
<div id="menu">
|
21
|
-
|
22
|
-
<a href="../../_index.html">Index (C)</a> »
|
23
|
-
<a title="Sofa" href="../../Sofa.html">Sofa</a> » <a title="Mapping" href="../Mapping.html">Mapping</a>
|
24
|
-
»
|
25
|
-
<span class="title">ClassMethods</span>
|
26
|
-
|
27
|
-
</div>
|
28
|
-
|
29
|
-
<div id="search">
|
30
|
-
<a id="class_list_link" href="#">Namespace List</a>
|
31
|
-
<a id="method_list_link" href="#">Method List</a>
|
32
|
-
<a id ="file_list_link" href="#">File List</a>
|
33
|
-
</div>
|
34
|
-
|
35
|
-
<div class="clear"></div>
|
36
|
-
</div>
|
37
|
-
|
38
|
-
<iframe id="search_frame"></iframe>
|
39
|
-
|
40
|
-
<div id="content"><h1>Module: Sofa::Mapping::ClassMethods
|
41
|
-
|
42
|
-
|
43
|
-
</h1>
|
44
|
-
|
45
|
-
<dl class="box">
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
<dt class="r1 last">Defined in:</dt>
|
54
|
-
<dd class="r1 last">lib/sofa/mapping.rb</dd>
|
55
|
-
|
56
|
-
</dl>
|
57
|
-
<div class="clear"></div>
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
<h2>Method Summary</h2>
|
63
|
-
<ul class="summary">
|
64
|
-
|
65
|
-
<li class="public ">
|
66
|
-
<span class="summary_signature"><a title="#mappings (instance method)" href="#mappings-instance_method">- (Hash<Symbol, Symbol>) <strong>mappings</strong> </a>
|
67
|
-
|
68
|
-
</span>
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
<span class="summary_desc">Mapping of symbols to attribute names.</span>
|
76
|
-
|
77
|
-
</li>
|
78
|
-
|
79
|
-
|
80
|
-
<li class="public ">
|
81
|
-
<span class="summary_signature"><a title="#mappings_procs (instance method)" href="#mappings_procs-instance_method">- (Hash<Symbol, Proc>) <strong>mappings_procs</strong> </a>
|
82
|
-
|
83
|
-
</span>
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
<span class="summary_desc">Mapping of attribute names to a Proc filter.</span>
|
91
|
-
|
92
|
-
</li>
|
93
|
-
|
94
|
-
|
95
|
-
<li class="public ">
|
96
|
-
<span class="summary_signature"><a title="#maps (instance method)" href="#maps-instance_method">- (Object) <strong>maps</strong>(hash = {}, &block) </a>
|
97
|
-
|
98
|
-
</span>
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
<span class="summary_desc">Class method to define mappings.</span>
|
106
|
-
|
107
|
-
</li>
|
108
|
-
|
109
|
-
|
110
|
-
</ul>
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
<div id="method_details">
|
115
|
-
<h2>Method Details</h2>
|
116
|
-
|
117
|
-
<div class="method_details first">
|
118
|
-
<p class="signature first" id="mappings-instance_method">
|
119
|
-
|
120
|
-
- (<tt>Hash<Symbol, Symbol></tt>) <strong>mappings</strong>
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
</p><div class="docstring">
|
125
|
-
<div class="discussion">
|
126
|
-
<p>Mapping of symbols to attribute names</p>
|
127
|
-
|
128
|
-
</div>
|
129
|
-
</div>
|
130
|
-
<div class="tags">
|
131
|
-
<h3>Returns:</h3>
|
132
|
-
<ul class="return">
|
133
|
-
|
134
|
-
<li>
|
135
|
-
|
136
|
-
<span class='type'>(<tt>Hash<Symbol, Symbol></tt>)</span>
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
—
|
142
|
-
Mapping of symbols to attribute names
|
143
|
-
|
144
|
-
</li>
|
145
|
-
|
146
|
-
</ul>
|
147
|
-
|
148
|
-
</div><table class="source_code">
|
149
|
-
<tr>
|
150
|
-
<td>
|
151
|
-
<pre class="lines">
|
152
|
-
|
153
|
-
|
154
|
-
96
|
155
|
-
97
|
156
|
-
98</pre>
|
157
|
-
</td>
|
158
|
-
<td>
|
159
|
-
<pre class="code"><span class="info file"># File 'lib/sofa/mapping.rb', line 96</span>
|
160
|
-
|
161
|
-
def mappings
|
162
|
-
@mappings
|
163
|
-
end</pre>
|
164
|
-
</td>
|
165
|
-
</tr>
|
166
|
-
</table>
|
167
|
-
</div>
|
168
|
-
|
169
|
-
<div class="method_details ">
|
170
|
-
<p class="signature " id="mappings_procs-instance_method">
|
171
|
-
|
172
|
-
- (<tt>Hash<Symbol, Proc></tt>) <strong>mappings_procs</strong>
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
</p><div class="docstring">
|
177
|
-
<div class="discussion">
|
178
|
-
<p>Mapping of attribute names to a Proc filter.</p>
|
179
|
-
|
180
|
-
</div>
|
181
|
-
</div>
|
182
|
-
<div class="tags">
|
183
|
-
<h3>Returns:</h3>
|
184
|
-
<ul class="return">
|
185
|
-
|
186
|
-
<li>
|
187
|
-
|
188
|
-
<span class='type'>(<tt>Hash<Symbol, Proc></tt>)</span>
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
—
|
194
|
-
Mapping of attribute names to a Proc filter.
|
195
|
-
|
196
|
-
</li>
|
197
|
-
|
198
|
-
</ul>
|
199
|
-
|
200
|
-
<h3>See Also:</h3>
|
201
|
-
<ul class="see">
|
202
|
-
|
203
|
-
<li><a title="#maps" href="#maps-instance_method">#maps</a></li>
|
204
|
-
|
205
|
-
</ul>
|
206
|
-
|
207
|
-
</div><table class="source_code">
|
208
|
-
<tr>
|
209
|
-
<td>
|
210
|
-
<pre class="lines">
|
211
|
-
|
212
|
-
|
213
|
-
103
|
214
|
-
104
|
215
|
-
105</pre>
|
216
|
-
</td>
|
217
|
-
<td>
|
218
|
-
<pre class="code"><span class="info file"># File 'lib/sofa/mapping.rb', line 103</span>
|
219
|
-
|
220
|
-
def mappings_procs
|
221
|
-
@mappings_procs
|
222
|
-
end</pre>
|
223
|
-
</td>
|
224
|
-
</tr>
|
225
|
-
</table>
|
226
|
-
</div>
|
227
|
-
|
228
|
-
<div class="method_details ">
|
229
|
-
<p class="signature " id="maps-instance_method">
|
230
|
-
|
231
|
-
- (<tt>Object</tt>) <strong>maps</strong>(hash = {}, &block)
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
</p><div class="docstring">
|
236
|
-
<div class="discussion">
|
237
|
-
<p>Class method to define mappings.</p>
|
238
|
-
|
239
|
-
</div>
|
240
|
-
</div>
|
241
|
-
<div class="tags">
|
242
|
-
|
243
|
-
<div class="examples">
|
244
|
-
<h3>Examples:</h3>
|
245
|
-
|
246
|
-
<h4>Maps :examplename to :name and :link to itself.</h4>
|
247
|
-
<pre class="example code"> class Example1
|
248
|
-
include Sofa::Mapping
|
249
|
-
maps(
|
250
|
-
:examplename => :name,
|
251
|
-
:link => nil
|
252
|
-
)
|
253
|
-
end
|
254
|
-
example1 = Example1.new.update_with_mapping(:epnum => "1", :link => "http://google.com")
|
255
|
-
example1.name # => "1"
|
256
|
-
example1.link # => "http://google.com"
|
257
|
-
example1.attributes # => {:name => "1", :link => "http://google.com"}</pre>
|
258
|
-
|
259
|
-
<h4>Maps :airdate to :air_date and stores the block.</h4>
|
260
|
-
<pre class="example code"> class Example2
|
261
|
-
include Sofa::Mapping
|
262
|
-
|
263
|
-
maps(:airdate => :air_date) do |value|
|
264
|
-
Date.parse(value)
|
265
|
-
end
|
266
|
-
end
|
267
|
-
example2 = Example2.new.update_with_mapping(:airdate => "2007-07-04")
|
268
|
-
example2.attributes # => {:air_date => Wed, 04 Jul 2007}</pre>
|
269
|
-
|
270
|
-
</div>
|
271
|
-
|
272
|
-
</div><table class="source_code">
|
273
|
-
<tr>
|
274
|
-
<td>
|
275
|
-
<pre class="lines">
|
276
|
-
|
277
|
-
|
278
|
-
85
|
279
|
-
86
|
280
|
-
87
|
281
|
-
88
|
282
|
-
89
|
283
|
-
90
|
284
|
-
91
|
285
|
-
92</pre>
|
286
|
-
</td>
|
287
|
-
<td>
|
288
|
-
<pre class="code"><span class="info file"># File 'lib/sofa/mapping.rb', line 85</span>
|
289
|
-
|
290
|
-
def maps(hash = {}, &block)
|
291
|
-
hash.each do |from, to|
|
292
|
-
method = to || from
|
293
|
-
@mappings[from.to_sym] = method
|
294
|
-
attr_reader method
|
295
|
-
@mappings_procs[method] = block
|
296
|
-
end
|
297
|
-
end</pre>
|
298
|
-
</td>
|
299
|
-
</tr>
|
300
|
-
</table>
|
301
|
-
</div>
|
302
|
-
|
303
|
-
</div>
|
304
|
-
|
305
|
-
</div>
|
306
|
-
|
307
|
-
<div id="footer">
|
308
|
-
Generated on Sat Nov 21 20:13:52 2009 by
|
309
|
-
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool">yard</a>
|
310
|
-
0.4.0 (ruby-1.8.7).
|
311
|
-
</div>
|
312
|
-
|
313
|
-
</body>
|
314
|
-
</html>
|