pho 0.2 → 0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +19 -0
- data/Rakefile +6 -4
- data/doc/index.html +6 -0
- data/doc/rdoc/classes/Pho.html +250 -0
- data/doc/rdoc/classes/Pho/Analyzers.html +288 -0
- data/doc/rdoc/classes/Pho/DatatypeProperty.html +209 -0
- data/doc/rdoc/classes/Pho/DatatypeProperty.src/M000034.html +21 -0
- data/doc/rdoc/classes/Pho/DatatypeProperty.src/M000035.html +29 -0
- data/doc/rdoc/classes/Pho/Etags.html +238 -0
- data/doc/rdoc/classes/Pho/Etags.src/M000088.html +23 -0
- data/doc/rdoc/classes/Pho/Etags.src/M000089.html +28 -0
- data/doc/rdoc/classes/Pho/Etags.src/M000090.html +21 -0
- data/doc/rdoc/classes/Pho/Etags.src/M000091.html +18 -0
- data/doc/rdoc/classes/Pho/Etags.src/M000092.html +18 -0
- data/doc/rdoc/classes/Pho/Etags.src/M000093.html +18 -0
- data/doc/rdoc/classes/Pho/Facet.html +119 -0
- data/doc/rdoc/classes/Pho/Facet/Results.html +225 -0
- data/doc/rdoc/classes/Pho/Facet/Results.src/M000001.html +20 -0
- data/doc/rdoc/classes/Pho/Facet/Results.src/M000002.html +27 -0
- data/doc/rdoc/classes/Pho/Facet/Results.src/M000003.html +54 -0
- data/doc/rdoc/classes/Pho/Facet/Term.html +166 -0
- data/doc/rdoc/classes/Pho/Facet/Term.src/M000004.html +20 -0
- data/doc/rdoc/classes/Pho/FieldPredicateMap.html +461 -0
- data/doc/rdoc/classes/Pho/FieldPredicateMap.src/M000005.html +38 -0
- data/doc/rdoc/classes/Pho/FieldPredicateMap.src/M000006.html +28 -0
- data/doc/rdoc/classes/Pho/FieldPredicateMap.src/M000007.html +20 -0
- data/doc/rdoc/classes/Pho/FieldPredicateMap.src/M000008.html +18 -0
- data/doc/rdoc/classes/Pho/FieldPredicateMap.src/M000009.html +23 -0
- data/doc/rdoc/classes/Pho/FieldPredicateMap.src/M000010.html +23 -0
- data/doc/rdoc/classes/Pho/FieldPredicateMap.src/M000011.html +18 -0
- data/doc/rdoc/classes/Pho/FieldPredicateMap.src/M000012.html +18 -0
- data/doc/rdoc/classes/Pho/FieldPredicateMap.src/M000013.html +18 -0
- data/doc/rdoc/classes/Pho/FieldPredicateMap.src/M000014.html +18 -0
- data/doc/rdoc/classes/Pho/FieldPredicateMap.src/M000015.html +18 -0
- data/doc/rdoc/classes/Pho/FieldPredicateMap.src/M000016.html +21 -0
- data/doc/rdoc/classes/Pho/FieldPredicateMap.src/M000017.html +21 -0
- data/doc/rdoc/classes/Pho/FieldPredicateMap.src/M000018.html +38 -0
- data/doc/rdoc/classes/Pho/FieldPredicateMap.src/M000019.html +18 -0
- data/doc/rdoc/classes/Pho/FieldWeighting.html +202 -0
- data/doc/rdoc/classes/Pho/FieldWeighting.src/M000075.html +20 -0
- data/doc/rdoc/classes/Pho/FieldWeighting.src/M000076.html +26 -0
- data/doc/rdoc/classes/Pho/Job.html +147 -0
- data/doc/rdoc/classes/Pho/Job.src/M000074.html +21 -0
- data/doc/rdoc/classes/Pho/Namespaces.html +128 -0
- data/doc/rdoc/classes/Pho/QueryProfile.html +355 -0
- data/doc/rdoc/classes/Pho/QueryProfile.src/M000024.html +39 -0
- data/doc/rdoc/classes/Pho/QueryProfile.src/M000025.html +24 -0
- data/doc/rdoc/classes/Pho/QueryProfile.src/M000026.html +20 -0
- data/doc/rdoc/classes/Pho/QueryProfile.src/M000027.html +18 -0
- data/doc/rdoc/classes/Pho/QueryProfile.src/M000028.html +18 -0
- data/doc/rdoc/classes/Pho/QueryProfile.src/M000029.html +21 -0
- data/doc/rdoc/classes/Pho/QueryProfile.src/M000030.html +18 -0
- data/doc/rdoc/classes/Pho/QueryProfile.src/M000031.html +18 -0
- data/doc/rdoc/classes/Pho/QueryProfile.src/M000032.html +38 -0
- data/doc/rdoc/classes/Pho/QueryProfile.src/M000033.html +18 -0
- data/doc/rdoc/classes/Pho/RDFCollection.html +353 -0
- data/doc/rdoc/classes/Pho/RDFCollection.src/M000077.html +23 -0
- data/doc/rdoc/classes/Pho/RDFCollection.src/M000078.html +22 -0
- data/doc/rdoc/classes/Pho/RDFCollection.src/M000079.html +24 -0
- data/doc/rdoc/classes/Pho/RDFCollection.src/M000080.html +23 -0
- data/doc/rdoc/classes/Pho/RDFCollection.src/M000081.html +18 -0
- data/doc/rdoc/classes/Pho/RDFCollection.src/M000082.html +22 -0
- data/doc/rdoc/classes/Pho/RDFCollection.src/M000083.html +22 -0
- data/doc/rdoc/classes/Pho/RDFCollection.src/M000084.html +26 -0
- data/doc/rdoc/classes/Pho/RDFCollection.src/M000085.html +23 -0
- data/doc/rdoc/classes/Pho/RDFCollection.src/M000086.html +18 -0
- data/doc/rdoc/classes/Pho/RDFCollection.src/M000087.html +18 -0
- data/doc/rdoc/classes/Pho/Snapshot.html +271 -0
- data/doc/rdoc/classes/Pho/Snapshot.src/M000070.html +31 -0
- data/doc/rdoc/classes/Pho/Snapshot.src/M000071.html +21 -0
- data/doc/rdoc/classes/Pho/Snapshot.src/M000072.html +18 -0
- data/doc/rdoc/classes/Pho/Snapshot.src/M000073.html +37 -0
- data/doc/rdoc/classes/Pho/Status.html +245 -0
- data/doc/rdoc/classes/Pho/Status.src/M000020.html +20 -0
- data/doc/rdoc/classes/Pho/Status.src/M000021.html +31 -0
- data/doc/rdoc/classes/Pho/Status.src/M000022.html +18 -0
- data/doc/rdoc/classes/Pho/Status.src/M000023.html +18 -0
- data/doc/rdoc/classes/Pho/Store.html +1055 -0
- data/doc/rdoc/classes/Pho/Store.src/M000036.html +22 -0
- data/doc/rdoc/classes/Pho/Store.src/M000037.html +18 -0
- data/doc/rdoc/classes/Pho/Store.src/M000038.html +25 -0
- data/doc/rdoc/classes/Pho/Store.src/M000039.html +20 -0
- data/doc/rdoc/classes/Pho/Store.src/M000040.html +20 -0
- data/doc/rdoc/classes/Pho/Store.src/M000041.html +28 -0
- data/doc/rdoc/classes/Pho/Store.src/M000042.html +23 -0
- data/doc/rdoc/classes/Pho/Store.src/M000043.html +18 -0
- data/doc/rdoc/classes/Pho/Store.src/M000044.html +18 -0
- data/doc/rdoc/classes/Pho/Store.src/M000045.html +18 -0
- data/doc/rdoc/classes/Pho/Store.src/M000046.html +18 -0
- data/doc/rdoc/classes/Pho/Store.src/M000047.html +23 -0
- data/doc/rdoc/classes/Pho/Store.src/M000048.html +22 -0
- data/doc/rdoc/classes/Pho/Store.src/M000049.html +26 -0
- data/doc/rdoc/classes/Pho/Store.src/M000050.html +24 -0
- data/doc/rdoc/classes/Pho/Store.src/M000051.html +20 -0
- data/doc/rdoc/classes/Pho/Store.src/M000052.html +20 -0
- data/doc/rdoc/classes/Pho/Store.src/M000053.html +25 -0
- data/doc/rdoc/classes/Pho/Store.src/M000054.html +20 -0
- data/doc/rdoc/classes/Pho/Store.src/M000055.html +30 -0
- data/doc/rdoc/classes/Pho/Store.src/M000056.html +21 -0
- data/doc/rdoc/classes/Pho/Store.src/M000057.html +23 -0
- data/doc/rdoc/classes/Pho/Store.src/M000058.html +28 -0
- data/doc/rdoc/classes/Pho/Store.src/M000059.html +18 -0
- data/doc/rdoc/classes/Pho/Store.src/M000060.html +18 -0
- data/doc/rdoc/classes/Pho/Store.src/M000061.html +18 -0
- data/doc/rdoc/classes/Pho/Store.src/M000062.html +31 -0
- data/doc/rdoc/classes/Pho/Store.src/M000063.html +21 -0
- data/doc/rdoc/classes/Pho/Store.src/M000064.html +20 -0
- data/doc/rdoc/classes/Pho/Store.src/M000065.html +20 -0
- data/doc/rdoc/classes/Pho/Store.src/M000066.html +20 -0
- data/doc/rdoc/classes/Pho/Store.src/M000067.html +20 -0
- data/doc/rdoc/classes/Pho/Store.src/M000068.html +20 -0
- data/doc/rdoc/classes/Pho/Store.src/M000069.html +20 -0
- data/doc/rdoc/created.rid +1 -1
- data/doc/rdoc/files/CHANGES.html +140 -0
- data/doc/rdoc/files/README.html +9 -8
- data/doc/rdoc/files/lib/pho/etags_rb.html +108 -0
- data/doc/rdoc/files/lib/pho/facet_rb.html +101 -0
- data/doc/rdoc/files/lib/pho/field_predicate_map_rb.html +101 -0
- data/doc/rdoc/files/lib/pho/job_rb.html +101 -0
- data/doc/rdoc/files/lib/pho/query_profile_rb.html +101 -0
- data/doc/rdoc/files/lib/pho/rdf_collection_rb.html +101 -0
- data/doc/rdoc/files/lib/pho/snapshot_rb.html +108 -0
- data/doc/rdoc/files/lib/pho/status_rb.html +101 -0
- data/doc/rdoc/files/lib/pho/store_rb.html +101 -0
- data/doc/rdoc/files/lib/pho_rb.html +120 -0
- data/doc/rdoc/fr_class_index.html +16 -0
- data/doc/rdoc/fr_file_index.html +11 -0
- data/doc/rdoc/fr_method_index.html +93 -0
- data/examples/status.rb +3 -3
- data/lib/pho.rb +11 -2
- data/lib/pho/facet.rb +101 -0
- data/lib/pho/field_predicate_map.rb +4 -4
- data/lib/pho/query_profile.rb +170 -0
- data/lib/pho/status.rb +65 -0
- data/lib/pho/store.rb +26 -13
- data/tests/tc_facet.rb +91 -0
- data/tests/tc_query_profile.rb +196 -0
- data/tests/tc_status.rb +56 -0
- data/tests/ts_pho.rb +3 -0
- metadata +148 -3
@@ -0,0 +1,22 @@
|
|
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 (Pho::Store)</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/pho/store.rb, line 48</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">storeuri</span>, <span class="ruby-identifier">username</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">password</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">client</span> = <span class="ruby-constant">HTTPClient</span>.<span class="ruby-identifier">new</span>() )
|
15
|
+
<span class="ruby-ivar">@storeuri</span> = <span class="ruby-identifier">storeuri</span>.<span class="ruby-identifier">chomp</span>(<span class="ruby-value str">"/"</span>)
|
16
|
+
<span class="ruby-ivar">@username</span> = <span class="ruby-identifier">username</span>
|
17
|
+
<span class="ruby-ivar">@password</span> = <span class="ruby-identifier">password</span>
|
18
|
+
<span class="ruby-ivar">@client</span> = <span class="ruby-identifier">client</span>
|
19
|
+
<span class="ruby-identifier">set_credentials</span>(<span class="ruby-identifier">username</span>, <span class="ruby-identifier">password</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">username</span> <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">password</span>
|
20
|
+
<span class="ruby-keyword kw">end</span></pre>
|
21
|
+
</body>
|
22
|
+
</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>set_credentials (Pho::Store)</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/pho/store.rb, line 60</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">set_credentials</span>(<span class="ruby-identifier">username</span>, <span class="ruby-identifier">password</span>)
|
15
|
+
<span class="ruby-ivar">@client</span>.<span class="ruby-identifier">set_auth</span>(<span class="ruby-ivar">@storeuri</span>, <span class="ruby-identifier">username</span>, <span class="ruby-identifier">password</span>)
|
16
|
+
<span class="ruby-keyword kw">end</span></pre>
|
17
|
+
</body>
|
18
|
+
</html>
|
@@ -0,0 +1,25 @@
|
|
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>build_uri (Pho::Store)</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/pho/store.rb, line 66</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">build_uri</span>(<span class="ruby-identifier">uri</span>)
|
15
|
+
<span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">uri</span>.<span class="ruby-identifier">start_with?</span>(<span class="ruby-ivar">@storeuri</span>))
|
16
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">uri</span>
|
17
|
+
<span class="ruby-keyword kw">end</span>
|
18
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">start_with?</span>(<span class="ruby-value str">"/"</span>)
|
19
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@storeuri</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">uri</span>
|
20
|
+
<span class="ruby-keyword kw">else</span>
|
21
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@storeuri</span> <span class="ruby-operator">+</span> <span class="ruby-value str">"/"</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">uri</span>
|
22
|
+
<span class="ruby-keyword kw">end</span>
|
23
|
+
<span class="ruby-keyword kw">end</span></pre>
|
24
|
+
</body>
|
25
|
+
</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>store_data (Pho::Store)</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/pho/store.rb, line 83</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">store_data</span>(<span class="ruby-identifier">data</span>)
|
15
|
+
<span class="ruby-identifier">u</span> = <span class="ruby-identifier">build_uri</span>(<span class="ruby-value str">"/meta"</span>)
|
16
|
+
<span class="ruby-identifier">response</span> = <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">post</span>(<span class="ruby-identifier">u</span>, <span class="ruby-identifier">data</span>, <span class="ruby-constant">RDF_XML</span> )
|
17
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">response</span>
|
18
|
+
<span class="ruby-keyword kw">end</span></pre>
|
19
|
+
</body>
|
20
|
+
</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>store_file (Pho::Store)</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/pho/store.rb, line 92</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">store_file</span>(<span class="ruby-identifier">file</span>)
|
15
|
+
<span class="ruby-identifier">data</span> = <span class="ruby-identifier">file</span>.<span class="ruby-identifier">read</span>()
|
16
|
+
<span class="ruby-identifier">file</span>.<span class="ruby-identifier">close</span>()
|
17
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">store_data</span>(<span class="ruby-identifier">data</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>store_url (Pho::Store)</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/pho/store.rb, line 105</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">store_url</span>(<span class="ruby-identifier">u</span>, <span class="ruby-identifier">parameters</span>=<span class="ruby-keyword kw">nil</span>)
|
15
|
+
|
16
|
+
<span class="ruby-identifier">headers</span> = <span class="ruby-constant">ACCEPT_RDF</span>.<span class="ruby-identifier">clone</span>()
|
17
|
+
<span class="ruby-identifier">dataresp</span> = <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">get</span>(<span class="ruby-identifier">u</span>, <span class="ruby-identifier">parameters</span>, <span class="ruby-identifier">headers</span> )
|
18
|
+
|
19
|
+
<span class="ruby-comment cmt">#TODO make this more robust</span>
|
20
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">dataresp</span>.<span class="ruby-identifier">status</span> <span class="ruby-operator">!=</span> <span class="ruby-value">200</span>
|
21
|
+
<span class="ruby-identifier">throw</span>
|
22
|
+
<span class="ruby-keyword kw">end</span>
|
23
|
+
|
24
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">store_data</span>(<span class="ruby-identifier">dataresp</span>.<span class="ruby-identifier">content</span>)
|
25
|
+
|
26
|
+
<span class="ruby-keyword kw">end</span></pre>
|
27
|
+
</body>
|
28
|
+
</html>
|
@@ -0,0 +1,23 @@
|
|
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>describe (Pho::Store)</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/pho/store.rb, line 131</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">describe</span>(<span class="ruby-identifier">uri</span>, <span class="ruby-identifier">format</span>=<span class="ruby-value str">"application/rdf+xml"</span>, <span class="ruby-identifier">etags</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">if_match</span>=<span class="ruby-keyword kw">false</span>)
|
15
|
+
<span class="ruby-identifier">u</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">build_uri</span>(<span class="ruby-value str">"/meta"</span>)
|
16
|
+
<span class="ruby-identifier">headers</span> = {<span class="ruby-value str">"Accept"</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">format</span>}
|
17
|
+
<span class="ruby-identifier">headers</span> = <span class="ruby-identifier">configure_headers_for_conditional_get</span>(<span class="ruby-node">"#{u}?about=#{uri}"</span>, <span class="ruby-identifier">headers</span>, <span class="ruby-identifier">etags</span>, <span class="ruby-identifier">if_match</span>)
|
18
|
+
<span class="ruby-identifier">response</span> = <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">get</span>(<span class="ruby-identifier">u</span>, {<span class="ruby-value str">"about"</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">uri</span>}, <span class="ruby-identifier">headers</span> )
|
19
|
+
<span class="ruby-identifier">record_etags</span>(<span class="ruby-node">"#{u}?about=#{uri}"</span>, <span class="ruby-identifier">etags</span>, <span class="ruby-identifier">response</span>)
|
20
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">response</span>
|
21
|
+
<span class="ruby-keyword kw">end</span></pre>
|
22
|
+
</body>
|
23
|
+
</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>sparql_describe (Pho::Store)</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/pho/store.rb, line 148</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sparql_describe</span>(<span class="ruby-identifier">query</span>, <span class="ruby-identifier">format</span>=<span class="ruby-value str">"application/rdf+xml"</span>)
|
15
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">sparql</span>(<span class="ruby-identifier">query</span>, <span class="ruby-identifier">format</span>)
|
16
|
+
<span class="ruby-keyword kw">end</span></pre>
|
17
|
+
</body>
|
18
|
+
</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>sparql_construct (Pho::Store)</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/pho/store.rb, line 156</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sparql_construct</span>(<span class="ruby-identifier">query</span>, <span class="ruby-identifier">format</span>=<span class="ruby-value str">"application/rdf+xml"</span>)
|
15
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">sparql</span>(<span class="ruby-identifier">query</span>, <span class="ruby-identifier">format</span>)
|
16
|
+
<span class="ruby-keyword kw">end</span></pre>
|
17
|
+
</body>
|
18
|
+
</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>sparql_ask (Pho::Store)</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/pho/store.rb, line 164</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sparql_ask</span>(<span class="ruby-identifier">query</span>, <span class="ruby-identifier">format</span>=<span class="ruby-value str">"application/sparql-results+xml"</span>)
|
15
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">sparql</span>(<span class="ruby-identifier">query</span>, <span class="ruby-identifier">format</span>)
|
16
|
+
<span class="ruby-keyword kw">end</span></pre>
|
17
|
+
</body>
|
18
|
+
</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>sparql_select (Pho::Store)</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/pho/store.rb, line 172</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sparql_select</span>(<span class="ruby-identifier">query</span>, <span class="ruby-identifier">format</span>=<span class="ruby-value str">"application/sparql-results+xml"</span>)
|
15
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">sparql</span>(<span class="ruby-identifier">query</span>, <span class="ruby-identifier">format</span>)
|
16
|
+
<span class="ruby-keyword kw">end</span></pre>
|
17
|
+
</body>
|
18
|
+
</html>
|
@@ -0,0 +1,23 @@
|
|
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>sparql (Pho::Store)</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/pho/store.rb, line 180</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sparql</span>(<span class="ruby-identifier">query</span>, <span class="ruby-identifier">format</span>)
|
15
|
+
<span class="ruby-identifier">u</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">build_uri</span>(<span class="ruby-value str">"/services/sparql"</span>)
|
16
|
+
<span class="ruby-identifier">params</span> = {}
|
17
|
+
<span class="ruby-identifier">params</span>[<span class="ruby-value str">"query"</span>] = <span class="ruby-identifier">query</span>
|
18
|
+
<span class="ruby-identifier">headers</span> = {}
|
19
|
+
<span class="ruby-identifier">headers</span>[<span class="ruby-value str">"Accept"</span>] = <span class="ruby-identifier">format</span>
|
20
|
+
<span class="ruby-identifier">response</span> = <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">get</span>(<span class="ruby-identifier">u</span>, <span class="ruby-identifier">params</span>, <span class="ruby-identifier">headers</span>)
|
21
|
+
<span class="ruby-keyword kw">end</span></pre>
|
22
|
+
</body>
|
23
|
+
</html>
|
@@ -0,0 +1,22 @@
|
|
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>search (Pho::Store)</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/pho/store.rb, line 204</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">search</span>(<span class="ruby-identifier">query</span>, <span class="ruby-identifier">params</span>=<span class="ruby-keyword kw">nil</span>)
|
15
|
+
<span class="ruby-identifier">u</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">build_uri</span>(<span class="ruby-value str">"/items"</span>)
|
16
|
+
<span class="ruby-identifier">search_params</span> = <span class="ruby-identifier">get_search_params</span>(<span class="ruby-identifier">u</span>, <span class="ruby-identifier">query</span>, <span class="ruby-identifier">params</span>)
|
17
|
+
<span class="ruby-identifier">response</span> = <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">get</span>(<span class="ruby-identifier">u</span>, <span class="ruby-identifier">search_params</span>, <span class="ruby-keyword kw">nil</span>)
|
18
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">response</span>
|
19
|
+
|
20
|
+
<span class="ruby-keyword kw">end</span></pre>
|
21
|
+
</body>
|
22
|
+
</html>
|
@@ -0,0 +1,26 @@
|
|
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>facet (Pho::Store)</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/pho/store.rb, line 221</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">facet</span>(<span class="ruby-identifier">query</span>, <span class="ruby-identifier">facets</span>, <span class="ruby-identifier">params</span>=<span class="ruby-keyword kw">nil</span>)
|
15
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">facets</span> <span class="ruby-operator">==</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">facets</span>.<span class="ruby-identifier">empty?</span>
|
16
|
+
<span class="ruby-comment cmt">#todo</span>
|
17
|
+
<span class="ruby-identifier">throw</span>
|
18
|
+
<span class="ruby-keyword kw">end</span>
|
19
|
+
<span class="ruby-identifier">u</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">build_uri</span>(<span class="ruby-value str">"/services/facet"</span>)
|
20
|
+
<span class="ruby-identifier">search_params</span> = <span class="ruby-identifier">get_search_params</span>(<span class="ruby-identifier">u</span>, <span class="ruby-identifier">query</span>, <span class="ruby-identifier">params</span>)
|
21
|
+
<span class="ruby-identifier">search_params</span>[<span class="ruby-value str">"fields"</span>] = <span class="ruby-identifier">facets</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">","</span>)
|
22
|
+
<span class="ruby-identifier">response</span> = <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">get</span>(<span class="ruby-identifier">u</span>, <span class="ruby-identifier">search_params</span>, <span class="ruby-keyword kw">nil</span>)
|
23
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">response</span>
|
24
|
+
<span class="ruby-keyword kw">end</span></pre>
|
25
|
+
</body>
|
26
|
+
</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>get_search_params (Pho::Store)</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/pho/store.rb, line 233</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_search_params</span>(<span class="ruby-identifier">u</span>, <span class="ruby-identifier">query</span>, <span class="ruby-identifier">params</span>)
|
15
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">params</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
|
16
|
+
<span class="ruby-identifier">search_params</span> = <span class="ruby-identifier">params</span>.<span class="ruby-identifier">clone</span>()
|
17
|
+
<span class="ruby-keyword kw">else</span>
|
18
|
+
<span class="ruby-identifier">search_params</span> = <span class="ruby-constant">Hash</span>.<span class="ruby-identifier">new</span>
|
19
|
+
<span class="ruby-keyword kw">end</span>
|
20
|
+
<span class="ruby-identifier">search_params</span>[<span class="ruby-value str">"query"</span>] = <span class="ruby-identifier">query</span>
|
21
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">search_params</span>
|
22
|
+
<span class="ruby-keyword kw">end</span></pre>
|
23
|
+
</body>
|
24
|
+
</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>augment_uri (Pho::Store)</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/pho/store.rb, line 246</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">augment_uri</span>(<span class="ruby-identifier">uri</span>)
|
15
|
+
<span class="ruby-identifier">u</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">build_uri</span>(<span class="ruby-value str">"/services/augment"</span>)
|
16
|
+
<span class="ruby-identifier">response</span> = <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">get</span>(<span class="ruby-identifier">u</span>, {<span class="ruby-value str">"data-uri"</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">uri</span>}, <span class="ruby-keyword kw">nil</span>)
|
17
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">response</span>
|
18
|
+
<span class="ruby-keyword kw">end</span></pre>
|
19
|
+
</body>
|
20
|
+
</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>augment (Pho::Store)</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/pho/store.rb, line 255</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">augment</span>(<span class="ruby-identifier">data</span>)
|
15
|
+
<span class="ruby-identifier">u</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">build_uri</span>(<span class="ruby-value str">"/services/augment"</span>)
|
16
|
+
<span class="ruby-identifier">response</span> = <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">post</span>(<span class="ruby-identifier">u</span>, <span class="ruby-identifier">data</span>, <span class="ruby-keyword kw">nil</span>)
|
17
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">response</span>
|
18
|
+
<span class="ruby-keyword kw">end</span></pre>
|
19
|
+
</body>
|
20
|
+
</html>
|
@@ -0,0 +1,25 @@
|
|
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>configure_headers_for_conditional_get (Pho::Store)</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/pho/store.rb, line 262</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">configure_headers_for_conditional_get</span>(<span class="ruby-identifier">u</span>, <span class="ruby-identifier">headers</span>, <span class="ruby-identifier">etags</span>, <span class="ruby-identifier">if_match</span>)
|
15
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">etags</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">etags</span>.<span class="ruby-identifier">has_tag?</span>(<span class="ruby-identifier">u</span>)
|
16
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">if_match</span>
|
17
|
+
<span class="ruby-identifier">headers</span>[<span class="ruby-value str">"If-Match"</span>] = <span class="ruby-identifier">etags</span>.<span class="ruby-identifier">get</span>(<span class="ruby-identifier">u</span>)
|
18
|
+
<span class="ruby-keyword kw">else</span>
|
19
|
+
<span class="ruby-identifier">headers</span>[<span class="ruby-value str">"If-None-Match"</span>] = <span class="ruby-identifier">etags</span>.<span class="ruby-identifier">get</span>(<span class="ruby-identifier">u</span>)
|
20
|
+
<span class="ruby-keyword kw">end</span>
|
21
|
+
<span class="ruby-keyword kw">end</span>
|
22
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">headers</span>
|
23
|
+
<span class="ruby-keyword kw">end</span></pre>
|
24
|
+
</body>
|
25
|
+
</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>record_etags (Pho::Store)</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/pho/store.rb, line 273</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">record_etags</span>(<span class="ruby-identifier">u</span>, <span class="ruby-identifier">etags</span>, <span class="ruby-identifier">response</span>)
|
15
|
+
<span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">etags</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">response</span>.<span class="ruby-identifier">status</span> = <span class="ruby-value">200</span>)
|
16
|
+
<span class="ruby-identifier">etags</span>.<span class="ruby-identifier">add_from_response</span>(<span class="ruby-identifier">u</span>, <span class="ruby-identifier">response</span>)
|
17
|
+
<span class="ruby-keyword kw">end</span>
|
18
|
+
<span class="ruby-keyword kw">end</span></pre>
|
19
|
+
</body>
|
20
|
+
</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>upload_item (Pho::Store)</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/pho/store.rb, line 292</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">upload_item</span>(<span class="ruby-identifier">f</span>, <span class="ruby-identifier">mimetype</span>, <span class="ruby-identifier">uri</span>=<span class="ruby-keyword kw">nil</span>)
|
15
|
+
<span class="ruby-identifier">data</span> = <span class="ruby-identifier">f</span>.<span class="ruby-identifier">read</span>()
|
16
|
+
<span class="ruby-identifier">f</span>.<span class="ruby-identifier">close</span>()
|
17
|
+
<span class="ruby-identifier">headers</span> = {<span class="ruby-value str">"Content-Type"</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">mimetype</span>}
|
18
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">uri</span> <span class="ruby-operator">==</span> <span class="ruby-keyword kw">nil</span>
|
19
|
+
<span class="ruby-identifier">u</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">build_uri</span>(<span class="ruby-value str">"/items"</span>)
|
20
|
+
<span class="ruby-identifier">response</span> = <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">post</span>(<span class="ruby-identifier">u</span>, <span class="ruby-identifier">data</span>, <span class="ruby-identifier">headers</span>)
|
21
|
+
<span class="ruby-keyword kw">else</span>
|
22
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">uri</span>.<span class="ruby-identifier">start_with?</span>(<span class="ruby-ivar">@storeuri</span>)
|
23
|
+
<span class="ruby-identifier">uri</span> = <span class="ruby-identifier">build_uri</span>(<span class="ruby-identifier">uri</span>)
|
24
|
+
<span class="ruby-keyword kw">end</span>
|
25
|
+
<span class="ruby-identifier">response</span> = <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">put</span>(<span class="ruby-identifier">uri</span>, <span class="ruby-identifier">data</span>, <span class="ruby-identifier">headers</span>)
|
26
|
+
<span class="ruby-keyword kw">end</span>
|
27
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">response</span>
|
28
|
+
<span class="ruby-keyword kw">end</span></pre>
|
29
|
+
</body>
|
30
|
+
</html>
|