daapclient 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG +36 -0
- data/EXAMPLES +79 -0
- data/LICENSE +340 -0
- data/NOTES +33 -0
- data/README +7 -31
- data/lib/net/daap.rb +34 -20
- data/lib/net/daap/album.rb +16 -0
- data/lib/net/daap/artist.rb +16 -0
- data/lib/net/daap/daap_version.rb +7 -0
- data/lib/net/daap/database.rb +54 -27
- data/lib/net/daap/dmap.rb +13 -24
- data/lib/net/daap/playlist.rb +4 -5
- data/lib/net/daap/song.rb +10 -8
- data/test/data/mt-daapd/02dd88de4b3a69c74bcc56c1acca9ae5.txt +0 -0
- data/test/data/mt-daapd/0de583b288d8ae30f89acb26d4c8535b.txt +0 -0
- data/test/data/mt-daapd/4146ec82a0f0a638db9293a0c2039e6b.txt +0 -0
- data/test/data/mt-daapd/51a2a6f2a53743bec7e79fe0d074dd28.txt +0 -0
- data/test/data/mt-daapd/6069971903eef3c8c71ec2c7b395bfeb.txt +0 -0
- data/test/data/mt-daapd/{e9a8e709c2116651157182f130207048.txt → 7102a16e834342b8264f1fb5226690e5.txt} +0 -0
- data/test/data/mt-daapd/9d29fb31969da7757fa2f4baa3a52fe9.txt +0 -0
- data/test/data/mt-daapd/a52dd33cc99471cc156528c06b22e709.txt +0 -0
- data/test/data/mt-daapd/a600829e59b3d719b32f25323a2719b0.txt +0 -0
- data/test/data/mt-daapd/e2552df8d742fe31d6cc6e1e41e496b3.txt +0 -0
- data/test/data/mt-daapd/fc631aa54b83344df9ccf1fbaa7684b0.txt +0 -0
- data/test/data/song_data.txt +0 -0
- data/test/data/song_structure.txt +209 -0
- data/test/mock_server.rb +56 -0
- data/test/server_saver.rb +31 -0
- data/test/tc_artists.rb +33 -0
- data/test/tc_client.rb +47 -116
- data/test/tc_download.rb +29 -0
- data/test/tc_playlist.rb +37 -0
- data/test/tc_protocol.rb +3 -0
- data/test/test_daap.rb +23 -0
- data/test/ts_daap.rb +7 -0
- metadata +41 -97
- data/doc/classes/Net.html +0 -127
- data/doc/classes/Net/DAAP.html +0 -168
- data/doc/classes/Net/DAAP/Client.html +0 -269
- data/doc/classes/Net/DAAP/Client.src/M000003.html +0 -20
- data/doc/classes/Net/DAAP/Client.src/M000004.html +0 -28
- data/doc/classes/Net/DAAP/Client.src/M000005.html +0 -33
- data/doc/classes/Net/DAAP/Client.src/M000006.html +0 -37
- data/doc/classes/Net/DAAP/Client.src/M000007.html +0 -20
- data/doc/classes/Net/DAAP/Client.src/M000008.html +0 -24
- data/doc/classes/Net/DAAP/Client.src/M000009.html +0 -18
- data/doc/classes/Net/DAAP/DAAPv2.html +0 -165
- data/doc/classes/Net/DAAP/DAAPv2.src/M000016.html +0 -30
- data/doc/classes/Net/DAAP/DAAPv2.src/M000017.html +0 -21
- data/doc/classes/Net/DAAP/DAAPv3.html +0 -178
- data/doc/classes/Net/DAAP/DAAPv3.src/M000018.html +0 -30
- data/doc/classes/Net/DAAP/DAAPv3.src/M000019.html +0 -23
- data/doc/classes/Net/DAAP/DMAP.html +0 -176
- data/doc/classes/Net/DAAP/DMAP.src/M000013.html +0 -20
- data/doc/classes/Net/DAAP/DMAP.src/M000014.html +0 -18
- data/doc/classes/Net/DAAP/DMAP.src/M000015.html +0 -24
- data/doc/classes/Net/DAAP/Database.html +0 -224
- data/doc/classes/Net/DAAP/Database.src/M000010.html +0 -25
- data/doc/classes/Net/DAAP/Database.src/M000011.html +0 -21
- data/doc/classes/Net/DAAP/Database.src/M000012.html +0 -35
- data/doc/classes/Net/DAAP/Playlist.html +0 -192
- data/doc/classes/Net/DAAP/Playlist.src/M000001.html +0 -24
- data/doc/classes/Net/DAAP/Playlist.src/M000002.html +0 -30
- data/doc/classes/Net/DAAP/Song.html +0 -208
- data/doc/classes/Net/DAAP/Song.src/M000020.html +0 -27
- data/doc/classes/Net/DAAP/Song.src/M000021.html +0 -19
- data/doc/created.rid +0 -1
- data/doc/files/CHANGELOG.html +0 -134
- data/doc/files/LICENSE.html +0 -531
- data/doc/files/README.html +0 -182
- data/doc/files/lib/net/daap/database_rb.html +0 -101
- data/doc/files/lib/net/daap/dmap_rb.html +0 -101
- data/doc/files/lib/net/daap/playlist_rb.html +0 -101
- data/doc/files/lib/net/daap/song_rb.html +0 -101
- data/doc/files/lib/net/daap_rb.html +0 -114
- data/doc/fr_class_index.html +0 -35
- data/doc/fr_file_index.html +0 -34
- data/doc/fr_method_index.html +0 -47
- data/doc/index.html +0 -24
- data/doc/rdoc-style.css +0 -208
- data/lib/CVS/Entries +0 -1
- data/lib/CVS/Repository +0 -1
- data/lib/CVS/Root +0 -1
- data/lib/net/CVS/Entries +0 -2
- data/lib/net/CVS/Repository +0 -1
- data/lib/net/CVS/Root +0 -1
- data/lib/net/daap/CVS/Entries +0 -5
- data/lib/net/daap/CVS/Repository +0 -1
- data/lib/net/daap/CVS/Root +0 -1
- data/test/CVS/Entries +0 -4
- data/test/CVS/Repository +0 -1
- data/test/CVS/Root +0 -1
- data/test/data/CVS/Entries +0 -1
- data/test/data/CVS/Repository +0 -1
- data/test/data/CVS/Root +0 -1
- data/test/data/mt-daapd/079aca35773150da9fd98db10c7fd0c0.txt +0 -0
- data/test/data/mt-daapd/2972f65088b42a06b5d3ca089d71791d.txt +0 -0
- data/test/data/mt-daapd/440c2217e6207c54c317c296f71f9769.txt +0 -0
- data/test/data/mt-daapd/4d1ce9f941cbd823ed06f1f1baa5a3b9.txt +0 -0
- data/test/data/mt-daapd/7bded8b540fd082f102d25e181b47bc4.txt +0 -0
- data/test/data/mt-daapd/CVS/Entries +0 -11
- data/test/data/mt-daapd/CVS/Repository +0 -1
- data/test/data/mt-daapd/CVS/Root +0 -1
- data/test/data/mt-daapd/b3e894b87111bdba88e4765967f4b45a.txt +0 -0
- data/test/data/mt-daapd/d56b699830e77ba53855679cb1d252da.txt +0 -0
- data/test/data/mt-daapd/e61ce3062cb76770658896b778ad06cd.txt +0 -0
- data/test/data/mt-daapd/f9073959a0afacebfab7e3bf19c2714a.txt +0 -0
|
@@ -1,269 +0,0 @@
|
|
|
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: Net::DAAP::Client</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">Net::DAAP::Client</td>
|
|
54
|
-
</tr>
|
|
55
|
-
<tr class="top-aligned-row">
|
|
56
|
-
<td><strong>In:</strong></td>
|
|
57
|
-
<td>
|
|
58
|
-
<a href="../../../files/lib/net/daap_rb.html">
|
|
59
|
-
lib/net/daap.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
|
-
<div id="description">
|
|
82
|
-
<h1>Synopsis</h1>
|
|
83
|
-
<p>
|
|
84
|
-
The <a href="Client.html">Client</a> class interacts with the iTunes server
|
|
85
|
-
to fetch lists of songs, databases, and playlists. Each <a
|
|
86
|
-
href="Client.html">Client</a> class can have many <a
|
|
87
|
-
href="Database.html">Database</a>, and each <a
|
|
88
|
-
href="Database.html">Database</a> can have many <a
|
|
89
|
-
href="Playlist.html">Playlist</a>, and many <a href="Song.html">Song</a>.
|
|
90
|
-
See <a href="../DAAP.html">DAAP</a> for a code example.
|
|
91
|
-
</p>
|
|
92
|
-
|
|
93
|
-
</div>
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
</div>
|
|
97
|
-
|
|
98
|
-
<div id="method-list">
|
|
99
|
-
<h3 class="section-bar">Methods</h3>
|
|
100
|
-
|
|
101
|
-
<div class="name-list">
|
|
102
|
-
<a href="#M000004">connect</a>
|
|
103
|
-
<a href="#M000005">databases</a>
|
|
104
|
-
<a href="#M000009">disconnect</a>
|
|
105
|
-
<a href="#M000006">do_get</a>
|
|
106
|
-
<a href="#M000007">get_song</a>
|
|
107
|
-
<a href="#M000003">new</a>
|
|
108
|
-
<a href="#M000008">unpack_listing</a>
|
|
109
|
-
</div>
|
|
110
|
-
</div>
|
|
111
|
-
|
|
112
|
-
</div>
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
<!-- if includes -->
|
|
116
|
-
|
|
117
|
-
<div id="section">
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
<div id="attribute-list">
|
|
124
|
-
<h3 class="section-bar">Attributes</h3>
|
|
125
|
-
|
|
126
|
-
<div class="name-list">
|
|
127
|
-
<table>
|
|
128
|
-
<tr class="top-aligned-row context-row">
|
|
129
|
-
<td class="context-item-name">dmap</td>
|
|
130
|
-
<td class="context-item-value"> [R] </td>
|
|
131
|
-
<td class="context-item-desc"></td>
|
|
132
|
-
</tr>
|
|
133
|
-
</table>
|
|
134
|
-
</div>
|
|
135
|
-
</div>
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
<!-- if method_list -->
|
|
140
|
-
<div id="methods">
|
|
141
|
-
<h3 class="section-bar">Public Class methods</h3>
|
|
142
|
-
|
|
143
|
-
<div id="method-M000003" class="method-detail">
|
|
144
|
-
<a name="M000003"></a>
|
|
145
|
-
|
|
146
|
-
<div class="method-heading">
|
|
147
|
-
<a href="Client.src/M000003.html" target="Code" class="method-signature"
|
|
148
|
-
onclick="popupCode('Client.src/M000003.html');return false;">
|
|
149
|
-
<span class="method-name">new</span><span class="method-args">(server_host)</span>
|
|
150
|
-
</a>
|
|
151
|
-
</div>
|
|
152
|
-
|
|
153
|
-
<div class="method-description">
|
|
154
|
-
<p>
|
|
155
|
-
Create a new <a href="Client.html">Client</a> and pass in the host where
|
|
156
|
-
the client will connect.
|
|
157
|
-
</p>
|
|
158
|
-
</div>
|
|
159
|
-
</div>
|
|
160
|
-
|
|
161
|
-
<h3 class="section-bar">Public Instance methods</h3>
|
|
162
|
-
|
|
163
|
-
<div id="method-M000004" class="method-detail">
|
|
164
|
-
<a name="M000004"></a>
|
|
165
|
-
|
|
166
|
-
<div class="method-heading">
|
|
167
|
-
<a href="Client.src/M000004.html" target="Code" class="method-signature"
|
|
168
|
-
onclick="popupCode('Client.src/M000004.html');return false;">
|
|
169
|
-
<span class="method-name">connect</span><span class="method-args">() {|@dsn| ...}</span>
|
|
170
|
-
</a>
|
|
171
|
-
</div>
|
|
172
|
-
|
|
173
|
-
<div class="method-description">
|
|
174
|
-
<p>
|
|
175
|
-
Connects to the iTunes server. This method should be called right after
|
|
176
|
-
construction. See <a href="../DAAP.html">DAAP</a> for an example.
|
|
177
|
-
</p>
|
|
178
|
-
</div>
|
|
179
|
-
</div>
|
|
180
|
-
|
|
181
|
-
<div id="method-M000005" class="method-detail">
|
|
182
|
-
<a name="M000005"></a>
|
|
183
|
-
|
|
184
|
-
<div class="method-heading">
|
|
185
|
-
<a href="Client.src/M000005.html" target="Code" class="method-signature"
|
|
186
|
-
onclick="popupCode('Client.src/M000005.html');return false;">
|
|
187
|
-
<span class="method-name">databases</span><span class="method-args">() {|db| ...}</span>
|
|
188
|
-
</a>
|
|
189
|
-
</div>
|
|
190
|
-
|
|
191
|
-
<div class="method-description">
|
|
192
|
-
<p>
|
|
193
|
-
Returns the databases found on the iTunes server.
|
|
194
|
-
</p>
|
|
195
|
-
</div>
|
|
196
|
-
</div>
|
|
197
|
-
|
|
198
|
-
<div id="method-M000009" class="method-detail">
|
|
199
|
-
<a name="M000009"></a>
|
|
200
|
-
|
|
201
|
-
<div class="method-heading">
|
|
202
|
-
<a href="Client.src/M000009.html" target="Code" class="method-signature"
|
|
203
|
-
onclick="popupCode('Client.src/M000009.html');return false;">
|
|
204
|
-
<span class="method-name">disconnect</span><span class="method-args">()</span>
|
|
205
|
-
</a>
|
|
206
|
-
</div>
|
|
207
|
-
|
|
208
|
-
<div class="method-description">
|
|
209
|
-
<p>
|
|
210
|
-
Disconnects from the <a href="../DAAP.html">DAAP</a> server
|
|
211
|
-
</p>
|
|
212
|
-
</div>
|
|
213
|
-
</div>
|
|
214
|
-
|
|
215
|
-
<div id="method-M000006" class="method-detail">
|
|
216
|
-
<a name="M000006"></a>
|
|
217
|
-
|
|
218
|
-
<div class="method-heading">
|
|
219
|
-
<a href="Client.src/M000006.html" target="Code" class="method-signature"
|
|
220
|
-
onclick="popupCode('Client.src/M000006.html');return false;">
|
|
221
|
-
<span class="method-name">do_get</span><span class="method-args">(request, &block)</span>
|
|
222
|
-
</a>
|
|
223
|
-
</div>
|
|
224
|
-
|
|
225
|
-
<div class="method-description">
|
|
226
|
-
</div>
|
|
227
|
-
</div>
|
|
228
|
-
|
|
229
|
-
<div id="method-M000007" class="method-detail">
|
|
230
|
-
<a name="M000007"></a>
|
|
231
|
-
|
|
232
|
-
<div class="method-heading">
|
|
233
|
-
<a href="Client.src/M000007.html" target="Code" class="method-signature"
|
|
234
|
-
onclick="popupCode('Client.src/M000007.html');return false;">
|
|
235
|
-
<span class="method-name">get_song</span><span class="method-args">(request, &block)</span>
|
|
236
|
-
</a>
|
|
237
|
-
</div>
|
|
238
|
-
|
|
239
|
-
<div class="method-description">
|
|
240
|
-
</div>
|
|
241
|
-
</div>
|
|
242
|
-
|
|
243
|
-
<div id="method-M000008" class="method-detail">
|
|
244
|
-
<a name="M000008"></a>
|
|
245
|
-
|
|
246
|
-
<div class="method-heading">
|
|
247
|
-
<a href="Client.src/M000008.html" target="Code" class="method-signature"
|
|
248
|
-
onclick="popupCode('Client.src/M000008.html');return false;">
|
|
249
|
-
<span class="method-name">unpack_listing</span><span class="method-args">(listing) {|record| ...}</span>
|
|
250
|
-
</a>
|
|
251
|
-
</div>
|
|
252
|
-
|
|
253
|
-
<div class="method-description">
|
|
254
|
-
</div>
|
|
255
|
-
</div>
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
</div>
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
</div>
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
<div id="validator-badges">
|
|
265
|
-
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
|
266
|
-
</div>
|
|
267
|
-
|
|
268
|
-
</body>
|
|
269
|
-
</html>
|
|
@@ -1,20 +0,0 @@
|
|
|
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>
|
|
7
|
-
<head>
|
|
8
|
-
<title>new (Net::DAAP::Client)</title>
|
|
9
|
-
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
10
|
-
<link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
|
|
11
|
-
</head>
|
|
12
|
-
<body class="standalone-code">
|
|
13
|
-
<pre><span class="ruby-comment cmt"># File lib/net/daap.rb, line 52</span>
|
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">server_host</span>)
|
|
15
|
-
<span class="ruby-ivar">@server_host</span> = <span class="ruby-identifier">server_host</span>
|
|
16
|
-
<span class="ruby-ivar">@server_port</span> = <span class="ruby-value">3689</span>
|
|
17
|
-
<span class="ruby-ivar">@debug</span> = <span class="ruby-value">0</span>
|
|
18
|
-
<span class="ruby-keyword kw">end</span></pre>
|
|
19
|
-
</body>
|
|
20
|
-
</html>
|
|
@@ -1,28 +0,0 @@
|
|
|
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>
|
|
7
|
-
<head>
|
|
8
|
-
<title>connect (Net::DAAP::Client)</title>
|
|
9
|
-
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
10
|
-
<link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
|
|
11
|
-
</head>
|
|
12
|
-
<body class="standalone-code">
|
|
13
|
-
<pre><span class="ruby-comment cmt"># File lib/net/daap.rb, line 60</span>
|
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">connect</span>
|
|
15
|
-
<span class="ruby-ivar">@http_client</span> = <span class="ruby-constant">Net</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTP</span>.<span class="ruby-identifier">start</span>(<span class="ruby-ivar">@server_host</span>, <span class="ruby-ivar">@server_port</span>)
|
|
16
|
-
<span class="ruby-identifier">find_validator</span>
|
|
17
|
-
<span class="ruby-ivar">@dmap</span> = <span class="ruby-constant">Net</span><span class="ruby-operator">::</span><span class="ruby-constant">DAAP</span><span class="ruby-operator">::</span><span class="ruby-constant">DMAP</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">:daap</span> =<span class="ruby-operator">></span> <span class="ruby-keyword kw">self</span>)
|
|
18
|
-
<span class="ruby-identifier">load_server_info</span>
|
|
19
|
-
<span class="ruby-ivar">@connected</span> = <span class="ruby-value">1</span>
|
|
20
|
-
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
|
|
21
|
-
<span class="ruby-keyword kw">yield</span> <span class="ruby-ivar">@dsn</span>
|
|
22
|
-
<span class="ruby-identifier">disconnect</span>
|
|
23
|
-
<span class="ruby-ivar">@connected</span> = <span class="ruby-value">0</span>
|
|
24
|
-
<span class="ruby-keyword kw">end</span>
|
|
25
|
-
<span class="ruby-ivar">@dsn</span>
|
|
26
|
-
<span class="ruby-keyword kw">end</span></pre>
|
|
27
|
-
</body>
|
|
28
|
-
</html>
|
|
@@ -1,33 +0,0 @@
|
|
|
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>
|
|
7
|
-
<head>
|
|
8
|
-
<title>databases (Net::DAAP::Client)</title>
|
|
9
|
-
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
10
|
-
<link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
|
|
11
|
-
</head>
|
|
12
|
-
<body class="standalone-code">
|
|
13
|
-
<pre><span class="ruby-comment cmt"># File lib/net/daap.rb, line 75</span>
|
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">databases</span>
|
|
15
|
-
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">error</span>(<span class="ruby-value str">"Not connected, can't fetch databases"</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@connected</span>
|
|
16
|
-
|
|
17
|
-
<span class="ruby-identifier">listings</span> = <span class="ruby-ivar">@dmap</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">do_get</span>(<span class="ruby-value str">"databases"</span>),
|
|
18
|
-
<span class="ruby-value str">"daap.serverdatabases/dmap.listing"</span>)
|
|
19
|
-
<span class="ruby-comment cmt"># FIXME check the value of listing</span>
|
|
20
|
-
<span class="ruby-ivar">@databases</span> = []
|
|
21
|
-
<span class="ruby-identifier">unpack_listing</span>(<span class="ruby-identifier">listings</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">value</span><span class="ruby-operator">|</span>
|
|
22
|
-
<span class="ruby-identifier">db</span> = <span class="ruby-constant">Database</span>.<span class="ruby-identifier">new</span>( <span class="ruby-identifier">:db_info</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">value</span>,
|
|
23
|
-
<span class="ruby-identifier">:daap</span> =<span class="ruby-operator">></span> <span class="ruby-keyword kw">self</span> )
|
|
24
|
-
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
|
|
25
|
-
<span class="ruby-keyword kw">yield</span> <span class="ruby-identifier">db</span>
|
|
26
|
-
<span class="ruby-keyword kw">else</span>
|
|
27
|
-
<span class="ruby-ivar">@databases</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">db</span>
|
|
28
|
-
<span class="ruby-keyword kw">end</span>
|
|
29
|
-
<span class="ruby-keyword kw">end</span>
|
|
30
|
-
<span class="ruby-ivar">@databases</span>
|
|
31
|
-
<span class="ruby-keyword kw">end</span></pre>
|
|
32
|
-
</body>
|
|
33
|
-
</html>
|
|
@@ -1,37 +0,0 @@
|
|
|
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>
|
|
7
|
-
<head>
|
|
8
|
-
<title>do_get (Net::DAAP::Client)</title>
|
|
9
|
-
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
10
|
-
<link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
|
|
11
|
-
</head>
|
|
12
|
-
<body class="standalone-code">
|
|
13
|
-
<pre><span class="ruby-comment cmt"># File lib/net/daap.rb, line 94</span>
|
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">do_get</span>(<span class="ruby-identifier">request</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
|
15
|
-
<span class="ruby-identifier">debug</span>(<span class="ruby-value str">"do_get"</span>)
|
|
16
|
-
<span class="ruby-identifier">url</span> = <span class="ruby-constant">String</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">'/'</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">request</span>)
|
|
17
|
-
<span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@session_id</span>
|
|
18
|
-
<span class="ruby-identifier">url</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">url</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/\?/</span> <span class="ruby-operator">?</span> <span class="ruby-value str">"&"</span> <span class="ruby-operator">:</span> <span class="ruby-value str">"?"</span>
|
|
19
|
-
<span class="ruby-identifier">url</span> <span class="ruby-operator">+=</span> <span class="ruby-node">"session-id=#{@session_id}"</span>
|
|
20
|
-
<span class="ruby-keyword kw">end</span>
|
|
21
|
-
|
|
22
|
-
<span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@revision</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">request</span> <span class="ruby-operator">!=</span> <span class="ruby-value str">"logout"</span>
|
|
23
|
-
<span class="ruby-identifier">url</span> <span class="ruby-operator">+=</span> <span class="ruby-node">"&revision-number=#{@revision}"</span>
|
|
24
|
-
<span class="ruby-keyword kw">end</span>
|
|
25
|
-
<span class="ruby-identifier">debug</span>(<span class="ruby-identifier">url</span>)
|
|
26
|
-
|
|
27
|
-
<span class="ruby-identifier">res</span> = <span class="ruby-ivar">@http_client</span>.<span class="ruby-identifier">get</span>(<span class="ruby-identifier">url</span>, <span class="ruby-identifier">request_headers</span>(<span class="ruby-identifier">url</span>), <span class="ruby-keyword kw">nil</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
|
28
|
-
|
|
29
|
-
<span class="ruby-identifier">content_type</span> = <span class="ruby-identifier">res</span>.<span class="ruby-identifier">header</span>[<span class="ruby-value str">'content-type'</span>]
|
|
30
|
-
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">request</span> <span class="ruby-operator">!~</span> <span class="ruby-regexp re">/(?:\/items\/\d+\.|logout)/</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">content_type</span> <span class="ruby-operator">!~</span> <span class="ruby-regexp re">/dmap/</span>
|
|
31
|
-
<span class="ruby-identifier">raise</span> <span class="ruby-value str">"Broken response"</span>
|
|
32
|
-
<span class="ruby-keyword kw">end</span>
|
|
33
|
-
|
|
34
|
-
<span class="ruby-identifier">res</span>.<span class="ruby-identifier">body</span>
|
|
35
|
-
<span class="ruby-keyword kw">end</span></pre>
|
|
36
|
-
</body>
|
|
37
|
-
</html>
|
|
@@ -1,20 +0,0 @@
|
|
|
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>
|
|
7
|
-
<head>
|
|
8
|
-
<title>get_song (Net::DAAP::Client)</title>
|
|
9
|
-
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
10
|
-
<link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
|
|
11
|
-
</head>
|
|
12
|
-
<body class="standalone-code">
|
|
13
|
-
<pre><span class="ruby-comment cmt"># File lib/net/daap.rb, line 117</span>
|
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_song</span>(<span class="ruby-identifier">request</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
|
15
|
-
<span class="ruby-ivar">@request_id</span> = <span class="ruby-value">1</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@request_id</span>
|
|
16
|
-
<span class="ruby-ivar">@request_id</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@request_id</span>
|
|
17
|
-
<span class="ruby-identifier">do_get</span>(<span class="ruby-identifier">request</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
|
18
|
-
<span class="ruby-keyword kw">end</span></pre>
|
|
19
|
-
</body>
|
|
20
|
-
</html>
|
|
@@ -1,24 +0,0 @@
|
|
|
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>
|
|
7
|
-
<head>
|
|
8
|
-
<title>unpack_listing (Net::DAAP::Client)</title>
|
|
9
|
-
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
10
|
-
<link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
|
|
11
|
-
</head>
|
|
12
|
-
<body class="standalone-code">
|
|
13
|
-
<pre><span class="ruby-comment cmt"># File lib/net/daap.rb, line 123</span>
|
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">unpack_listing</span>(<span class="ruby-identifier">listing</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">func</span>)
|
|
15
|
-
<span class="ruby-identifier">listing</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">item</span><span class="ruby-operator">|</span>
|
|
16
|
-
<span class="ruby-identifier">record</span> = <span class="ruby-constant">Hash</span>.<span class="ruby-identifier">new</span>
|
|
17
|
-
<span class="ruby-identifier">item</span>[<span class="ruby-value">1</span>].<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">pair_ref</span><span class="ruby-operator">|</span>
|
|
18
|
-
<span class="ruby-identifier">record</span>[<span class="ruby-identifier">pair_ref</span>[<span class="ruby-value">0</span>]] = <span class="ruby-identifier">pair_ref</span>[<span class="ruby-value">1</span>]
|
|
19
|
-
<span class="ruby-keyword kw">end</span>
|
|
20
|
-
<span class="ruby-keyword kw">yield</span> <span class="ruby-identifier">record</span>
|
|
21
|
-
<span class="ruby-keyword kw">end</span>
|
|
22
|
-
<span class="ruby-keyword kw">end</span></pre>
|
|
23
|
-
</body>
|
|
24
|
-
</html>
|
|
@@ -1,18 +0,0 @@
|
|
|
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>
|
|
7
|
-
<head>
|
|
8
|
-
<title>disconnect (Net::DAAP::Client)</title>
|
|
9
|
-
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
10
|
-
<link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
|
|
11
|
-
</head>
|
|
12
|
-
<body class="standalone-code">
|
|
13
|
-
<pre><span class="ruby-comment cmt"># File lib/net/daap.rb, line 134</span>
|
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">disconnect</span>
|
|
15
|
-
<span class="ruby-identifier">do_get</span>(<span class="ruby-value str">"logout"</span>)
|
|
16
|
-
<span class="ruby-keyword kw">end</span></pre>
|
|
17
|
-
</body>
|
|
18
|
-
</html>
|