daapclient 0.0.2 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README +8 -13
- data/doc/classes/Net.html +127 -0
- data/doc/classes/Net/DAAP.html +168 -0
- data/doc/classes/Net/DAAP/Client.html +269 -0
- data/doc/classes/Net/DAAP/Client.src/M000003.html +20 -0
- data/doc/classes/Net/DAAP/Client.src/M000004.html +28 -0
- data/doc/classes/Net/DAAP/Client.src/M000005.html +33 -0
- data/doc/classes/Net/DAAP/Client.src/M000006.html +37 -0
- data/doc/classes/Net/DAAP/Client.src/M000007.html +20 -0
- data/doc/classes/Net/DAAP/Client.src/M000008.html +24 -0
- data/doc/classes/Net/DAAP/Client.src/M000009.html +18 -0
- data/doc/classes/Net/DAAP/DAAPv2.html +165 -0
- data/doc/classes/Net/DAAP/DAAPv2.src/M000016.html +30 -0
- data/doc/classes/Net/DAAP/DAAPv2.src/M000017.html +21 -0
- data/doc/classes/Net/DAAP/DAAPv3.html +178 -0
- data/doc/classes/Net/DAAP/DAAPv3.src/M000018.html +30 -0
- data/doc/classes/Net/DAAP/DAAPv3.src/M000019.html +23 -0
- data/doc/classes/Net/DAAP/DMAP.html +176 -0
- data/doc/classes/Net/DAAP/DMAP.src/M000013.html +20 -0
- data/doc/classes/Net/DAAP/DMAP.src/M000014.html +18 -0
- data/doc/classes/Net/DAAP/DMAP.src/M000015.html +24 -0
- data/doc/classes/Net/DAAP/Database.html +224 -0
- data/doc/classes/Net/DAAP/Database.src/M000010.html +25 -0
- data/doc/classes/Net/DAAP/Database.src/M000011.html +21 -0
- data/doc/classes/Net/DAAP/Database.src/M000012.html +35 -0
- data/doc/classes/Net/DAAP/Playlist.html +192 -0
- data/doc/classes/Net/DAAP/Playlist.src/M000001.html +24 -0
- data/doc/classes/Net/DAAP/Playlist.src/M000002.html +30 -0
- data/doc/classes/Net/DAAP/Song.html +208 -0
- data/doc/classes/Net/DAAP/Song.src/M000020.html +27 -0
- data/doc/classes/Net/DAAP/Song.src/M000021.html +19 -0
- data/doc/created.rid +1 -0
- data/doc/files/CHANGELOG.html +134 -0
- data/doc/files/LICENSE.html +531 -0
- data/doc/files/README.html +182 -0
- data/doc/files/lib/net/daap/database_rb.html +101 -0
- data/doc/files/lib/net/daap/dmap_rb.html +101 -0
- data/doc/files/lib/net/daap/playlist_rb.html +101 -0
- data/doc/files/lib/net/daap/song_rb.html +101 -0
- data/doc/files/lib/net/daap_rb.html +114 -0
- data/doc/fr_class_index.html +35 -0
- data/doc/fr_file_index.html +34 -0
- data/doc/fr_method_index.html +47 -0
- data/doc/index.html +24 -0
- data/doc/rdoc-style.css +208 -0
- data/lib/net/CVS/Entries +1 -1
- data/lib/net/daap.rb +4 -4
- data/lib/net/daap/CVS/Entries +1 -1
- data/lib/net/daap/song.rb +2 -2
- metadata +60 -3
- data/lib/itunes_sync.rb +0 -19
@@ -0,0 +1,20 @@
|
|
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>
|
@@ -0,0 +1,28 @@
|
|
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>
|
@@ -0,0 +1,33 @@
|
|
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>
|
@@ -0,0 +1,37 @@
|
|
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>
|
@@ -0,0 +1,20 @@
|
|
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>
|
@@ -0,0 +1,24 @@
|
|
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>
|
@@ -0,0 +1,18 @@
|
|
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>
|
@@ -0,0 +1,165 @@
|
|
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::DAAPv2</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::DAAPv2</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
|
+
<p>
|
83
|
+
This class is used for generating a <a href="Client.html">Client</a>-<a
|
84
|
+
href="../DAAP.html">DAAP</a>-Validation header for iTunes version 4.2
|
85
|
+
servers.
|
86
|
+
</p>
|
87
|
+
|
88
|
+
</div>
|
89
|
+
|
90
|
+
|
91
|
+
</div>
|
92
|
+
|
93
|
+
<div id="method-list">
|
94
|
+
<h3 class="section-bar">Methods</h3>
|
95
|
+
|
96
|
+
<div class="name-list">
|
97
|
+
<a href="#M000016">new</a>
|
98
|
+
<a href="#M000017">validate</a>
|
99
|
+
</div>
|
100
|
+
</div>
|
101
|
+
|
102
|
+
</div>
|
103
|
+
|
104
|
+
|
105
|
+
<!-- if includes -->
|
106
|
+
|
107
|
+
<div id="section">
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
|
116
|
+
<!-- if method_list -->
|
117
|
+
<div id="methods">
|
118
|
+
<h3 class="section-bar">Public Class methods</h3>
|
119
|
+
|
120
|
+
<div id="method-M000016" class="method-detail">
|
121
|
+
<a name="M000016"></a>
|
122
|
+
|
123
|
+
<div class="method-heading">
|
124
|
+
<a href="DAAPv2.src/M000016.html" target="Code" class="method-signature"
|
125
|
+
onclick="popupCode('DAAPv2.src/M000016.html');return false;">
|
126
|
+
<span class="method-name">new</span><span class="method-args">()</span>
|
127
|
+
</a>
|
128
|
+
</div>
|
129
|
+
|
130
|
+
<div class="method-description">
|
131
|
+
</div>
|
132
|
+
</div>
|
133
|
+
|
134
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
135
|
+
|
136
|
+
<div id="method-M000017" class="method-detail">
|
137
|
+
<a name="M000017"></a>
|
138
|
+
|
139
|
+
<div class="method-heading">
|
140
|
+
<a href="DAAPv2.src/M000017.html" target="Code" class="method-signature"
|
141
|
+
onclick="popupCode('DAAPv2.src/M000017.html');return false;">
|
142
|
+
<span class="method-name">validate</span><span class="method-args">(path, select = 2, req_id = nil)</span>
|
143
|
+
</a>
|
144
|
+
</div>
|
145
|
+
|
146
|
+
<div class="method-description">
|
147
|
+
<p>
|
148
|
+
Returns a validation header based on MD5
|
149
|
+
</p>
|
150
|
+
</div>
|
151
|
+
</div>
|
152
|
+
|
153
|
+
|
154
|
+
</div>
|
155
|
+
|
156
|
+
|
157
|
+
</div>
|
158
|
+
|
159
|
+
|
160
|
+
<div id="validator-badges">
|
161
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
162
|
+
</div>
|
163
|
+
|
164
|
+
</body>
|
165
|
+
</html>
|
@@ -0,0 +1,30 @@
|
|
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::DAAPv2)</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 184</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>
|
15
|
+
<span class="ruby-ivar">@seeds</span> = []
|
16
|
+
(<span class="ruby-value">0</span><span class="ruby-operator">..</span><span class="ruby-value">255</span>).<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span>
|
17
|
+
<span class="ruby-identifier">string</span> = <span class="ruby-constant">String</span>.<span class="ruby-identifier">new</span>
|
18
|
+
<span class="ruby-identifier">string</span> <span class="ruby-operator">+=</span> (<span class="ruby-identifier">i</span> <span class="ruby-operator">&</span> <span class="ruby-value">0x80</span>) <span class="ruby-operator">!=</span> <span class="ruby-value">0</span> <span class="ruby-operator">?</span> <span class="ruby-value str">"Accept-Language"</span> <span class="ruby-operator">:</span> <span class="ruby-value str">"user-agent"</span>
|
19
|
+
<span class="ruby-identifier">string</span> <span class="ruby-operator">+=</span> (<span class="ruby-identifier">i</span> <span class="ruby-operator">&</span> <span class="ruby-value">0x40</span>) <span class="ruby-operator">!=</span> <span class="ruby-value">0</span> <span class="ruby-operator">?</span> <span class="ruby-value str">"max-age"</span> <span class="ruby-operator">:</span> <span class="ruby-value str">"Authorization"</span>
|
20
|
+
<span class="ruby-identifier">string</span> <span class="ruby-operator">+=</span> (<span class="ruby-identifier">i</span> <span class="ruby-operator">&</span> <span class="ruby-value">0x20</span>) <span class="ruby-operator">!=</span> <span class="ruby-value">0</span> <span class="ruby-operator">?</span> <span class="ruby-value str">"Client-DAAP-Version"</span> <span class="ruby-operator">:</span> <span class="ruby-value str">"Accept-Encoding"</span>
|
21
|
+
<span class="ruby-identifier">string</span> <span class="ruby-operator">+=</span> (<span class="ruby-identifier">i</span> <span class="ruby-operator">&</span> <span class="ruby-value">0x10</span>) <span class="ruby-operator">!=</span> <span class="ruby-value">0</span> <span class="ruby-operator">?</span> <span class="ruby-value str">"daap.protocolversion"</span><span class="ruby-operator">:</span> <span class="ruby-value str">"daap.songartist"</span>
|
22
|
+
<span class="ruby-identifier">string</span> <span class="ruby-operator">+=</span> (<span class="ruby-identifier">i</span> <span class="ruby-operator">&</span> <span class="ruby-value">0x08</span>) <span class="ruby-operator">!=</span> <span class="ruby-value">0</span> <span class="ruby-operator">?</span> <span class="ruby-value str">"daap.songcomposer"</span> <span class="ruby-operator">:</span> <span class="ruby-value str">"daap.songdatemodified"</span>
|
23
|
+
<span class="ruby-identifier">string</span> <span class="ruby-operator">+=</span> (<span class="ruby-identifier">i</span> <span class="ruby-operator">&</span> <span class="ruby-value">0x04</span>) <span class="ruby-operator">!=</span> <span class="ruby-value">0</span> <span class="ruby-operator">?</span> <span class="ruby-value str">"daap.songdiscnumber"</span> <span class="ruby-operator">:</span> <span class="ruby-value str">"daap.songdisabled"</span>
|
24
|
+
<span class="ruby-identifier">string</span> <span class="ruby-operator">+=</span> (<span class="ruby-identifier">i</span> <span class="ruby-operator">&</span> <span class="ruby-value">0x02</span>) <span class="ruby-operator">!=</span> <span class="ruby-value">0</span> <span class="ruby-operator">?</span> <span class="ruby-value str">"playlist-item-spec"</span> <span class="ruby-operator">:</span> <span class="ruby-value str">"revision-number"</span>
|
25
|
+
<span class="ruby-identifier">string</span> <span class="ruby-operator">+=</span> (<span class="ruby-identifier">i</span> <span class="ruby-operator">&</span> <span class="ruby-value">0x01</span>) <span class="ruby-operator">!=</span> <span class="ruby-value">0</span> <span class="ruby-operator">?</span> <span class="ruby-value str">"session-id"</span> <span class="ruby-operator">:</span> <span class="ruby-value str">"content-codes"</span>
|
26
|
+
<span class="ruby-ivar">@seeds</span> <span class="ruby-operator"><<</span> <span class="ruby-constant">Digest</span><span class="ruby-operator">::</span><span class="ruby-constant">MD5</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">string</span>).<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">upcase</span>
|
27
|
+
<span class="ruby-keyword kw">end</span>
|
28
|
+
<span class="ruby-keyword kw">end</span></pre>
|
29
|
+
</body>
|
30
|
+
</html>
|
@@ -0,0 +1,21 @@
|
|
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>validate (Net::DAAP::DAAPv2)</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 200</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">validate</span>(<span class="ruby-identifier">path</span>, <span class="ruby-identifier">select</span> = <span class="ruby-value">2</span>, <span class="ruby-identifier">req_id</span> = <span class="ruby-keyword kw">nil</span>)
|
15
|
+
<span class="ruby-identifier">string</span> = <span class="ruby-identifier">path</span>.<span class="ruby-identifier">dup</span>
|
16
|
+
<span class="ruby-identifier">string</span> <span class="ruby-operator">+=</span> <span class="ruby-value str">"Copyright 2003 Apple Computer, Inc."</span>
|
17
|
+
<span class="ruby-identifier">string</span> <span class="ruby-operator">+=</span> <span class="ruby-ivar">@seeds</span>[<span class="ruby-identifier">select</span>]
|
18
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-constant">Digest</span><span class="ruby-operator">::</span><span class="ruby-constant">MD5</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">string</span>).<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">upcase</span>
|
19
|
+
<span class="ruby-keyword kw">end</span></pre>
|
20
|
+
</body>
|
21
|
+
</html>
|
@@ -0,0 +1,178 @@
|
|
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::DAAPv3</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::DAAPv3</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
|
+
<p>
|
83
|
+
This class is used for generating a <a href="Client.html">Client</a>-<a
|
84
|
+
href="../DAAP.html">DAAP</a>-Validation header for iTunes servers newer
|
85
|
+
than 4.2, or something.
|
86
|
+
</p>
|
87
|
+
|
88
|
+
</div>
|
89
|
+
|
90
|
+
|
91
|
+
</div>
|
92
|
+
|
93
|
+
<div id="method-list">
|
94
|
+
<h3 class="section-bar">Methods</h3>
|
95
|
+
|
96
|
+
<div class="name-list">
|
97
|
+
<a href="#M000018">new</a>
|
98
|
+
<a href="#M000019">validate</a>
|
99
|
+
</div>
|
100
|
+
</div>
|
101
|
+
|
102
|
+
</div>
|
103
|
+
|
104
|
+
|
105
|
+
<!-- if includes -->
|
106
|
+
|
107
|
+
<div id="section">
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
<div id="attribute-list">
|
114
|
+
<h3 class="section-bar">Attributes</h3>
|
115
|
+
|
116
|
+
<div class="name-list">
|
117
|
+
<table>
|
118
|
+
<tr class="top-aligned-row context-row">
|
119
|
+
<td class="context-item-name">seeds</td>
|
120
|
+
<td class="context-item-value"> [R] </td>
|
121
|
+
<td class="context-item-desc"></td>
|
122
|
+
</tr>
|
123
|
+
</table>
|
124
|
+
</div>
|
125
|
+
</div>
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
<!-- if method_list -->
|
130
|
+
<div id="methods">
|
131
|
+
<h3 class="section-bar">Public Class methods</h3>
|
132
|
+
|
133
|
+
<div id="method-M000018" class="method-detail">
|
134
|
+
<a name="M000018"></a>
|
135
|
+
|
136
|
+
<div class="method-heading">
|
137
|
+
<a href="DAAPv3.src/M000018.html" target="Code" class="method-signature"
|
138
|
+
onclick="popupCode('DAAPv3.src/M000018.html');return false;">
|
139
|
+
<span class="method-name">new</span><span class="method-args">()</span>
|
140
|
+
</a>
|
141
|
+
</div>
|
142
|
+
|
143
|
+
<div class="method-description">
|
144
|
+
</div>
|
145
|
+
</div>
|
146
|
+
|
147
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
148
|
+
|
149
|
+
<div id="method-M000019" class="method-detail">
|
150
|
+
<a name="M000019"></a>
|
151
|
+
|
152
|
+
<div class="method-heading">
|
153
|
+
<a href="DAAPv3.src/M000019.html" target="Code" class="method-signature"
|
154
|
+
onclick="popupCode('DAAPv3.src/M000019.html');return false;">
|
155
|
+
<span class="method-name">validate</span><span class="method-args">(path, select = 2, req_id = nil)</span>
|
156
|
+
</a>
|
157
|
+
</div>
|
158
|
+
|
159
|
+
<div class="method-description">
|
160
|
+
<p>
|
161
|
+
Returns a validation header using a custom MD5 called Digest::M4P
|
162
|
+
</p>
|
163
|
+
</div>
|
164
|
+
</div>
|
165
|
+
|
166
|
+
|
167
|
+
</div>
|
168
|
+
|
169
|
+
|
170
|
+
</div>
|
171
|
+
|
172
|
+
|
173
|
+
<div id="validator-badges">
|
174
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
175
|
+
</div>
|
176
|
+
|
177
|
+
</body>
|
178
|
+
</html>
|