xspf 0.3
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/AUTHORS +7 -0
- data/ChangeLog +19 -0
- data/README +26 -0
- data/coverage/doc-create_doc_rb.html +639 -0
- data/coverage/index.html +259 -0
- data/coverage/lib-xspf_rb.html +948 -0
- data/doc/created.rid +1 -0
- data/doc/fr_class_index.html +30 -0
- data/doc/fr_file_index.html +28 -0
- data/doc/fr_method_index.html +71 -0
- data/doc/index.html +24 -0
- data/examples/example.rb +36 -0
- data/examples/playlist-ext.xspf +43 -0
- data/examples/playlist.xspf +34 -0
- data/lib/xspf.rb +319 -0
- data/lib/xspf2html.xsl +212 -0
- data/lib/xspf2m3u.xsl +20 -0
- data/lib/xspf2smil.xsl +76 -0
- data/lib/xspf2soundblox.xsl +65 -0
- data/test/tc_output_formats.rb +205 -0
- data/test/tc_playlist.rb +90 -0
- data/test/tc_track.rb +85 -0
- data/test/tc_tracklist.rb +69 -0
- data/test/tc_xspf.rb +64 -0
- data/test/ts_xspf.rb +9 -0
- data/xspf-expanded.rb +152 -0
- metadata +84 -0
data/coverage/index.html
ADDED
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
2
|
+
<html lang='en' xml:lang='en' xmlns='http://www.w3.org/1999/xhtml'>
|
|
3
|
+
<head>
|
|
4
|
+
<title>C0 code coverage information</title>
|
|
5
|
+
<style type='text/css'>body { background-color: rgb(240, 240, 245); }</style>
|
|
6
|
+
<style type='text/css'>span.cross-ref-title {
|
|
7
|
+
font-size: 140%;
|
|
8
|
+
}
|
|
9
|
+
span.cross-ref a {
|
|
10
|
+
text-decoration: none;
|
|
11
|
+
}
|
|
12
|
+
span.cross-ref {
|
|
13
|
+
background-color:#f3f7fa;
|
|
14
|
+
border: 1px dashed #333;
|
|
15
|
+
margin: 1em;
|
|
16
|
+
padding: 0.5em;
|
|
17
|
+
overflow: hidden;
|
|
18
|
+
}
|
|
19
|
+
a.crossref-toggle {
|
|
20
|
+
text-decoration: none;
|
|
21
|
+
}
|
|
22
|
+
span.marked0 {
|
|
23
|
+
background-color: rgb(185, 210, 200);
|
|
24
|
+
display: block;
|
|
25
|
+
}
|
|
26
|
+
span.marked1 {
|
|
27
|
+
background-color: rgb(190, 215, 205);
|
|
28
|
+
display: block;
|
|
29
|
+
}
|
|
30
|
+
span.inferred0 {
|
|
31
|
+
background-color: rgb(175, 200, 200);
|
|
32
|
+
display: block;
|
|
33
|
+
}
|
|
34
|
+
span.inferred1 {
|
|
35
|
+
background-color: rgb(180, 205, 205);
|
|
36
|
+
display: block;
|
|
37
|
+
}
|
|
38
|
+
span.uncovered0 {
|
|
39
|
+
background-color: rgb(225, 110, 110);
|
|
40
|
+
display: block;
|
|
41
|
+
}
|
|
42
|
+
span.uncovered1 {
|
|
43
|
+
background-color: rgb(235, 120, 120);
|
|
44
|
+
display: block;
|
|
45
|
+
}
|
|
46
|
+
span.overview {
|
|
47
|
+
border-bottom: 8px solid black;
|
|
48
|
+
}
|
|
49
|
+
div.overview {
|
|
50
|
+
border-bottom: 8px solid black;
|
|
51
|
+
}
|
|
52
|
+
body {
|
|
53
|
+
font-family: verdana, arial, helvetica;
|
|
54
|
+
}
|
|
55
|
+
div.footer {
|
|
56
|
+
font-size: 68%;
|
|
57
|
+
margin-top: 1.5em;
|
|
58
|
+
}
|
|
59
|
+
h1, h2, h3, h4, h5, h6 {
|
|
60
|
+
margin-bottom: 0.5em;
|
|
61
|
+
}
|
|
62
|
+
h5 {
|
|
63
|
+
margin-top: 0.5em;
|
|
64
|
+
}
|
|
65
|
+
.hidden {
|
|
66
|
+
display: none;
|
|
67
|
+
}
|
|
68
|
+
div.separator {
|
|
69
|
+
height: 10px;
|
|
70
|
+
}
|
|
71
|
+
/* Commented out for better readability, esp. on IE */
|
|
72
|
+
/*
|
|
73
|
+
table tr td, table tr th {
|
|
74
|
+
font-size: 68%;
|
|
75
|
+
}
|
|
76
|
+
td.value table tr td {
|
|
77
|
+
font-size: 11px;
|
|
78
|
+
}
|
|
79
|
+
*/
|
|
80
|
+
table.percent_graph {
|
|
81
|
+
height: 12px;
|
|
82
|
+
border: #808080 1px solid;
|
|
83
|
+
empty-cells: show;
|
|
84
|
+
}
|
|
85
|
+
table.percent_graph td.covered {
|
|
86
|
+
height: 10px;
|
|
87
|
+
background: #00f000;
|
|
88
|
+
}
|
|
89
|
+
table.percent_graph td.uncovered {
|
|
90
|
+
height: 10px;
|
|
91
|
+
background: #e00000;
|
|
92
|
+
}
|
|
93
|
+
table.percent_graph td.NA {
|
|
94
|
+
height: 10px;
|
|
95
|
+
background: #eaeaea;
|
|
96
|
+
}
|
|
97
|
+
table.report {
|
|
98
|
+
border-collapse: collapse;
|
|
99
|
+
width: 100%;
|
|
100
|
+
}
|
|
101
|
+
table.report td.heading {
|
|
102
|
+
background: #dcecff;
|
|
103
|
+
border: #d0d0d0 1px solid;
|
|
104
|
+
font-weight: bold;
|
|
105
|
+
text-align: center;
|
|
106
|
+
}
|
|
107
|
+
table.report td.heading:hover {
|
|
108
|
+
background: #c0ffc0;
|
|
109
|
+
}
|
|
110
|
+
table.report td.text {
|
|
111
|
+
border: #d0d0d0 1px solid;
|
|
112
|
+
}
|
|
113
|
+
table.report td.value {
|
|
114
|
+
text-align: right;
|
|
115
|
+
border: #d0d0d0 1px solid;
|
|
116
|
+
}
|
|
117
|
+
table.report tr.light {
|
|
118
|
+
background-color: rgb(240, 240, 245);
|
|
119
|
+
}
|
|
120
|
+
table.report tr.dark {
|
|
121
|
+
background-color: rgb(230, 230, 235);
|
|
122
|
+
}
|
|
123
|
+
</style>
|
|
124
|
+
<script type='text/javascript'>
|
|
125
|
+
// <![CDATA[
|
|
126
|
+
function toggleCode( id ) {
|
|
127
|
+
if ( document.getElementById )
|
|
128
|
+
elem = document.getElementById( id );
|
|
129
|
+
else if ( document.all )
|
|
130
|
+
elem = eval( "document.all." + id );
|
|
131
|
+
else
|
|
132
|
+
return false;
|
|
133
|
+
|
|
134
|
+
elemStyle = elem.style;
|
|
135
|
+
|
|
136
|
+
if ( elemStyle.display != "block" ) {
|
|
137
|
+
elemStyle.display = "block"
|
|
138
|
+
} else {
|
|
139
|
+
elemStyle.display = "none"
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
return true;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
// Make cross-references hidden by default
|
|
146
|
+
document.writeln( "<style type=\"text/css\">span.cross-ref { display: none }</style>" )
|
|
147
|
+
// ]]>
|
|
148
|
+
</script>
|
|
149
|
+
</head>
|
|
150
|
+
<body>
|
|
151
|
+
<h3>C0 code coverage information</h3>
|
|
152
|
+
<p>Generated on Fri Oct 20 17:20:35 CEST 2006 with <a href='http://eigenclass.org/hiki.rb?rcov'>rcov 0.7.0</a>
|
|
153
|
+
</p>
|
|
154
|
+
<hr /> <table class='report'>
|
|
155
|
+
<thead>
|
|
156
|
+
<tr>
|
|
157
|
+
<td class='heading'>Name</td>
|
|
158
|
+
<td class='heading'>Total lines</td>
|
|
159
|
+
<td class='heading'>Lines of code</td>
|
|
160
|
+
<td class='heading'>Total coverage</td>
|
|
161
|
+
<td class='heading'>Code coverage</td>
|
|
162
|
+
</tr>
|
|
163
|
+
</thead>
|
|
164
|
+
<tbody>
|
|
165
|
+
<tr class='light'>
|
|
166
|
+
<td>TOTAL</td>
|
|
167
|
+
<td class='value'>
|
|
168
|
+
<tt>319</tt>
|
|
169
|
+
</td>
|
|
170
|
+
<td class='value'>
|
|
171
|
+
<tt>126</tt>
|
|
172
|
+
</td>
|
|
173
|
+
<td>
|
|
174
|
+
<table cellspacing='0' cellpadding='0' align='right'>
|
|
175
|
+
<tr>
|
|
176
|
+
<td>
|
|
177
|
+
<tt>95.6%</tt> </td>
|
|
178
|
+
<td>
|
|
179
|
+
<table cellspacing='0' class='percent_graph' cellpadding='0' width='100'>
|
|
180
|
+
<tr>
|
|
181
|
+
<td class='covered' width='96' />
|
|
182
|
+
<td class='uncovered' width='4' />
|
|
183
|
+
</tr>
|
|
184
|
+
</table>
|
|
185
|
+
</td>
|
|
186
|
+
</tr>
|
|
187
|
+
</table>
|
|
188
|
+
</td>
|
|
189
|
+
<td>
|
|
190
|
+
<table cellspacing='0' cellpadding='0' align='right'>
|
|
191
|
+
<tr>
|
|
192
|
+
<td>
|
|
193
|
+
<tt>91.3%</tt> </td>
|
|
194
|
+
<td>
|
|
195
|
+
<table cellspacing='0' class='percent_graph' cellpadding='0' width='100'>
|
|
196
|
+
<tr>
|
|
197
|
+
<td class='covered' width='91' />
|
|
198
|
+
<td class='uncovered' width='9' />
|
|
199
|
+
</tr>
|
|
200
|
+
</table>
|
|
201
|
+
</td>
|
|
202
|
+
</tr>
|
|
203
|
+
</table>
|
|
204
|
+
</td>
|
|
205
|
+
</tr>
|
|
206
|
+
<tr class='dark'>
|
|
207
|
+
<td>
|
|
208
|
+
<a href='lib-xspf_rb.html'>lib/xspf.rb</a>
|
|
209
|
+
</td>
|
|
210
|
+
<td class='value'>
|
|
211
|
+
<tt>319</tt>
|
|
212
|
+
</td>
|
|
213
|
+
<td class='value'>
|
|
214
|
+
<tt>126</tt>
|
|
215
|
+
</td>
|
|
216
|
+
<td>
|
|
217
|
+
<table cellspacing='0' cellpadding='0' align='right'>
|
|
218
|
+
<tr>
|
|
219
|
+
<td>
|
|
220
|
+
<tt>95.6%</tt> </td>
|
|
221
|
+
<td>
|
|
222
|
+
<table cellspacing='0' class='percent_graph' cellpadding='0' width='100'>
|
|
223
|
+
<tr>
|
|
224
|
+
<td class='covered' width='96' />
|
|
225
|
+
<td class='uncovered' width='4' />
|
|
226
|
+
</tr>
|
|
227
|
+
</table>
|
|
228
|
+
</td>
|
|
229
|
+
</tr>
|
|
230
|
+
</table>
|
|
231
|
+
</td>
|
|
232
|
+
<td>
|
|
233
|
+
<table cellspacing='0' cellpadding='0' align='right'>
|
|
234
|
+
<tr>
|
|
235
|
+
<td>
|
|
236
|
+
<tt>91.3%</tt> </td>
|
|
237
|
+
<td>
|
|
238
|
+
<table cellspacing='0' class='percent_graph' cellpadding='0' width='100'>
|
|
239
|
+
<tr>
|
|
240
|
+
<td class='covered' width='91' />
|
|
241
|
+
<td class='uncovered' width='9' />
|
|
242
|
+
</tr>
|
|
243
|
+
</table>
|
|
244
|
+
</td>
|
|
245
|
+
</tr>
|
|
246
|
+
</table>
|
|
247
|
+
</td>
|
|
248
|
+
</tr>
|
|
249
|
+
</tbody>
|
|
250
|
+
</table><hr /> <p>Generated using the <a href='http://eigenclass.org/hiki.rb?rcov'>rcov code coverage analysis tool for Ruby</a> version 0.7.0.</p><p>
|
|
251
|
+
<a href='http://validator.w3.org/check/referer'>
|
|
252
|
+
<img src='http://www.w3.org/Icons/valid-xhtml11' height='31' alt='Valid XHTML 1.1!' width='88' />
|
|
253
|
+
</a>
|
|
254
|
+
<a href='http://jigsaw.w3.org/css-validator/check/referer'>
|
|
255
|
+
<img src='http://jigsaw.w3.org/css-validator/images/vcss' alt='Valid CSS!' style='border:0;width:88px;height:31px' />
|
|
256
|
+
</a>
|
|
257
|
+
</p>
|
|
258
|
+
</body>
|
|
259
|
+
</html>
|
|
@@ -0,0 +1,948 @@
|
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
2
|
+
<html lang='en' xml:lang='en' xmlns='http://www.w3.org/1999/xhtml'>
|
|
3
|
+
<head>
|
|
4
|
+
<title>lib/xspf.rb - C0 code coverage information</title>
|
|
5
|
+
<style type='text/css'>body { background-color: rgb(240, 240, 245); }</style>
|
|
6
|
+
<style type='text/css'>span.cross-ref-title {
|
|
7
|
+
font-size: 140%;
|
|
8
|
+
}
|
|
9
|
+
span.cross-ref a {
|
|
10
|
+
text-decoration: none;
|
|
11
|
+
}
|
|
12
|
+
span.cross-ref {
|
|
13
|
+
background-color:#f3f7fa;
|
|
14
|
+
border: 1px dashed #333;
|
|
15
|
+
margin: 1em;
|
|
16
|
+
padding: 0.5em;
|
|
17
|
+
overflow: hidden;
|
|
18
|
+
}
|
|
19
|
+
a.crossref-toggle {
|
|
20
|
+
text-decoration: none;
|
|
21
|
+
}
|
|
22
|
+
span.marked0 {
|
|
23
|
+
background-color: rgb(185, 210, 200);
|
|
24
|
+
display: block;
|
|
25
|
+
}
|
|
26
|
+
span.marked1 {
|
|
27
|
+
background-color: rgb(190, 215, 205);
|
|
28
|
+
display: block;
|
|
29
|
+
}
|
|
30
|
+
span.inferred0 {
|
|
31
|
+
background-color: rgb(175, 200, 200);
|
|
32
|
+
display: block;
|
|
33
|
+
}
|
|
34
|
+
span.inferred1 {
|
|
35
|
+
background-color: rgb(180, 205, 205);
|
|
36
|
+
display: block;
|
|
37
|
+
}
|
|
38
|
+
span.uncovered0 {
|
|
39
|
+
background-color: rgb(225, 110, 110);
|
|
40
|
+
display: block;
|
|
41
|
+
}
|
|
42
|
+
span.uncovered1 {
|
|
43
|
+
background-color: rgb(235, 120, 120);
|
|
44
|
+
display: block;
|
|
45
|
+
}
|
|
46
|
+
span.overview {
|
|
47
|
+
border-bottom: 8px solid black;
|
|
48
|
+
}
|
|
49
|
+
div.overview {
|
|
50
|
+
border-bottom: 8px solid black;
|
|
51
|
+
}
|
|
52
|
+
body {
|
|
53
|
+
font-family: verdana, arial, helvetica;
|
|
54
|
+
}
|
|
55
|
+
div.footer {
|
|
56
|
+
font-size: 68%;
|
|
57
|
+
margin-top: 1.5em;
|
|
58
|
+
}
|
|
59
|
+
h1, h2, h3, h4, h5, h6 {
|
|
60
|
+
margin-bottom: 0.5em;
|
|
61
|
+
}
|
|
62
|
+
h5 {
|
|
63
|
+
margin-top: 0.5em;
|
|
64
|
+
}
|
|
65
|
+
.hidden {
|
|
66
|
+
display: none;
|
|
67
|
+
}
|
|
68
|
+
div.separator {
|
|
69
|
+
height: 10px;
|
|
70
|
+
}
|
|
71
|
+
/* Commented out for better readability, esp. on IE */
|
|
72
|
+
/*
|
|
73
|
+
table tr td, table tr th {
|
|
74
|
+
font-size: 68%;
|
|
75
|
+
}
|
|
76
|
+
td.value table tr td {
|
|
77
|
+
font-size: 11px;
|
|
78
|
+
}
|
|
79
|
+
*/
|
|
80
|
+
table.percent_graph {
|
|
81
|
+
height: 12px;
|
|
82
|
+
border: #808080 1px solid;
|
|
83
|
+
empty-cells: show;
|
|
84
|
+
}
|
|
85
|
+
table.percent_graph td.covered {
|
|
86
|
+
height: 10px;
|
|
87
|
+
background: #00f000;
|
|
88
|
+
}
|
|
89
|
+
table.percent_graph td.uncovered {
|
|
90
|
+
height: 10px;
|
|
91
|
+
background: #e00000;
|
|
92
|
+
}
|
|
93
|
+
table.percent_graph td.NA {
|
|
94
|
+
height: 10px;
|
|
95
|
+
background: #eaeaea;
|
|
96
|
+
}
|
|
97
|
+
table.report {
|
|
98
|
+
border-collapse: collapse;
|
|
99
|
+
width: 100%;
|
|
100
|
+
}
|
|
101
|
+
table.report td.heading {
|
|
102
|
+
background: #dcecff;
|
|
103
|
+
border: #d0d0d0 1px solid;
|
|
104
|
+
font-weight: bold;
|
|
105
|
+
text-align: center;
|
|
106
|
+
}
|
|
107
|
+
table.report td.heading:hover {
|
|
108
|
+
background: #c0ffc0;
|
|
109
|
+
}
|
|
110
|
+
table.report td.text {
|
|
111
|
+
border: #d0d0d0 1px solid;
|
|
112
|
+
}
|
|
113
|
+
table.report td.value {
|
|
114
|
+
text-align: right;
|
|
115
|
+
border: #d0d0d0 1px solid;
|
|
116
|
+
}
|
|
117
|
+
table.report tr.light {
|
|
118
|
+
background-color: rgb(240, 240, 245);
|
|
119
|
+
}
|
|
120
|
+
table.report tr.dark {
|
|
121
|
+
background-color: rgb(230, 230, 235);
|
|
122
|
+
}
|
|
123
|
+
</style>
|
|
124
|
+
<script type='text/javascript'>
|
|
125
|
+
// <![CDATA[
|
|
126
|
+
function toggleCode( id ) {
|
|
127
|
+
if ( document.getElementById )
|
|
128
|
+
elem = document.getElementById( id );
|
|
129
|
+
else if ( document.all )
|
|
130
|
+
elem = eval( "document.all." + id );
|
|
131
|
+
else
|
|
132
|
+
return false;
|
|
133
|
+
|
|
134
|
+
elemStyle = elem.style;
|
|
135
|
+
|
|
136
|
+
if ( elemStyle.display != "block" ) {
|
|
137
|
+
elemStyle.display = "block"
|
|
138
|
+
} else {
|
|
139
|
+
elemStyle.display = "none"
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
return true;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
// Make cross-references hidden by default
|
|
146
|
+
document.writeln( "<style type=\"text/css\">span.cross-ref { display: none }</style>" )
|
|
147
|
+
// ]]>
|
|
148
|
+
</script>
|
|
149
|
+
<style type='text/css'>span.run0 {
|
|
150
|
+
background-color: rgb(178, 204, 255);
|
|
151
|
+
display: block;
|
|
152
|
+
}
|
|
153
|
+
span.run1 {
|
|
154
|
+
background-color: rgb(178, 206, 255);
|
|
155
|
+
display: block;
|
|
156
|
+
}
|
|
157
|
+
span.run2 {
|
|
158
|
+
background-color: rgb(178, 209, 255);
|
|
159
|
+
display: block;
|
|
160
|
+
}
|
|
161
|
+
span.run3 {
|
|
162
|
+
background-color: rgb(178, 211, 255);
|
|
163
|
+
display: block;
|
|
164
|
+
}
|
|
165
|
+
span.run4 {
|
|
166
|
+
background-color: rgb(178, 214, 255);
|
|
167
|
+
display: block;
|
|
168
|
+
}
|
|
169
|
+
span.run5 {
|
|
170
|
+
background-color: rgb(178, 218, 255);
|
|
171
|
+
display: block;
|
|
172
|
+
}
|
|
173
|
+
span.run6 {
|
|
174
|
+
background-color: rgb(178, 220, 255);
|
|
175
|
+
display: block;
|
|
176
|
+
}
|
|
177
|
+
span.run7 {
|
|
178
|
+
background-color: rgb(178, 223, 255);
|
|
179
|
+
display: block;
|
|
180
|
+
}
|
|
181
|
+
span.run8 {
|
|
182
|
+
background-color: rgb(178, 225, 255);
|
|
183
|
+
display: block;
|
|
184
|
+
}
|
|
185
|
+
span.run9 {
|
|
186
|
+
background-color: rgb(178, 228, 255);
|
|
187
|
+
display: block;
|
|
188
|
+
}
|
|
189
|
+
span.run10 {
|
|
190
|
+
background-color: rgb(178, 232, 255);
|
|
191
|
+
display: block;
|
|
192
|
+
}
|
|
193
|
+
span.run11 {
|
|
194
|
+
background-color: rgb(178, 234, 255);
|
|
195
|
+
display: block;
|
|
196
|
+
}
|
|
197
|
+
span.run12 {
|
|
198
|
+
background-color: rgb(178, 237, 255);
|
|
199
|
+
display: block;
|
|
200
|
+
}
|
|
201
|
+
span.run13 {
|
|
202
|
+
background-color: rgb(178, 239, 255);
|
|
203
|
+
display: block;
|
|
204
|
+
}
|
|
205
|
+
span.run14 {
|
|
206
|
+
background-color: rgb(178, 242, 255);
|
|
207
|
+
display: block;
|
|
208
|
+
}
|
|
209
|
+
span.run15 {
|
|
210
|
+
background-color: rgb(178, 246, 255);
|
|
211
|
+
display: block;
|
|
212
|
+
}
|
|
213
|
+
span.run16 {
|
|
214
|
+
background-color: rgb(178, 248, 255);
|
|
215
|
+
display: block;
|
|
216
|
+
}
|
|
217
|
+
span.run17 {
|
|
218
|
+
background-color: rgb(178, 251, 255);
|
|
219
|
+
display: block;
|
|
220
|
+
}
|
|
221
|
+
span.run18 {
|
|
222
|
+
background-color: rgb(178, 253, 255);
|
|
223
|
+
display: block;
|
|
224
|
+
}
|
|
225
|
+
span.run19 {
|
|
226
|
+
background-color: rgb(178, 255, 253);
|
|
227
|
+
display: block;
|
|
228
|
+
}
|
|
229
|
+
span.run20 {
|
|
230
|
+
background-color: rgb(178, 255, 249);
|
|
231
|
+
display: block;
|
|
232
|
+
}
|
|
233
|
+
span.run21 {
|
|
234
|
+
background-color: rgb(178, 255, 247);
|
|
235
|
+
display: block;
|
|
236
|
+
}
|
|
237
|
+
span.run22 {
|
|
238
|
+
background-color: rgb(178, 255, 244);
|
|
239
|
+
display: block;
|
|
240
|
+
}
|
|
241
|
+
span.run23 {
|
|
242
|
+
background-color: rgb(178, 255, 242);
|
|
243
|
+
display: block;
|
|
244
|
+
}
|
|
245
|
+
span.run24 {
|
|
246
|
+
background-color: rgb(178, 255, 239);
|
|
247
|
+
display: block;
|
|
248
|
+
}
|
|
249
|
+
span.run25 {
|
|
250
|
+
background-color: rgb(178, 255, 235);
|
|
251
|
+
display: block;
|
|
252
|
+
}
|
|
253
|
+
span.run26 {
|
|
254
|
+
background-color: rgb(178, 255, 233);
|
|
255
|
+
display: block;
|
|
256
|
+
}
|
|
257
|
+
span.run27 {
|
|
258
|
+
background-color: rgb(178, 255, 230);
|
|
259
|
+
display: block;
|
|
260
|
+
}
|
|
261
|
+
span.run28 {
|
|
262
|
+
background-color: rgb(178, 255, 228);
|
|
263
|
+
display: block;
|
|
264
|
+
}
|
|
265
|
+
span.run29 {
|
|
266
|
+
background-color: rgb(178, 255, 225);
|
|
267
|
+
display: block;
|
|
268
|
+
}
|
|
269
|
+
span.run30 {
|
|
270
|
+
background-color: rgb(178, 255, 221);
|
|
271
|
+
display: block;
|
|
272
|
+
}
|
|
273
|
+
span.run31 {
|
|
274
|
+
background-color: rgb(178, 255, 219);
|
|
275
|
+
display: block;
|
|
276
|
+
}
|
|
277
|
+
span.run32 {
|
|
278
|
+
background-color: rgb(178, 255, 216);
|
|
279
|
+
display: block;
|
|
280
|
+
}
|
|
281
|
+
span.run33 {
|
|
282
|
+
background-color: rgb(178, 255, 214);
|
|
283
|
+
display: block;
|
|
284
|
+
}
|
|
285
|
+
span.run34 {
|
|
286
|
+
background-color: rgb(178, 255, 211);
|
|
287
|
+
display: block;
|
|
288
|
+
}
|
|
289
|
+
span.run35 {
|
|
290
|
+
background-color: rgb(178, 255, 207);
|
|
291
|
+
display: block;
|
|
292
|
+
}
|
|
293
|
+
span.run36 {
|
|
294
|
+
background-color: rgb(178, 255, 205);
|
|
295
|
+
display: block;
|
|
296
|
+
}
|
|
297
|
+
span.run37 {
|
|
298
|
+
background-color: rgb(178, 255, 202);
|
|
299
|
+
display: block;
|
|
300
|
+
}
|
|
301
|
+
span.run38 {
|
|
302
|
+
background-color: rgb(178, 255, 200);
|
|
303
|
+
display: block;
|
|
304
|
+
}
|
|
305
|
+
span.run39 {
|
|
306
|
+
background-color: rgb(178, 255, 197);
|
|
307
|
+
display: block;
|
|
308
|
+
}
|
|
309
|
+
span.run40 {
|
|
310
|
+
background-color: rgb(178, 255, 193);
|
|
311
|
+
display: block;
|
|
312
|
+
}
|
|
313
|
+
span.run41 {
|
|
314
|
+
background-color: rgb(178, 255, 191);
|
|
315
|
+
display: block;
|
|
316
|
+
}
|
|
317
|
+
span.run42 {
|
|
318
|
+
background-color: rgb(178, 255, 188);
|
|
319
|
+
display: block;
|
|
320
|
+
}
|
|
321
|
+
span.run43 {
|
|
322
|
+
background-color: rgb(178, 255, 186);
|
|
323
|
+
display: block;
|
|
324
|
+
}
|
|
325
|
+
span.run44 {
|
|
326
|
+
background-color: rgb(178, 255, 183);
|
|
327
|
+
display: block;
|
|
328
|
+
}
|
|
329
|
+
span.run45 {
|
|
330
|
+
background-color: rgb(178, 255, 179);
|
|
331
|
+
display: block;
|
|
332
|
+
}
|
|
333
|
+
span.run46 {
|
|
334
|
+
background-color: rgb(179, 255, 178);
|
|
335
|
+
display: block;
|
|
336
|
+
}
|
|
337
|
+
span.run47 {
|
|
338
|
+
background-color: rgb(182, 255, 178);
|
|
339
|
+
display: block;
|
|
340
|
+
}
|
|
341
|
+
span.run48 {
|
|
342
|
+
background-color: rgb(184, 255, 178);
|
|
343
|
+
display: block;
|
|
344
|
+
}
|
|
345
|
+
span.run49 {
|
|
346
|
+
background-color: rgb(187, 255, 178);
|
|
347
|
+
display: block;
|
|
348
|
+
}
|
|
349
|
+
span.run50 {
|
|
350
|
+
background-color: rgb(191, 255, 178);
|
|
351
|
+
display: block;
|
|
352
|
+
}
|
|
353
|
+
span.run51 {
|
|
354
|
+
background-color: rgb(193, 255, 178);
|
|
355
|
+
display: block;
|
|
356
|
+
}
|
|
357
|
+
span.run52 {
|
|
358
|
+
background-color: rgb(196, 255, 178);
|
|
359
|
+
display: block;
|
|
360
|
+
}
|
|
361
|
+
span.run53 {
|
|
362
|
+
background-color: rgb(198, 255, 178);
|
|
363
|
+
display: block;
|
|
364
|
+
}
|
|
365
|
+
span.run54 {
|
|
366
|
+
background-color: rgb(201, 255, 178);
|
|
367
|
+
display: block;
|
|
368
|
+
}
|
|
369
|
+
span.run55 {
|
|
370
|
+
background-color: rgb(205, 255, 178);
|
|
371
|
+
display: block;
|
|
372
|
+
}
|
|
373
|
+
span.run56 {
|
|
374
|
+
background-color: rgb(207, 255, 178);
|
|
375
|
+
display: block;
|
|
376
|
+
}
|
|
377
|
+
span.run57 {
|
|
378
|
+
background-color: rgb(210, 255, 178);
|
|
379
|
+
display: block;
|
|
380
|
+
}
|
|
381
|
+
span.run58 {
|
|
382
|
+
background-color: rgb(212, 255, 178);
|
|
383
|
+
display: block;
|
|
384
|
+
}
|
|
385
|
+
span.run59 {
|
|
386
|
+
background-color: rgb(215, 255, 178);
|
|
387
|
+
display: block;
|
|
388
|
+
}
|
|
389
|
+
span.run60 {
|
|
390
|
+
background-color: rgb(219, 255, 178);
|
|
391
|
+
display: block;
|
|
392
|
+
}
|
|
393
|
+
span.run61 {
|
|
394
|
+
background-color: rgb(221, 255, 178);
|
|
395
|
+
display: block;
|
|
396
|
+
}
|
|
397
|
+
span.run62 {
|
|
398
|
+
background-color: rgb(224, 255, 178);
|
|
399
|
+
display: block;
|
|
400
|
+
}
|
|
401
|
+
span.run63 {
|
|
402
|
+
background-color: rgb(226, 255, 178);
|
|
403
|
+
display: block;
|
|
404
|
+
}
|
|
405
|
+
span.run64 {
|
|
406
|
+
background-color: rgb(229, 255, 178);
|
|
407
|
+
display: block;
|
|
408
|
+
}
|
|
409
|
+
span.run65 {
|
|
410
|
+
background-color: rgb(233, 255, 178);
|
|
411
|
+
display: block;
|
|
412
|
+
}
|
|
413
|
+
span.run66 {
|
|
414
|
+
background-color: rgb(235, 255, 178);
|
|
415
|
+
display: block;
|
|
416
|
+
}
|
|
417
|
+
span.run67 {
|
|
418
|
+
background-color: rgb(238, 255, 178);
|
|
419
|
+
display: block;
|
|
420
|
+
}
|
|
421
|
+
span.run68 {
|
|
422
|
+
background-color: rgb(240, 255, 178);
|
|
423
|
+
display: block;
|
|
424
|
+
}
|
|
425
|
+
span.run69 {
|
|
426
|
+
background-color: rgb(243, 255, 178);
|
|
427
|
+
display: block;
|
|
428
|
+
}
|
|
429
|
+
span.run70 {
|
|
430
|
+
background-color: rgb(247, 255, 178);
|
|
431
|
+
display: block;
|
|
432
|
+
}
|
|
433
|
+
span.run71 {
|
|
434
|
+
background-color: rgb(249, 255, 178);
|
|
435
|
+
display: block;
|
|
436
|
+
}
|
|
437
|
+
span.run72 {
|
|
438
|
+
background-color: rgb(252, 255, 178);
|
|
439
|
+
display: block;
|
|
440
|
+
}
|
|
441
|
+
span.run73 {
|
|
442
|
+
background-color: rgb(255, 255, 178);
|
|
443
|
+
display: block;
|
|
444
|
+
}
|
|
445
|
+
span.run74 {
|
|
446
|
+
background-color: rgb(255, 252, 178);
|
|
447
|
+
display: block;
|
|
448
|
+
}
|
|
449
|
+
span.run75 {
|
|
450
|
+
background-color: rgb(255, 248, 178);
|
|
451
|
+
display: block;
|
|
452
|
+
}
|
|
453
|
+
span.run76 {
|
|
454
|
+
background-color: rgb(255, 246, 178);
|
|
455
|
+
display: block;
|
|
456
|
+
}
|
|
457
|
+
span.run77 {
|
|
458
|
+
background-color: rgb(255, 243, 178);
|
|
459
|
+
display: block;
|
|
460
|
+
}
|
|
461
|
+
span.run78 {
|
|
462
|
+
background-color: rgb(255, 240, 178);
|
|
463
|
+
display: block;
|
|
464
|
+
}
|
|
465
|
+
span.run79 {
|
|
466
|
+
background-color: rgb(255, 238, 178);
|
|
467
|
+
display: block;
|
|
468
|
+
}
|
|
469
|
+
span.run80 {
|
|
470
|
+
background-color: rgb(255, 234, 178);
|
|
471
|
+
display: block;
|
|
472
|
+
}
|
|
473
|
+
span.run81 {
|
|
474
|
+
background-color: rgb(255, 232, 178);
|
|
475
|
+
display: block;
|
|
476
|
+
}
|
|
477
|
+
span.run82 {
|
|
478
|
+
background-color: rgb(255, 229, 178);
|
|
479
|
+
display: block;
|
|
480
|
+
}
|
|
481
|
+
span.run83 {
|
|
482
|
+
background-color: rgb(255, 226, 178);
|
|
483
|
+
display: block;
|
|
484
|
+
}
|
|
485
|
+
span.run84 {
|
|
486
|
+
background-color: rgb(255, 224, 178);
|
|
487
|
+
display: block;
|
|
488
|
+
}
|
|
489
|
+
span.run85 {
|
|
490
|
+
background-color: rgb(255, 220, 178);
|
|
491
|
+
display: block;
|
|
492
|
+
}
|
|
493
|
+
span.run86 {
|
|
494
|
+
background-color: rgb(255, 218, 178);
|
|
495
|
+
display: block;
|
|
496
|
+
}
|
|
497
|
+
span.run87 {
|
|
498
|
+
background-color: rgb(255, 215, 178);
|
|
499
|
+
display: block;
|
|
500
|
+
}
|
|
501
|
+
span.run88 {
|
|
502
|
+
background-color: rgb(255, 212, 178);
|
|
503
|
+
display: block;
|
|
504
|
+
}
|
|
505
|
+
span.run89 {
|
|
506
|
+
background-color: rgb(255, 210, 178);
|
|
507
|
+
display: block;
|
|
508
|
+
}
|
|
509
|
+
span.run90 {
|
|
510
|
+
background-color: rgb(255, 206, 178);
|
|
511
|
+
display: block;
|
|
512
|
+
}
|
|
513
|
+
span.run91 {
|
|
514
|
+
background-color: rgb(255, 204, 178);
|
|
515
|
+
display: block;
|
|
516
|
+
}
|
|
517
|
+
span.run92 {
|
|
518
|
+
background-color: rgb(255, 201, 178);
|
|
519
|
+
display: block;
|
|
520
|
+
}
|
|
521
|
+
span.run93 {
|
|
522
|
+
background-color: rgb(255, 198, 178);
|
|
523
|
+
display: block;
|
|
524
|
+
}
|
|
525
|
+
span.run94 {
|
|
526
|
+
background-color: rgb(255, 196, 178);
|
|
527
|
+
display: block;
|
|
528
|
+
}
|
|
529
|
+
span.run95 {
|
|
530
|
+
background-color: rgb(255, 192, 178);
|
|
531
|
+
display: block;
|
|
532
|
+
}
|
|
533
|
+
span.run96 {
|
|
534
|
+
background-color: rgb(255, 189, 178);
|
|
535
|
+
display: block;
|
|
536
|
+
}
|
|
537
|
+
span.run97 {
|
|
538
|
+
background-color: rgb(255, 187, 178);
|
|
539
|
+
display: block;
|
|
540
|
+
}
|
|
541
|
+
span.run98 {
|
|
542
|
+
background-color: rgb(255, 184, 178);
|
|
543
|
+
display: block;
|
|
544
|
+
}
|
|
545
|
+
span.run99 {
|
|
546
|
+
background-color: rgb(255, 182, 178);
|
|
547
|
+
display: block;
|
|
548
|
+
}
|
|
549
|
+
span.run100 {
|
|
550
|
+
background-color: rgb(255, 178, 178);
|
|
551
|
+
display: block;
|
|
552
|
+
}
|
|
553
|
+
</style>
|
|
554
|
+
</head>
|
|
555
|
+
<body>
|
|
556
|
+
<h3>C0 code coverage information</h3>
|
|
557
|
+
<p>Generated on Fri Oct 20 17:20:35 CEST 2006 with <a href='http://eigenclass.org/hiki.rb?rcov'>rcov 0.7.0</a>
|
|
558
|
+
</p>
|
|
559
|
+
<hr /><pre><span class='marked0'>Code reported as executed by Ruby looks like this...
|
|
560
|
+
</span><span class='marked1'>and this: this line is also marked as covered.
|
|
561
|
+
</span><span class='inferred0'>Lines considered as run by rcov, but not reported by Ruby, look like this,
|
|
562
|
+
</span><span class='inferred1'>and this: these lines were inferred by rcov (using simple heuristics).
|
|
563
|
+
</span><span class='uncovered0'>Finally, here's a line marked as not executed.
|
|
564
|
+
</span></pre>
|
|
565
|
+
<table class='report'>
|
|
566
|
+
<thead>
|
|
567
|
+
<tr>
|
|
568
|
+
<td class='heading'>Name</td>
|
|
569
|
+
<td class='heading'>Total lines</td>
|
|
570
|
+
<td class='heading'>Lines of code</td>
|
|
571
|
+
<td class='heading'>Total coverage</td>
|
|
572
|
+
<td class='heading'>Code coverage</td>
|
|
573
|
+
</tr>
|
|
574
|
+
</thead>
|
|
575
|
+
<tbody>
|
|
576
|
+
<tr class='light'>
|
|
577
|
+
<td>
|
|
578
|
+
<a href='lib-xspf_rb.html'>lib/xspf.rb</a>
|
|
579
|
+
</td>
|
|
580
|
+
<td class='value'>
|
|
581
|
+
<tt>319</tt>
|
|
582
|
+
</td>
|
|
583
|
+
<td class='value'>
|
|
584
|
+
<tt>126</tt>
|
|
585
|
+
</td>
|
|
586
|
+
<td>
|
|
587
|
+
<table cellspacing='0' cellpadding='0' align='right'>
|
|
588
|
+
<tr>
|
|
589
|
+
<td>
|
|
590
|
+
<tt>95.6%</tt> </td>
|
|
591
|
+
<td>
|
|
592
|
+
<table cellspacing='0' class='percent_graph' cellpadding='0' width='100'>
|
|
593
|
+
<tr>
|
|
594
|
+
<td class='covered' width='96' />
|
|
595
|
+
<td class='uncovered' width='4' />
|
|
596
|
+
</tr>
|
|
597
|
+
</table>
|
|
598
|
+
</td>
|
|
599
|
+
</tr>
|
|
600
|
+
</table>
|
|
601
|
+
</td>
|
|
602
|
+
<td>
|
|
603
|
+
<table cellspacing='0' cellpadding='0' align='right'>
|
|
604
|
+
<tr>
|
|
605
|
+
<td>
|
|
606
|
+
<tt>91.3%</tt> </td>
|
|
607
|
+
<td>
|
|
608
|
+
<table cellspacing='0' class='percent_graph' cellpadding='0' width='100'>
|
|
609
|
+
<tr>
|
|
610
|
+
<td class='covered' width='91' />
|
|
611
|
+
<td class='uncovered' width='9' />
|
|
612
|
+
</tr>
|
|
613
|
+
</table>
|
|
614
|
+
</td>
|
|
615
|
+
</tr>
|
|
616
|
+
</table>
|
|
617
|
+
</td>
|
|
618
|
+
</tr>
|
|
619
|
+
</tbody>
|
|
620
|
+
</table><pre><span class="inferred1"><a name="line1" /> 1 #--
|
|
621
|
+
</span><span class="inferred0"><a name="line2" /> 2 # =============================================================================
|
|
622
|
+
</span><span class="inferred1"><a name="line3" /> 3 # Copyright (c) 2006 Pau Garcia i Quiles (pgquiles@elpauer.org)
|
|
623
|
+
</span><span class="inferred0"><a name="line4" /> 4 # All rights reserved.
|
|
624
|
+
</span><span class="inferred1"><a name="line5" /> 5 #
|
|
625
|
+
</span><span class="inferred0"><a name="line6" /> 6 # This library may be used only as allowed by either the Ruby license (or, by
|
|
626
|
+
</span><span class="inferred1"><a name="line7" /> 7 # association with the Ruby license, the GPL). See the "doc" subdirectory of
|
|
627
|
+
</span><span class="inferred0"><a name="line8" /> 8 # the XSPF distribution for the texts of these licenses.
|
|
628
|
+
</span><span class="inferred1"><a name="line9" /> 9 # -----------------------------------------------------------------------------
|
|
629
|
+
</span><span class="inferred0"><a name="line10" /> 10 # XSPF for Ruby website : http://www.elpauer.org/xspf
|
|
630
|
+
</span><span class="inferred1"><a name="line11" /> 11 # =============================================================================
|
|
631
|
+
</span><span class="inferred0"><a name="line12" /> 12 #++
|
|
632
|
+
</span><span class="inferred1"><a name="line13" /> 13
|
|
633
|
+
</span><span class="marked0"><a name="line14" /> 14 require 'rexml/document'
|
|
634
|
+
</span><span class="marked1"><a name="line15" /> 15 require 'xml/xslt'
|
|
635
|
+
</span><span class="inferred0"><a name="line16" /> 16
|
|
636
|
+
</span><span class="inferred1"><a name="line17" /> 17 # :main: XSPF
|
|
637
|
+
</span><span class="inferred0"><a name="line18" /> 18
|
|
638
|
+
</span><span class="marked1"><a name="line19" /> 19 module MetaGen #:nodoc:
|
|
639
|
+
</span><span class="inferred0"><a name="line20" /> 20
|
|
640
|
+
</span><span class="inferred1"><a name="line21" /> 21 # define the method
|
|
641
|
+
</span><span class="marked0"><a name="line22" /> 22 def self.add_method(klass, meth_name, body, meth_rdoc)
|
|
642
|
+
</span><span class="marked1"><a name="line23" /> 23 code = "# #{meth_rdoc}\n def #{meth_name.downcase}; begin; #{body}; rescue NoMethodError; return nil; end; end"
|
|
643
|
+
</span><span class="inferred0"><a name="line24" /> 24
|
|
644
|
+
</span><span class="marked1"><a name="line25" /> 25 klass.module_eval(code)
|
|
645
|
+
</span><span class="inferred0"><a name="line26" /> 26
|
|
646
|
+
</span><span class="inferred1"><a name="line27" /> 27 # hook to write klass + name attrib to a file
|
|
647
|
+
</span><span class="marked0"><a name="line28" /> 28 if $META_RDOC
|
|
648
|
+
</span><span class="uncovered1"><a name="line29" /> 29 open($META_RDOC, 'a+') do |f|
|
|
649
|
+
</span><span class="uncovered0"><a name="line30" /> 30 f.puts("class #{klass}\n #{code}\n end")
|
|
650
|
+
</span><span class="uncovered1"><a name="line31" /> 31 end
|
|
651
|
+
</span><span class="uncovered0"><a name="line32" /> 32 end
|
|
652
|
+
</span><span class="uncovered1"><a name="line33" /> 33
|
|
653
|
+
</span><span class="uncovered0"><a name="line34" /> 34 end
|
|
654
|
+
</span><span class="inferred1"><a name="line35" /> 35
|
|
655
|
+
</span><span class="inferred0"><a name="line36" /> 36 # output in different formats
|
|
656
|
+
</span><span class="marked1"><a name="line37" /> 37 def self.add_output_format(klass, format, xspf, meth_rdoc)
|
|
657
|
+
</span><span class="marked0"><a name="line38" /> 38 xslt_path = "'#{File.join( File.dirname(__FILE__), %Q{xspf2#{format}.xsl} )}'"
|
|
658
|
+
</span><span class="marked1"><a name="line39" /> 39 code = "# #{meth_rdoc}\n def to_#{format}; xslt = XML::XSLT.new; xslt.xml = xspf; xslt.xsl = REXML::Document.new( File.new( #{xslt_path} ) ); xslt.serve; end"
|
|
659
|
+
</span><span class="inferred0"><a name="line40" /> 40
|
|
660
|
+
</span><span class="marked1"><a name="line41" /> 41 klass.module_eval(code)
|
|
661
|
+
</span><span class="inferred0"><a name="line42" /> 42
|
|
662
|
+
</span><span class="marked1"><a name="line43" /> 43 if $META_RDOC
|
|
663
|
+
</span><span class="uncovered0"><a name="line44" /> 44 open($META_RDOC, 'a+') do |f|
|
|
664
|
+
</span><span class="uncovered1"><a name="line45" /> 45 f.puts("class #{klass}\n #{code}\n end")
|
|
665
|
+
</span><span class="uncovered0"><a name="line46" /> 46 end
|
|
666
|
+
</span><span class="uncovered1"><a name="line47" /> 47 end
|
|
667
|
+
</span><span class="uncovered0"><a name="line48" /> 48
|
|
668
|
+
</span><span class="uncovered1"><a name="line49" /> 49 end
|
|
669
|
+
</span><span class="uncovered0"><a name="line50" /> 50
|
|
670
|
+
</span><span class="uncovered1"><a name="line51" /> 51 end
|
|
671
|
+
</span><span class="inferred0"><a name="line52" /> 52
|
|
672
|
+
</span><span class="inferred1"><a name="line53" /> 53 # XML Shareable Playlist Format (XSPF[http://www.xspf.org]) parser for Ruby
|
|
673
|
+
</span><span class="inferred0"><a name="line54" /> 54 #
|
|
674
|
+
</span><span class="inferred1"><a name="line55" /> 55 # When parsing, if a XSPF attribute or element is not set, the corresponding method will return _nil_.
|
|
675
|
+
</span><span class="inferred0"><a name="line56" /> 56 #
|
|
676
|
+
</span><span class="inferred1"><a name="line57" /> 57 # === Examples
|
|
677
|
+
</span><span class="inferred0"><a name="line58" /> 58 # ==== Parse from file
|
|
678
|
+
</span><span class="inferred1"><a name="line59" /> 59 # require 'xspf'
|
|
679
|
+
</span><span class="inferred0"><a name="line60" /> 60 #
|
|
680
|
+
</span><span class="inferred1"><a name="line61" /> 61 # f = File.new("playlist.xspf")
|
|
681
|
+
</span><span class="inferred0"><a name="line62" /> 62 # x = XSPF.new(f)
|
|
682
|
+
</span><span class="inferred1"><a name="line63" /> 63 # pl = XSPF::Playlist.new(x)
|
|
683
|
+
</span><span class="inferred0"><a name="line64" /> 64 # tl = XSPF::Tracklist.new(pl)
|
|
684
|
+
</span><span class="inferred1"><a name="line65" /> 65 #
|
|
685
|
+
</span><span class="inferred0"><a name="line66" /> 66 # puts "XML version: #{x.version}"
|
|
686
|
+
</span><span class="inferred1"><a name="line67" /> 67 # puts "XML encoding: #{ x.encoding}"
|
|
687
|
+
</span><span class="inferred0"><a name="line68" /> 68 # puts "XSPF version: #{pl.version}"
|
|
688
|
+
</span><span class="inferred1"><a name="line69" /> 69 # puts "Namespace: #{pl.xmlns}"
|
|
689
|
+
</span><span class="inferred0"><a name="line70" /> 70 # puts "Playlist title: #{pl.title}"
|
|
690
|
+
</span><span class="inferred1"><a name="line71" /> 71 # puts "Playlist creator: #{pl.creator}"
|
|
691
|
+
</span><span class="inferred0"><a name="line72" /> 72 # puts "Playlist annotation: #{pl.annotation}"
|
|
692
|
+
</span><span class="inferred1"><a name="line73" /> 73 # puts "Playlist info: #{pl.info}"
|
|
693
|
+
</span><span class="inferred0"><a name="line74" /> 74 # puts "Playlist identifier: #{pl.identifier}"
|
|
694
|
+
</span><span class="inferred1"><a name="line75" /> 75 # puts "Playlist attribution: #{pl.attribution}"
|
|
695
|
+
</span><span class="inferred0"><a name="line76" /> 76 # puts "Tracklist: #{pl.tracklist}"
|
|
696
|
+
</span><span class="inferred1"><a name="line77" /> 77 # tl.tracks.each do |t|
|
|
697
|
+
</span><span class="inferred0"><a name="line78" /> 78 # puts "Track identifier: #{t.identifier}"
|
|
698
|
+
</span><span class="inferred1"><a name="line79" /> 79 # puts "Track title: #{t.title}"
|
|
699
|
+
</span><span class="inferred0"><a name="line80" /> 80 # puts "Track creator: #{t.creator}"
|
|
700
|
+
</span><span class="inferred1"><a name="line81" /> 81 # puts "Track duration: #{t.duration}"
|
|
701
|
+
</span><span class="inferred0"><a name="line82" /> 82 # puts "Track metainformation: link=#{t.meta_rel} content=#{t.meta_content}"
|
|
702
|
+
</span><span class="inferred1"><a name="line83" /> 83 # end
|
|
703
|
+
</span><span class="inferred0"><a name="line84" /> 84 #
|
|
704
|
+
</span><span class="inferred1"><a name="line85" /> 85 # # Convert the XSPF document to SMIL
|
|
705
|
+
</span><span class="inferred0"><a name="line86" /> 86 # x.to_smil
|
|
706
|
+
</span><span class="inferred1"><a name="line87" /> 87 #
|
|
707
|
+
</span><span class="inferred0"><a name="line88" /> 88 # # Convert the XSPF document to HTML
|
|
708
|
+
</span><span class="inferred1"><a name="line89" /> 89 # x.to_html
|
|
709
|
+
</span><span class="inferred0"><a name="line90" /> 90 #
|
|
710
|
+
</span><span class="inferred1"><a name="line91" /> 91 # # Convert the XSPF document in a M3U playlist
|
|
711
|
+
</span><span class="inferred0"><a name="line92" /> 92 # x.to_m3u
|
|
712
|
+
</span><span class="inferred1"><a name="line93" /> 93 #
|
|
713
|
+
</span><span class="inferred0"><a name="line94" /> 94 # ==== Parse from string
|
|
714
|
+
</span><span class="inferred1"><a name="line95" /> 95 # playlist_document = <<-END_OF_PLAYLIST
|
|
715
|
+
</span><span class="inferred0"><a name="line96" /> 96 # <?xml version="1.0" encoding="UTF-8"?>
|
|
716
|
+
</span><span class="inferred1"><a name="line97" /> 97 # <playlist version="0" xmlns="http://xspf.org/ns/0/">
|
|
717
|
+
</span><span class="inferred0"><a name="line98" /> 98 # <title>XSPlF it up!</title>
|
|
718
|
+
</span><span class="inferred1"><a name="line99" /> 99 # <creator>Mayhem &amp; Chaos Coordinator</creator>
|
|
719
|
+
</span><span class="inferred0"><a name="line100" />100 # <annotation>Just a few songs to enjoy while you XSPlF it up!</annotation>
|
|
720
|
+
</span><span class="inferred1"><a name="line101" />101 # <info>http://mayhem-chaos.net/xspf/xspf_it_up.html</info>
|
|
721
|
+
</span><span class="inferred0"><a name="line102" />102 # <identifier>http://mayhem-chaos.net/xspf/xspf_it_up/1.0</identifier>
|
|
722
|
+
</span><span class="inferred1"><a name="line103" />103 # <attribution>
|
|
723
|
+
</span><span class="inferred0"><a name="line104" />104 # <location>ihttp://mayhem-chaos.net/xspf/xspf_it_up.html</location>
|
|
724
|
+
</span><span class="inferred1"><a name="line105" />105 # </attribution>
|
|
725
|
+
</span><span class="inferred0"><a name="line106" />106 # <trackList>
|
|
726
|
+
</span><span class="inferred1"><a name="line107" />107 # <track>
|
|
727
|
+
</span><span class="inferred0"><a name="line108" />108 # <identifier>http://musicbrainz.org/track/bdab6db0-2fd6-4166-a5fa-fbf2ff213793</identifier>
|
|
728
|
+
</span><span class="inferred1"><a name="line109" />109 # <title>I Wanna Get High</title>
|
|
729
|
+
</span><span class="inferred0"><a name="line110" />110 # <creator>Cypress Hill</creator>
|
|
730
|
+
</span><span class="inferred1"><a name="line111" />111 # <duration>174613</duration>
|
|
731
|
+
</span><span class="inferred0"><a name="line112" />112 # <meta rel="http://musicbrainz.org/track">http://musicbrainz.org/mm-2.1/track/bdab6db0-2fd6-4166-a5fa-fbf2ff213793</meta>
|
|
732
|
+
</span><span class="inferred1"><a name="line113" />113 # </track>
|
|
733
|
+
</span><span class="inferred0"><a name="line114" />114 # <track>
|
|
734
|
+
</span><span class="inferred1"><a name="line115" />115 # <identifier>bdc846e7-6c26-4193-82a6-8d1b5a4d3429</identifier>
|
|
735
|
+
</span><span class="inferred0"><a name="line116" />116 # <title>Smoke Two Joints</title>
|
|
736
|
+
</span><span class="inferred1"><a name="line117" />117 # <creator>Sublime</creator>
|
|
737
|
+
</span><span class="inferred0"><a name="line118" />118 # <duration>175466</duration>
|
|
738
|
+
</span><span class="inferred1"><a name="line119" />119 # <meta rel="http://musicbrainz.org/track">http://musicbrainz.org/mm-2.1/track/bdc846e7-6c26-4193-82a6-8d1b5a4d3429</meta>
|
|
739
|
+
</span><span class="inferred0"><a name="line120" />120 # </track>
|
|
740
|
+
</span><span class="inferred1"><a name="line121" />121 # <track>
|
|
741
|
+
</span><span class="inferred0"><a name="line122" />122 # <identifier>http://musicbrainz.org/track/7d9776f7-d428-40dc-a425-3c6e3dce4d58</identifier>
|
|
742
|
+
</span><span class="inferred1"><a name="line123" />123 # <title>Hash Pipe</title>
|
|
743
|
+
</span><span class="inferred0"><a name="line124" />124 # <creator>Weezer</creator>
|
|
744
|
+
</span><span class="inferred1"><a name="line125" />125 # <duration>186533</duration>
|
|
745
|
+
</span><span class="inferred0"><a name="line126" />126 # <meta rel="http://musicbrainz.org/track">http://musicbrainz.org/mm-2.1/track/7d9776f7-d428-40dc-a425-3c6e3dce4d58</meta>
|
|
746
|
+
</span><span class="inferred1"><a name="line127" />127 # </track>
|
|
747
|
+
</span><span class="inferred0"><a name="line128" />128 # </trackList>
|
|
748
|
+
</span><span class="inferred1"><a name="line129" />129 # </playlist>
|
|
749
|
+
</span><span class="inferred0"><a name="line130" />130 # END_OF_PLAYLIST
|
|
750
|
+
</span><span class="inferred1"><a name="line131" />131 #
|
|
751
|
+
</span><span class="inferred0"><a name="line132" />132 # x = XSPF.new(playlist_document)
|
|
752
|
+
</span><span class="inferred1"><a name="line133" />133 # pl = XSPF::Playlist.new(x)
|
|
753
|
+
</span><span class="inferred0"><a name="line134" />134 # tl = XSPF::Tracklist.new(pl)
|
|
754
|
+
</span><span class="inferred1"><a name="line135" />135 #
|
|
755
|
+
</span><span class="inferred0"><a name="line136" />136 # puts "XML version: #{x.version}"
|
|
756
|
+
</span><span class="inferred1"><a name="line137" />137 # puts "XML encoding: #{ x.encoding}"
|
|
757
|
+
</span><span class="inferred0"><a name="line138" />138 # puts "XSPF version: #{pl.version}"
|
|
758
|
+
</span><span class="inferred1"><a name="line139" />139 # puts "Namespace: #{pl.xmlns}"
|
|
759
|
+
</span><span class="inferred0"><a name="line140" />140 # puts "Playlist title: #{pl.title}"
|
|
760
|
+
</span><span class="inferred1"><a name="line141" />141 # puts "Playlist creator: #{pl.creator}"
|
|
761
|
+
</span><span class="inferred0"><a name="line142" />142 # puts "Playlist annotation: #{pl.annotation}"
|
|
762
|
+
</span><span class="inferred1"><a name="line143" />143 # puts "Playlist info: #{pl.info}"
|
|
763
|
+
</span><span class="inferred0"><a name="line144" />144 # puts "Playlist identifier: #{pl.identifier}"
|
|
764
|
+
</span><span class="inferred1"><a name="line145" />145 # puts "Playlist attribution: #{pl.attribution}"
|
|
765
|
+
</span><span class="inferred0"><a name="line146" />146 # puts "Tracklist: #{pl.tracklist}"
|
|
766
|
+
</span><span class="inferred1"><a name="line147" />147 # tl.tracks.each do |t|
|
|
767
|
+
</span><span class="inferred0"><a name="line148" />148 # puts "Track identifier: #{t.identifier}"
|
|
768
|
+
</span><span class="inferred1"><a name="line149" />149 # puts "Track title: #{t.title}"
|
|
769
|
+
</span><span class="inferred0"><a name="line150" />150 # puts "Track creator: #{t.creator}"
|
|
770
|
+
</span><span class="inferred1"><a name="line151" />151 # puts "Track duration: #{t.duration}"
|
|
771
|
+
</span><span class="inferred0"><a name="line152" />152 # puts "Track metainformation: link=#{t.meta_rel} content=#{t.meta_content}"
|
|
772
|
+
</span><span class="inferred1"><a name="line153" />153 # end
|
|
773
|
+
</span><span class="inferred0"><a name="line154" />154 #
|
|
774
|
+
</span><span class="inferred1"><a name="line155" />155 # # Convert the XSPF document to SMIL
|
|
775
|
+
</span><span class="inferred0"><a name="line156" />156 # x.to_smil
|
|
776
|
+
</span><span class="inferred1"><a name="line157" />157 #
|
|
777
|
+
</span><span class="inferred0"><a name="line158" />158 # # Convert the XSPF document to HTML
|
|
778
|
+
</span><span class="inferred1"><a name="line159" />159 # x.to_html
|
|
779
|
+
</span><span class="inferred0"><a name="line160" />160 #
|
|
780
|
+
</span><span class="inferred1"><a name="line161" />161 # # Convert the XSPF document in a M3U playlist
|
|
781
|
+
</span><span class="inferred0"><a name="line162" />162 # x.to_m3u
|
|
782
|
+
</span><span class="inferred1"><a name="line163" />163 #
|
|
783
|
+
</span><span class="inferred0"><a name="line164" />164
|
|
784
|
+
</span><span class="marked1"><a name="line165" />165 class XSPF
|
|
785
|
+
</span><span class="inferred0"><a name="line166" />166
|
|
786
|
+
</span><span class="marked1"><a name="line167" />167 attr_reader :xspf
|
|
787
|
+
</span><span class="inferred0"><a name="line168" />168
|
|
788
|
+
</span><span class="inferred1"><a name="line169" />169 #:stopdoc:
|
|
789
|
+
</span><span class="marked0"><a name="line170" />170 ATTRIBUTES = %w{ version encoding }
|
|
790
|
+
</span><span class="marked1"><a name="line171" />171 VERSION_RDOC = "Version for the XML document or _nil_ if not defined"
|
|
791
|
+
</span><span class="marked0"><a name="line172" />172 ENCODING_RDOC = "Encoding of the XML document or _nil_ if not defined"
|
|
792
|
+
</span><span class="inferred1"><a name="line173" />173
|
|
793
|
+
</span><span class="marked0"><a name="line174" />174 OUTPUT_FORMATS = %w{ m3u html smil soundblox }
|
|
794
|
+
</span><span class="marked1"><a name="line175" />175 M3U_RDOC = "Creates a .m3u playlist from the XSPF document. This method makes use of the official XSPF to M3U XSLT transformation by Lucas Gonze."
|
|
795
|
+
</span><span class="marked0"><a name="line176" />176 HTML_RDOC = "Outputs the playlist as an HTML page. This method makes use of the official XSPF to HTML XSLT transformation by Lucas Gonze."
|
|
796
|
+
</span><span class="marked1"><a name="line177" />177 SMIL_RDOC = "Creates a .smil playlist from the XSPF document. This method makes use of the official XSPF to SMIL XSLT transformation by Lucas Gonze."
|
|
797
|
+
</span><span class="marked0"><a name="line178" />178 SOUNDBLOX_RDOC = "Creates a SoundBlox playlist from the XSPF document. This method makes use of the official XSPF to SoundBlox XSLT tranformation by Lucas Gonze."
|
|
798
|
+
</span><span class="inferred1"><a name="line179" />179
|
|
799
|
+
</span><span class="marked0"><a name="line180" />180 ATTRIBUTES.each do |attrib|
|
|
800
|
+
</span><span class="marked1"><a name="line181" />181 MetaGen.add_method(self, attrib, "@xspf.#{attrib}", eval(attrib.upcase + '_RDOC').to_s )
|
|
801
|
+
</span><span class="inferred0"><a name="line182" />182 end
|
|
802
|
+
</span><span class="inferred1"><a name="line183" />183
|
|
803
|
+
</span><span class="marked0"><a name="line184" />184 OUTPUT_FORMATS.each do |format|
|
|
804
|
+
</span><span class="marked1"><a name="line185" />185 MetaGen.add_output_format(self, format, @xspf, eval(format.upcase + '_RDOC').to_s )
|
|
805
|
+
</span><span class="inferred0"><a name="line186" />186 end
|
|
806
|
+
</span><span class="inferred1"><a name="line187" />187
|
|
807
|
+
</span><span class="inferred0"><a name="line188" />188 #:startdoc:
|
|
808
|
+
</span><span class="inferred1"><a name="line189" />189
|
|
809
|
+
</span><span class="inferred0"><a name="line190" />190 # Creates a XSPF object from a file or string
|
|
810
|
+
</span><span class="marked1"><a name="line191" />191 def initialize(source = nil)
|
|
811
|
+
</span><span class="marked0"><a name="line192" />192 @xspf = REXML::Document.new(source)
|
|
812
|
+
</span><span class="marked1"><a name="line193" />193 end
|
|
813
|
+
</span><span class="inferred0"><a name="line194" />194
|
|
814
|
+
</span><span class="inferred1"><a name="line195" />195 # The <playlist> section of the XSPF document
|
|
815
|
+
</span><span class="marked0"><a name="line196" />196 def playlist
|
|
816
|
+
</span><span class="marked1"><a name="line197" />197 @xspf.root
|
|
817
|
+
</span><span class="marked0"><a name="line198" />198 end
|
|
818
|
+
</span><span class="inferred1"><a name="line199" />199
|
|
819
|
+
</span><span class="inferred0"><a name="line200" />200 end
|
|
820
|
+
</span><span class="inferred1"><a name="line201" />201
|
|
821
|
+
</span><span class="marked0"><a name="line202" />202 class XSPF::Playlist < XSPF
|
|
822
|
+
</span><span class="inferred1"><a name="line203" />203
|
|
823
|
+
</span><span class="marked0"><a name="line204" />204 attr_reader :playlist
|
|
824
|
+
</span><span class="inferred1"><a name="line205" />205
|
|
825
|
+
</span><span class="inferred0"><a name="line206" />206 #:stopdoc:
|
|
826
|
+
</span><span class="marked1"><a name="line207" />207 ATTRIBUTES = %w{ xmlns version }
|
|
827
|
+
</span><span class="marked0"><a name="line208" />208 ELEMENTS = %w{ title creator annotation info location identifier image date license attribution extension }
|
|
828
|
+
</span><span class="marked1"><a name="line209" />209 ATTRIBUTE_AND_ELEMENT = %w{ link meta }
|
|
829
|
+
</span><span class="marked0"><a name="line210" />210 attribution_subelements = %w{ location identifier }
|
|
830
|
+
</span><span class="marked1"><a name="line211" />211 extension_subelements = %w{ application content }
|
|
831
|
+
</span><span class="marked0"><a name="line212" />212 XMLNS_RDOC = "The XML namespace. It must be http://xspf.org/ns/0/ for a valid XSPF document."
|
|
832
|
+
</span><span class="marked1"><a name="line213" />213 VERSION_RDOC = "The XSPF version. It may be 0 or 1, although 1 is strongly advised."
|
|
833
|
+
</span><span class="marked0"><a name="line214" />214 TITLE_RDOC = "A human-readable title for the playlist. xspf:playlist elements MAY contain exactly one."
|
|
834
|
+
</span><span class="marked1"><a name="line215" />215 CREATOR_RDOC = "Human-readable name of the entity (author, authors, group, company, etc) that authored the playlist. XSPF::Playlist objects MAY contain exactly one."
|
|
835
|
+
</span><span class="marked0"><a name="line216" />216 ANNOTATION_RDOC = "A human-readable comment on the playlist. This is character data, not HTML, and it may not contain markup. XSPF::Playlist objects elements MAY contain exactly one."
|
|
836
|
+
</span><span class="marked1"><a name="line217" />217 INFO_RDOC = "URL of a web page to find out more about this playlist. Likely to be homepage of the author, and would be used to find out more about the author and to find more playlists by the author. XSPF::Playlist objects MAY contain exactly one."
|
|
837
|
+
</span><span class="marked0"><a name="line218" />218 LOCATION_RDOC = "Source URL for this playlist. XSPF::Playlist objects MAY contain exactly one."
|
|
838
|
+
</span><span class="marked1"><a name="line219" />219 IDENTIFIER_RDOC = "Canonical ID for this playlist. Likely to be a hash or other location-independent name. MUST be a legal URN. XSPF::Playlist objects MAY contain exactly one."
|
|
839
|
+
</span><span class="marked0"><a name="line220" />220 IMAGE_RDOC = "URL of an image to display if XSPF::Playlist#image return nil. XSPF::Playlist objects MAY contain exactly one."
|
|
840
|
+
</span><span class="marked1"><a name="line221" />221 DATE_RDOC = "Creation date (not last-modified date) of the playlist, formatted as a XML schema dateTime. XSPF::Playlist objects MAY contain exactly one."
|
|
841
|
+
</span><span class="marked0"><a name="line222" />222 LICENSE_RDOC = "URL of a resource that describes the license under which this playlist was released. XSPF::Playlist objects MAY contain zero or one license element."
|
|
842
|
+
</span><span class="marked1"><a name="line223" />223 ATTRIBUTION_RDOC = "An ordered list of URIs. The purpose is to satisfy licenses allowing modification but requiring attribution. If you modify such a playlist, move its XSPF::Playlist#location or XSPF::Playlist#identifier element to the top of the items in the XSPF::Playlist#attribution element. XSPF::Playlist objects MAY contain exactly one attribution element. Please note that currently XSPF for Ruby does not parse the contents of XSPF::Playlist#attribution."
|
|
843
|
+
</span><span class="marked0"><a name="line224" />224 EXTENSION_RDOC = "The extension element allows non-XSPF XML to be included in XSPF documents without breaking XSPF validation. The purpose is to allow nested XML, which the meta and link elements do not. XSPF::Playlist objects MAY contain zero or more extension elements but currently XSPF for Ruby returns only the first one."
|
|
844
|
+
</span><span class="marked1"><a name="line225" />225 LINK_REL_RDOC = "The link element allows non-XSPF web resources to be included in XSPF documents without breaking XSPF validation. A valid 'link' element has a 'rel' attribute and a 'content' element, obtained with XSPF::Playlist#link_rel and XSPF::Playlist#link_content respectively. XSPF::Playlist objects MAY contain zero or more link elements, but currently XSPF for Ruby returns only the first one."
|
|
845
|
+
</span><span class="marked0"><a name="line226" />226 LINK_CONTENT_RDOC = "The link element allows non-XSPF web resources to be included in XSPF documents without breaking XSPF validation. A valid 'link' element has a 'rel' attribute and a 'content' element, obtained with XSPF::Playlist#link_rel and XSPF::Playlist#link_content respectively. XSPF::Playlist objects MAY contain zero or more meta elements, but currently XSPF for Ruby returns only the first one."
|
|
846
|
+
</span><span class="marked1"><a name="line227" />227 META_REL_RDOC = "The meta element allows non-XSPF metadata to be included in XSPF documents without breaking XSPF validation. A valid 'meta' element has a 'rel' attribute and a 'content' element, obtained with XSPF::Playlist#meta_rel and XSPF::Playlist#meta_content respectively. XSPF::Playlist objects MAY contain zero or more meta elements, but currently XSPF for Ruby returns only the first one."
|
|
847
|
+
</span><span class="marked0"><a name="line228" />228 META_CONTENT_RDOC = "The meta element allows non-XSPF metadata to be included in XSPF documents without breaking XSPF validation. A valid 'meta' element has a 'rel' attribute and a 'content' element, obtained with XSPF::Playlist#meta_rel and XSPF::Playlist#meta_content respectively. XSPF::Playlist objects MAY contain zero or more meta elements, but currently XSPF for Ruby returns only the first one."
|
|
848
|
+
</span><span class="inferred1"><a name="line229" />229
|
|
849
|
+
</span><span class="inferred0"><a name="line230" />230 # FIXME Currently we only return the first "link"
|
|
850
|
+
</span><span class="inferred1"><a name="line231" />231 # FIXME Currently we only return the first "meta"
|
|
851
|
+
</span><span class="inferred0"><a name="line232" />232 # FIXME Currently we only return the first "extension"
|
|
852
|
+
</span><span class="inferred1"><a name="line233" />233 # TODO Parse "attribution"
|
|
853
|
+
</span><span class="inferred0"><a name="line234" />234 # TODO Parse "extension"
|
|
854
|
+
</span><span class="inferred1"><a name="line235" />235
|
|
855
|
+
</span><span class="inferred0"><a name="line236" />236 # Returns the value of the attribute or nil if the attribute is not present
|
|
856
|
+
</span><span class="marked1"><a name="line237" />237 ATTRIBUTES.each do |attrib|
|
|
857
|
+
</span><span class="marked0"><a name="line238" />238 MetaGen.add_method( self, attrib, "@playlist.root.attributes['#{attrib}']", eval(attrib.upcase + '_RDOC').to_s )
|
|
858
|
+
</span><span class="inferred1"><a name="line239" />239 end
|
|
859
|
+
</span><span class="inferred0"><a name="line240" />240
|
|
860
|
+
</span><span class="marked1"><a name="line241" />241 ELEMENTS.each do |element|
|
|
861
|
+
</span><span class="marked0"><a name="line242" />242 MetaGen.add_method( self, element, "@playlist.elements['#{element}'].text", eval(element.upcase + '_RDOC').to_s )
|
|
862
|
+
</span><span class="inferred1"><a name="line243" />243 end
|
|
863
|
+
</span><span class="inferred0"><a name="line244" />244
|
|
864
|
+
</span><span class="marked1"><a name="line245" />245 ATTRIBUTE_AND_ELEMENT.each do |ae|
|
|
865
|
+
</span><span class="marked0"><a name="line246" />246 MetaGen.add_method( self, "#{ae}_content", "@playlist.elements['#{ae}'].text", eval(ae.upcase + '_CONTENT_RDOC').to_s )
|
|
866
|
+
</span><span class="marked1"><a name="line247" />247 MetaGen.add_method( self, "#{ae}_rel", "@playlist.elements['#{ae}'].attributes['rel']", eval(ae.upcase + '_REL_RDOC').to_s )
|
|
867
|
+
</span><span class="inferred0"><a name="line248" />248 end
|
|
868
|
+
</span><span class="inferred1"><a name="line249" />249
|
|
869
|
+
</span><span class="inferred0"><a name="line250" />250 #:startdoc:
|
|
870
|
+
</span><span class="inferred1"><a name="line251" />251
|
|
871
|
+
</span><span class="inferred0"><a name="line252" />252 # Creates a XSPF::Playlist from a XSPF document
|
|
872
|
+
</span><span class="marked1"><a name="line253" />253 def initialize(source)
|
|
873
|
+
</span><span class="marked0"><a name="line254" />254 @playlist = source.playlist
|
|
874
|
+
</span><span class="marked1"><a name="line255" />255 end
|
|
875
|
+
</span><span class="inferred0"><a name="line256" />256
|
|
876
|
+
</span><span class="inferred1"><a name="line257" />257 # The <trackList> section of the XSPF document
|
|
877
|
+
</span><span class="marked0"><a name="line258" />258 def tracklist
|
|
878
|
+
</span><span class="marked1"><a name="line259" />259 @playlist.elements['trackList'] || nil
|
|
879
|
+
</span><span class="marked0"><a name="line260" />260 end
|
|
880
|
+
</span><span class="inferred1"><a name="line261" />261
|
|
881
|
+
</span><span class="inferred0"><a name="line262" />262 end
|
|
882
|
+
</span><span class="inferred1"><a name="line263" />263
|
|
883
|
+
</span><span class="marked0"><a name="line264" />264 class XSPF::Tracklist < XSPF::Playlist
|
|
884
|
+
</span><span class="inferred1"><a name="line265" />265
|
|
885
|
+
</span><span class="marked0"><a name="line266" />266 attr_reader :tracklist
|
|
886
|
+
</span><span class="inferred1"><a name="line267" />267
|
|
887
|
+
</span><span class="inferred0"><a name="line268" />268 # Creates a XSPF::Tracklist from a XSPF::Playlist
|
|
888
|
+
</span><span class="marked1"><a name="line269" />269 def initialize(playlist)
|
|
889
|
+
</span><span class="marked0"><a name="line270" />270 @tracklist = playlist.tracklist
|
|
890
|
+
</span><span class="marked1"><a name="line271" />271 end
|
|
891
|
+
</span><span class="inferred0"><a name="line272" />272
|
|
892
|
+
</span><span class="inferred1"><a name="line273" />273 # An array XSPF::Track objects, one for each track returned by XSPF::Playlist#tracklist
|
|
893
|
+
</span><span class="marked0"><a name="line274" />274 def tracks
|
|
894
|
+
</span><span class="marked1"><a name="line275" />275 @tracklist.elements.collect { |track| XSPF::Track.new(track) }
|
|
895
|
+
</span><span class="marked0"><a name="line276" />276 end
|
|
896
|
+
</span><span class="inferred1"><a name="line277" />277
|
|
897
|
+
</span><span class="inferred0"><a name="line278" />278 end
|
|
898
|
+
</span><span class="inferred1"><a name="line279" />279
|
|
899
|
+
</span><span class="marked0"><a name="line280" />280 class XSPF::Track
|
|
900
|
+
</span><span class="inferred1"><a name="line281" />281
|
|
901
|
+
</span><span class="marked0"><a name="line282" />282 attr_reader :track
|
|
902
|
+
</span><span class="inferred1"><a name="line283" />283
|
|
903
|
+
</span><span class="inferred0"><a name="line284" />284 #:stopdoc:
|
|
904
|
+
</span><span class="marked1"><a name="line285" />285 ELEMENTS = %w{ location identifier title creator annotation info image album trackNum duration extension }
|
|
905
|
+
</span><span class="marked0"><a name="line286" />286 ATTRIBUTE_AND_ELEMENT = %w{ link meta }
|
|
906
|
+
</span><span class="marked1"><a name="line287" />287 LOCATION_RDOC = "URL of resource to be rendered. Probably an audio resource, but MAY be any type of resource with a well-known duration, such as video, a SMIL document, or an XSPF document. The duration of the resource defined in this element defines the duration of rendering. XSPF::Track objects MAY contain zero or more location elements, but a user-agent MUST NOT render more than one of the named resources. Currently, XSPF for Ruby returns only the first location."
|
|
907
|
+
</span><span class="marked0"><a name="line288" />288 IDENTIFIER_RDOC = "Canonical ID for this resource. Likely to be a hash or other location-independent name, such as a MusicBrainz identifier or isbn URN (if there existed isbn numbers for audio). MUST be a legal URN. XSPF::Track objects elements MAY contain zero or more identifier elements, but currently XSPF for Ruby returns only the first one."
|
|
908
|
+
</span><span class="marked1"><a name="line289" />289 TITLE_RDOC = "Human-readable name of the track that authored the resource which defines the duration of track rendering. This value is primarily for fuzzy lookups, though a user-agent may display it. XSPF::Track objects MAY contain exactly one."
|
|
909
|
+
</span><span class="marked0"><a name="line290" />290 CREATOR_RDOC = "Human-readable name of the entity (author, authors, group, company, etc) that authored the resource which defines the duration of track rendering. This value is primarily for fuzzy lookups, though a user-agent may display it. XSPF::Track objects MAY contain exactly one."
|
|
910
|
+
</span><span class="marked1"><a name="line291" />291 ANNOTATION_RDOC = "A human-readable comment on the track. This is character data, not HTML, and it may not contain markup. XSPF::Track objects MAY contain exactly one."
|
|
911
|
+
</span><span class="marked0"><a name="line292" />292 INFO_RDOC = "URL of a place where this resource can be bought or more info can be found."
|
|
912
|
+
</span><span class="marked1"><a name="line293" />293 IMAGE_RDOC = "URL of an image to display for the duration of the track. XSPF::Track objects MAY contain exactly one."
|
|
913
|
+
</span><span class="marked0"><a name="line294" />294 ALBUM_RDOC = "Human-readable name of the collection from which the resource which defines the duration of track rendering comes. For a song originally published as a part of a CD or LP, this would be the title of the original release. This value is primarily for fuzzy lookups, though a user-agent may display it. XSPF::Track objects MAY contain exactly one."
|
|
914
|
+
</span><span class="marked1"><a name="line295" />295 TRACKNUM_RDOC = "Integer with value greater than zero giving the ordinal position of the media on the XSPF::Track#album. This value is primarily for fuzzy lookups, though a user-agent may display it. XSPF::Track objects MAY contain exactly one. It MUST be a valid XML Schema nonNegativeInteger."
|
|
915
|
+
</span><span class="marked0"><a name="line296" />296 DURATION_RDOC = "The time to render a resource, in milliseconds. It MUST be a valid XML Schema nonNegativeInteger. This value is only a hint -- different XSPF generators will generate slightly different values. A user-agent MUST NOT use this value to determine the rendering duration, since the data will likely be low quality. XSPF::Track objects MAY contain exactly one duration element."
|
|
916
|
+
</span><span class="marked1"><a name="line297" />297 EXTENSION_RDOC = "The extension element allows non-XSPF XML to be included in XSPF documents without breaking XSPF validation. The purpose is to allow nested XML, which the meta and link elements do not. XSPF::Track objects MAY contain zero or more extension elements, but currently XSPF for Ruby returns only the first one."
|
|
917
|
+
</span><span class="marked0"><a name="line298" />298 LINK_REL_RDOC = "The link element allows non-XSPF web resources to be included in XSPF documents without breaking XSPF validation. A valid 'link' element has a 'rel' attribute and a 'content' element, obtained with XSPF::Track#link_rel and XSPF::Track#link_content respectively. XSPF::Track objects MAY contain zero or more link elements, but currently XSPF for Ruby returns only the first one."
|
|
918
|
+
</span><span class="marked1"><a name="line299" />299 LINK_CONTENT_RDOC = "The link element allows non-XSPF web resources to be included in XSPF documents without breaking XSPF validation. A valid 'link' element has a 'rel' attribute and a 'content' element, obtained with XSPF::Track#link_rel and XSPF::Track#link_content respectively. XSPF::Track objects MAY contain zero or more meta elements, but currently XSPF for Ruby returns only the first one."
|
|
919
|
+
</span><span class="marked0"><a name="line300" />300 META_REL_RDOC = "The meta element allows non-XSPF metadata to be included in XSPF documents without breaking XSPF validation. A valid 'meta' element has a 'rel' attribute and a 'content' element, obtained with XSPF::Track#meta_rel and XSPF::Track#meta_content respectively. XSPF::Track objects MAY contain zero or more meta elements, but currently XSPF for Ruby returns only the first one."
|
|
920
|
+
</span><span class="marked1"><a name="line301" />301 META_CONTENT_RDOC = "The meta element allows non-XSPF metadata to be included in XSPF documents without breaking XSPF validation. A valid 'meta' element has a 'rel' attribute and a 'content' element, obtained with XSPF::Track#meta_rel and XSPF::Track#meta_content respectively. XSPF::Track objects MAY contain zero or more meta elements, but currently XSPF for Ruby returns only the first one."
|
|
921
|
+
</span><span class="inferred0"><a name="line302" />302
|
|
922
|
+
</span><span class="marked1"><a name="line303" />303 ELEMENTS.each do |element|
|
|
923
|
+
</span><span class="marked0"><a name="line304" />304 MetaGen.add_method( self, element, "@track.elements['#{element}'].text", eval(element.upcase + '_RDOC').to_s )
|
|
924
|
+
</span><span class="inferred1"><a name="line305" />305 end
|
|
925
|
+
</span><span class="inferred0"><a name="line306" />306
|
|
926
|
+
</span><span class="marked1"><a name="line307" />307 ATTRIBUTE_AND_ELEMENT.each do |ae|
|
|
927
|
+
</span><span class="marked0"><a name="line308" />308 MetaGen.add_method( self, "#{ae}_content", "@track.elements['#{ae}'].text", eval(ae.upcase + '_CONTENT_RDOC').to_s )
|
|
928
|
+
</span><span class="marked1"><a name="line309" />309 MetaGen.add_method( self, "#{ae}_rel", "@track.elements['#{ae}'].attributes['rel']", eval(ae.upcase + '_REL_RDOC').to_s )
|
|
929
|
+
</span><span class="inferred0"><a name="line310" />310 end
|
|
930
|
+
</span><span class="inferred1"><a name="line311" />311
|
|
931
|
+
</span><span class="inferred0"><a name="line312" />312 # :startdoc:
|
|
932
|
+
</span><span class="inferred1"><a name="line313" />313
|
|
933
|
+
</span><span class="inferred0"><a name="line314" />314 # Creates a XSPF::Track object from a <track> section of the XSPF document
|
|
934
|
+
</span><span class="marked1"><a name="line315" />315 def initialize(tr)
|
|
935
|
+
</span><span class="marked0"><a name="line316" />316 @track = tr
|
|
936
|
+
</span><span class="marked1"><a name="line317" />317 end
|
|
937
|
+
</span><span class="inferred0"><a name="line318" />318
|
|
938
|
+
</span><span class="inferred1"><a name="line319" />319 end
|
|
939
|
+
</span></pre><hr /> <p>Generated using the <a href='http://eigenclass.org/hiki.rb?rcov'>rcov code coverage analysis tool for Ruby</a> version 0.7.0.</p><p>
|
|
940
|
+
<a href='http://validator.w3.org/check/referer'>
|
|
941
|
+
<img src='http://www.w3.org/Icons/valid-xhtml10' height='31' alt='Valid XHTML 1.0!' width='88' />
|
|
942
|
+
</a>
|
|
943
|
+
<a href='http://jigsaw.w3.org/css-validator/check/referer'>
|
|
944
|
+
<img src='http://jigsaw.w3.org/css-validator/images/vcss' alt='Valid CSS!' style='border:0;width:88px;height:31px' />
|
|
945
|
+
</a>
|
|
946
|
+
</p>
|
|
947
|
+
</body>
|
|
948
|
+
</html>
|