pho 0.3 → 0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +9 -0
- data/Rakefile +2 -1
- data/bin/talis_store +263 -0
- data/doc/rdoc/classes/Pho.html +3 -21
- data/doc/rdoc/classes/Pho/Analyzers.html +22 -0
- data/doc/rdoc/classes/Pho/DatatypeProperty.html +42 -10
- data/doc/rdoc/classes/Pho/Etags.html +102 -30
- data/doc/rdoc/classes/Pho/Facet/Results.html +81 -7
- data/doc/rdoc/classes/Pho/Facet/Term.html +13 -2
- data/doc/rdoc/classes/Pho/FieldPredicateMap.html +233 -30
- data/doc/rdoc/classes/Pho/FieldWeighting.html +38 -10
- data/doc/rdoc/classes/Pho/Job.html +488 -9
- data/doc/rdoc/classes/Pho/JobUpdate.html +141 -0
- data/doc/rdoc/classes/Pho/Jobs.html +538 -0
- data/doc/rdoc/classes/Pho/Namespaces.html +33 -2
- data/doc/rdoc/classes/Pho/QueryProfile.html +162 -20
- data/doc/rdoc/classes/Pho/RDFCollection.html +200 -60
- data/doc/rdoc/classes/Pho/Snapshot.html +162 -36
- data/doc/rdoc/classes/Pho/Status.html +59 -8
- data/doc/rdoc/classes/Pho/Store.html +589 -253
- data/doc/rdoc/created.rid +1 -1
- data/doc/rdoc/files/CHANGES.html +24 -1
- data/doc/rdoc/files/lib/pho/field_predicate_map_rb.html +1 -1
- data/doc/rdoc/files/lib/pho/job_rb.html +1 -1
- data/doc/rdoc/files/lib/pho/snapshot_rb.html +2 -1
- data/doc/rdoc/files/lib/pho/status_rb.html +1 -1
- data/doc/rdoc/files/lib/pho/store_rb.html +1 -1
- data/doc/rdoc/files/lib/pho_rb.html +2 -1
- data/doc/rdoc/fr_class_index.html +2 -0
- data/doc/rdoc/fr_method_index.html +85 -68
- data/lib/pho.rb +18 -10
- data/lib/pho/field_predicate_map.rb +6 -1
- data/lib/pho/job.rb +326 -6
- data/lib/pho/snapshot.rb +46 -19
- data/lib/pho/store.rb +22 -56
- data/tests/tc_job.rb +262 -0
- data/tests/tc_jobcontrol.rb +159 -12
- data/tests/tc_snapshots.rb +57 -28
- data/tests/ts_pho.rb +1 -0
- metadata +9 -110
- data/doc/rdoc/classes/Pho/DatatypeProperty.src/M000034.html +0 -21
- data/doc/rdoc/classes/Pho/DatatypeProperty.src/M000035.html +0 -29
- data/doc/rdoc/classes/Pho/Etags.src/M000088.html +0 -23
- data/doc/rdoc/classes/Pho/Etags.src/M000089.html +0 -28
- data/doc/rdoc/classes/Pho/Etags.src/M000090.html +0 -21
- data/doc/rdoc/classes/Pho/Etags.src/M000091.html +0 -18
- data/doc/rdoc/classes/Pho/Etags.src/M000092.html +0 -18
- data/doc/rdoc/classes/Pho/Etags.src/M000093.html +0 -18
- data/doc/rdoc/classes/Pho/Facet/Results.src/M000001.html +0 -20
- data/doc/rdoc/classes/Pho/Facet/Results.src/M000002.html +0 -27
- data/doc/rdoc/classes/Pho/Facet/Results.src/M000003.html +0 -54
- data/doc/rdoc/classes/Pho/Facet/Term.src/M000004.html +0 -20
- data/doc/rdoc/classes/Pho/FieldPredicateMap.src/M000005.html +0 -38
- data/doc/rdoc/classes/Pho/FieldPredicateMap.src/M000006.html +0 -28
- data/doc/rdoc/classes/Pho/FieldPredicateMap.src/M000007.html +0 -20
- data/doc/rdoc/classes/Pho/FieldPredicateMap.src/M000008.html +0 -18
- data/doc/rdoc/classes/Pho/FieldPredicateMap.src/M000009.html +0 -23
- data/doc/rdoc/classes/Pho/FieldPredicateMap.src/M000010.html +0 -23
- data/doc/rdoc/classes/Pho/FieldPredicateMap.src/M000011.html +0 -18
- data/doc/rdoc/classes/Pho/FieldPredicateMap.src/M000012.html +0 -18
- data/doc/rdoc/classes/Pho/FieldPredicateMap.src/M000013.html +0 -18
- data/doc/rdoc/classes/Pho/FieldPredicateMap.src/M000014.html +0 -18
- data/doc/rdoc/classes/Pho/FieldPredicateMap.src/M000015.html +0 -18
- data/doc/rdoc/classes/Pho/FieldPredicateMap.src/M000016.html +0 -21
- data/doc/rdoc/classes/Pho/FieldPredicateMap.src/M000017.html +0 -21
- data/doc/rdoc/classes/Pho/FieldPredicateMap.src/M000018.html +0 -38
- data/doc/rdoc/classes/Pho/FieldPredicateMap.src/M000019.html +0 -18
- data/doc/rdoc/classes/Pho/FieldWeighting.src/M000075.html +0 -20
- data/doc/rdoc/classes/Pho/FieldWeighting.src/M000076.html +0 -26
- data/doc/rdoc/classes/Pho/Job.src/M000074.html +0 -21
- data/doc/rdoc/classes/Pho/QueryProfile.src/M000024.html +0 -39
- data/doc/rdoc/classes/Pho/QueryProfile.src/M000025.html +0 -24
- data/doc/rdoc/classes/Pho/QueryProfile.src/M000026.html +0 -20
- data/doc/rdoc/classes/Pho/QueryProfile.src/M000027.html +0 -18
- data/doc/rdoc/classes/Pho/QueryProfile.src/M000028.html +0 -18
- data/doc/rdoc/classes/Pho/QueryProfile.src/M000029.html +0 -21
- data/doc/rdoc/classes/Pho/QueryProfile.src/M000030.html +0 -18
- data/doc/rdoc/classes/Pho/QueryProfile.src/M000031.html +0 -18
- data/doc/rdoc/classes/Pho/QueryProfile.src/M000032.html +0 -38
- data/doc/rdoc/classes/Pho/QueryProfile.src/M000033.html +0 -18
- data/doc/rdoc/classes/Pho/RDFCollection.src/M000077.html +0 -23
- data/doc/rdoc/classes/Pho/RDFCollection.src/M000078.html +0 -22
- data/doc/rdoc/classes/Pho/RDFCollection.src/M000079.html +0 -24
- data/doc/rdoc/classes/Pho/RDFCollection.src/M000080.html +0 -23
- data/doc/rdoc/classes/Pho/RDFCollection.src/M000081.html +0 -18
- data/doc/rdoc/classes/Pho/RDFCollection.src/M000082.html +0 -22
- data/doc/rdoc/classes/Pho/RDFCollection.src/M000083.html +0 -22
- data/doc/rdoc/classes/Pho/RDFCollection.src/M000084.html +0 -26
- data/doc/rdoc/classes/Pho/RDFCollection.src/M000085.html +0 -23
- data/doc/rdoc/classes/Pho/RDFCollection.src/M000086.html +0 -18
- data/doc/rdoc/classes/Pho/RDFCollection.src/M000087.html +0 -18
- data/doc/rdoc/classes/Pho/Snapshot.src/M000070.html +0 -31
- data/doc/rdoc/classes/Pho/Snapshot.src/M000071.html +0 -21
- data/doc/rdoc/classes/Pho/Snapshot.src/M000072.html +0 -18
- data/doc/rdoc/classes/Pho/Snapshot.src/M000073.html +0 -37
- data/doc/rdoc/classes/Pho/Status.src/M000020.html +0 -20
- data/doc/rdoc/classes/Pho/Status.src/M000021.html +0 -31
- data/doc/rdoc/classes/Pho/Status.src/M000022.html +0 -18
- data/doc/rdoc/classes/Pho/Status.src/M000023.html +0 -18
- data/doc/rdoc/classes/Pho/Store.src/M000036.html +0 -22
- data/doc/rdoc/classes/Pho/Store.src/M000037.html +0 -18
- data/doc/rdoc/classes/Pho/Store.src/M000038.html +0 -25
- data/doc/rdoc/classes/Pho/Store.src/M000039.html +0 -20
- data/doc/rdoc/classes/Pho/Store.src/M000040.html +0 -20
- data/doc/rdoc/classes/Pho/Store.src/M000041.html +0 -28
- data/doc/rdoc/classes/Pho/Store.src/M000042.html +0 -23
- data/doc/rdoc/classes/Pho/Store.src/M000043.html +0 -18
- data/doc/rdoc/classes/Pho/Store.src/M000044.html +0 -18
- data/doc/rdoc/classes/Pho/Store.src/M000045.html +0 -18
- data/doc/rdoc/classes/Pho/Store.src/M000046.html +0 -18
- data/doc/rdoc/classes/Pho/Store.src/M000047.html +0 -23
- data/doc/rdoc/classes/Pho/Store.src/M000048.html +0 -22
- data/doc/rdoc/classes/Pho/Store.src/M000049.html +0 -26
- data/doc/rdoc/classes/Pho/Store.src/M000050.html +0 -24
- data/doc/rdoc/classes/Pho/Store.src/M000051.html +0 -20
- data/doc/rdoc/classes/Pho/Store.src/M000052.html +0 -20
- data/doc/rdoc/classes/Pho/Store.src/M000053.html +0 -25
- data/doc/rdoc/classes/Pho/Store.src/M000054.html +0 -20
- data/doc/rdoc/classes/Pho/Store.src/M000055.html +0 -30
- data/doc/rdoc/classes/Pho/Store.src/M000056.html +0 -21
- data/doc/rdoc/classes/Pho/Store.src/M000057.html +0 -23
- data/doc/rdoc/classes/Pho/Store.src/M000058.html +0 -28
- data/doc/rdoc/classes/Pho/Store.src/M000059.html +0 -18
- data/doc/rdoc/classes/Pho/Store.src/M000060.html +0 -18
- data/doc/rdoc/classes/Pho/Store.src/M000061.html +0 -18
- data/doc/rdoc/classes/Pho/Store.src/M000062.html +0 -31
- data/doc/rdoc/classes/Pho/Store.src/M000063.html +0 -21
- data/doc/rdoc/classes/Pho/Store.src/M000064.html +0 -20
- data/doc/rdoc/classes/Pho/Store.src/M000065.html +0 -20
- data/doc/rdoc/classes/Pho/Store.src/M000066.html +0 -20
- data/doc/rdoc/classes/Pho/Store.src/M000067.html +0 -20
- data/doc/rdoc/classes/Pho/Store.src/M000068.html +0 -20
- data/doc/rdoc/classes/Pho/Store.src/M000069.html +0 -20
@@ -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>remove (Pho::QueryProfile)</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/query_profile.rb, line 118</span>
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">remove</span>(<span class="ruby-identifier">fw</span>)
|
15
|
-
<span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@field_weights</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">fw</span>)
|
16
|
-
<span class="ruby-keyword kw">end</span></pre>
|
17
|
-
</body>
|
18
|
-
</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>mapped_name? (Pho::QueryProfile)</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/query_profile.rb, line 123</span>
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">mapped_name?</span>(<span class="ruby-identifier">name</span>)
|
15
|
-
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">get_by_name</span>(<span class="ruby-identifier">name</span>) <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
|
16
|
-
<span class="ruby-keyword kw">end</span></pre>
|
17
|
-
</body>
|
18
|
-
</html>
|
@@ -1,38 +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>to_rdf (Pho::QueryProfile)</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/query_profile.rb, line 128</span>
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_rdf</span>
|
15
|
-
<span class="ruby-identifier">rdf</span> = <span class="ruby-node">"<rdf:RDF xmlns:frm=\"#{Pho::Namespaces::FRAME}\" "</span>
|
16
|
-
<span class="ruby-identifier">rdf</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" "</span>
|
17
|
-
<span class="ruby-identifier">rdf</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">" xmlns:rdfs=\"http://www.w3.org/2000/01/rdf-schema#\" "</span>
|
18
|
-
<span class="ruby-identifier">rdf</span> <span class="ruby-operator"><<</span> <span class="ruby-node">" xmlns:bf=\"#{Pho::Namespaces::CONFIG}\" > "</span>
|
19
|
-
|
20
|
-
<span class="ruby-identifier">rdf</span> <span class="ruby-operator"><<</span> <span class="ruby-node">" <rdf:Description rdf:about=\"#{@uri}\"> "</span>
|
21
|
-
|
22
|
-
<span class="ruby-identifier">rdf</span> <span class="ruby-operator"><<</span> <span class="ruby-node">" <rdf:type rdf:resource=\"#{Pho::Namespaces::CONFIG}QueryProfile\"/> "</span>
|
23
|
-
<span class="ruby-identifier">rdf</span> <span class="ruby-operator"><<</span> <span class="ruby-node">" <rdfs:label>#{@label}</rdfs:label> "</span>
|
24
|
-
|
25
|
-
<span class="ruby-ivar">@field_weights</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">property</span><span class="ruby-operator">|</span>
|
26
|
-
<span class="ruby-identifier">rdf</span> <span class="ruby-operator"><<</span> <span class="ruby-node">" <frm:fieldWeight rdf:resource=\"#{property.uri}\"/> "</span>
|
27
|
-
<span class="ruby-keyword kw">end</span>
|
28
|
-
|
29
|
-
<span class="ruby-identifier">rdf</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">" </rdf:Description>"</span>
|
30
|
-
|
31
|
-
<span class="ruby-ivar">@field_weights</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">property</span><span class="ruby-operator">|</span>
|
32
|
-
<span class="ruby-identifier">rdf</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">property</span>.<span class="ruby-identifier">to_rdf</span>(<span class="ruby-keyword kw">false</span>)
|
33
|
-
<span class="ruby-keyword kw">end</span>
|
34
|
-
|
35
|
-
<span class="ruby-identifier">rdf</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"</rdf:RDF>"</span>
|
36
|
-
<span class="ruby-keyword kw">end</span></pre>
|
37
|
-
</body>
|
38
|
-
</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>upload (Pho::QueryProfile)</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/query_profile.rb, line 153</span>
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">upload</span>(<span class="ruby-identifier">store</span>)
|
15
|
-
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">store</span>.<span class="ruby-identifier">put_query_profile</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">to_rdf</span>)
|
16
|
-
<span class="ruby-keyword kw">end</span></pre>
|
17
|
-
</body>
|
18
|
-
</html>
|
@@ -1,23 +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 (Pho::RDFCollection)</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/rdf_collection.rb, line 16</span>
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">store</span>, <span class="ruby-identifier">dir</span>, <span class="ruby-identifier">rdf_suffix</span>=<span class="ruby-constant">RDF</span>, <span class="ruby-identifier">ok_suffix</span>=<span class="ruby-constant">OK</span>, <span class="ruby-identifier">fail_suffix</span>=<span class="ruby-constant">FAIL</span>, <span class="ruby-identifier">sleep</span>=<span class="ruby-value">1</span>)
|
15
|
-
<span class="ruby-ivar">@store</span> = <span class="ruby-identifier">store</span>
|
16
|
-
<span class="ruby-ivar">@dir</span> = <span class="ruby-identifier">dir</span>
|
17
|
-
<span class="ruby-ivar">@sleep</span> = <span class="ruby-identifier">sleep</span>
|
18
|
-
<span class="ruby-ivar">@rdf_suffix</span> = <span class="ruby-identifier">rdf_suffix</span>
|
19
|
-
<span class="ruby-ivar">@ok_suffix</span> = <span class="ruby-identifier">ok_suffix</span>
|
20
|
-
<span class="ruby-ivar">@fail_suffix</span> = <span class="ruby-identifier">fail_suffix</span>
|
21
|
-
<span class="ruby-keyword kw">end</span></pre>
|
22
|
-
</body>
|
23
|
-
</html>
|
@@ -1,22 +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>store (Pho::RDFCollection)</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/rdf_collection.rb, line 26</span>
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">store</span>()
|
15
|
-
<span class="ruby-identifier">files_to_store</span> = <span class="ruby-identifier">new_files</span>()
|
16
|
-
<span class="ruby-identifier">files_to_store</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">filename</span><span class="ruby-operator">|</span>
|
17
|
-
<span class="ruby-identifier">file</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">filename</span>)
|
18
|
-
<span class="ruby-identifier">store_file</span>(<span class="ruby-identifier">file</span>, <span class="ruby-identifier">filename</span>)
|
19
|
-
<span class="ruby-keyword kw">end</span>
|
20
|
-
<span class="ruby-keyword kw">end</span></pre>
|
21
|
-
</body>
|
22
|
-
</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>retry_failures (Pho::RDFCollection)</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/rdf_collection.rb, line 35</span>
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">retry_failures</span>()
|
15
|
-
<span class="ruby-identifier">retries</span> = <span class="ruby-identifier">failures</span>()
|
16
|
-
<span class="ruby-identifier">retries</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">filename</span><span class="ruby-operator">|</span>
|
17
|
-
<span class="ruby-constant">File</span>.<span class="ruby-identifier">delete</span>( <span class="ruby-identifier">get_fail_file_for</span>(<span class="ruby-identifier">filename</span>) )
|
18
|
-
<span class="ruby-comment cmt">#store it</span>
|
19
|
-
<span class="ruby-identifier">file</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">filename</span>)
|
20
|
-
<span class="ruby-identifier">store_file</span>(<span class="ruby-identifier">file</span>, <span class="ruby-identifier">filename</span>)
|
21
|
-
<span class="ruby-keyword kw">end</span>
|
22
|
-
<span class="ruby-keyword kw">end</span></pre>
|
23
|
-
</body>
|
24
|
-
</html>
|
@@ -1,23 +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>reset (Pho::RDFCollection)</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/rdf_collection.rb, line 47</span>
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">reset</span>(<span class="ruby-identifier">reset_store</span>=<span class="ruby-keyword kw">false</span>)
|
15
|
-
<span class="ruby-constant">Dir</span>.<span class="ruby-identifier">glob</span>( <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-ivar">@dir</span>, <span class="ruby-node">"*.#{@fail_suffix}"</span>) ).<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">file</span><span class="ruby-operator">|</span>
|
16
|
-
<span class="ruby-constant">File</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">file</span>)
|
17
|
-
<span class="ruby-keyword kw">end</span>
|
18
|
-
<span class="ruby-constant">Dir</span>.<span class="ruby-identifier">glob</span>( <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-ivar">@dir</span>, <span class="ruby-node">"*.#{@ok_suffix}"</span>) ).<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">file</span><span class="ruby-operator">|</span>
|
19
|
-
<span class="ruby-constant">File</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">file</span>)
|
20
|
-
<span class="ruby-keyword kw">end</span>
|
21
|
-
<span class="ruby-keyword kw">end</span></pre>
|
22
|
-
</body>
|
23
|
-
</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>list (Pho::RDFCollection)</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/rdf_collection.rb, line 57</span>
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">list</span>()
|
15
|
-
<span class="ruby-keyword kw">return</span> <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">glob</span>( <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-ivar">@dir</span>, <span class="ruby-node">"*.#{@rdf_suffix}"</span>) )
|
16
|
-
<span class="ruby-keyword kw">end</span></pre>
|
17
|
-
</body>
|
18
|
-
</html>
|
@@ -1,22 +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>failures (Pho::RDFCollection)</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/rdf_collection.rb, line 62</span>
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">failures</span>()
|
15
|
-
<span class="ruby-identifier">fails</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>
|
16
|
-
<span class="ruby-constant">Dir</span>.<span class="ruby-identifier">glob</span>( <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-ivar">@dir</span>, <span class="ruby-node">"*.#{@fail_suffix}"</span>) ).<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">file</span><span class="ruby-operator">|</span>
|
17
|
-
<span class="ruby-identifier">fails</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">file</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-node">/\.#{@fail_suffix}/</span>, <span class="ruby-node">".#{@rdf_suffix}"</span>)
|
18
|
-
<span class="ruby-keyword kw">end</span>
|
19
|
-
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">fails</span>
|
20
|
-
<span class="ruby-keyword kw">end</span></pre>
|
21
|
-
</body>
|
22
|
-
</html>
|
@@ -1,22 +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>successes (Pho::RDFCollection)</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/rdf_collection.rb, line 71</span>
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">successes</span>()
|
15
|
-
<span class="ruby-identifier">successes</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>
|
16
|
-
<span class="ruby-constant">Dir</span>.<span class="ruby-identifier">glob</span>( <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-ivar">@dir</span>, <span class="ruby-node">"*.#{@ok_suffix}"</span>) ).<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">file</span><span class="ruby-operator">|</span>
|
17
|
-
<span class="ruby-identifier">successes</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">file</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-node">/\.#{@ok_suffix}/</span>, <span class="ruby-node">".#{@rdf_suffix}"</span>)
|
18
|
-
<span class="ruby-keyword kw">end</span>
|
19
|
-
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">successes</span>
|
20
|
-
<span class="ruby-keyword kw">end</span></pre>
|
21
|
-
</body>
|
22
|
-
</html>
|
@@ -1,26 +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_files (Pho::RDFCollection)</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/rdf_collection.rb, line 80</span>
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">new_files</span>()
|
15
|
-
<span class="ruby-identifier">newfiles</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>
|
16
|
-
<span class="ruby-constant">Dir</span>.<span class="ruby-identifier">glob</span>( <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-ivar">@dir</span>, <span class="ruby-node">"*.#{@rdf_suffix}"</span>) ) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">file</span><span class="ruby-operator">|</span>
|
17
|
-
<span class="ruby-identifier">ok_file</span> = <span class="ruby-identifier">get_ok_file_for</span>(<span class="ruby-identifier">file</span>)
|
18
|
-
<span class="ruby-identifier">fail_file</span> = <span class="ruby-identifier">get_fail_file_for</span>(<span class="ruby-identifier">file</span>)
|
19
|
-
<span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span>( <span class="ruby-constant">File</span>.<span class="ruby-identifier">exists?</span>(<span class="ruby-identifier">ok_file</span>) <span class="ruby-keyword kw">or</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exists?</span>(<span class="ruby-identifier">fail_file</span>) )
|
20
|
-
<span class="ruby-identifier">newfiles</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">file</span>
|
21
|
-
<span class="ruby-keyword kw">end</span>
|
22
|
-
<span class="ruby-keyword kw">end</span>
|
23
|
-
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">newfiles</span>
|
24
|
-
<span class="ruby-keyword kw">end</span></pre>
|
25
|
-
</body>
|
26
|
-
</html>
|
@@ -1,23 +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>summary (Pho::RDFCollection)</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/rdf_collection.rb, line 94</span>
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">summary</span>()
|
15
|
-
<span class="ruby-identifier">failures</span> = <span class="ruby-identifier">failures</span>()
|
16
|
-
<span class="ruby-identifier">successes</span> = <span class="ruby-identifier">successes</span>()
|
17
|
-
<span class="ruby-identifier">newfiles</span> = <span class="ruby-identifier">new_files</span>()
|
18
|
-
<span class="ruby-identifier">total</span> = <span class="ruby-identifier">failures</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">successes</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">newfiles</span>.<span class="ruby-identifier">size</span>
|
19
|
-
<span class="ruby-identifier">summary</span> = <span class="ruby-node">"#{@dir} contains #{total} files: #{successes.size} stored, #{failures.size} failed, #{newfiles.size} new"</span>
|
20
|
-
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">summary</span>
|
21
|
-
<span class="ruby-keyword kw">end</span></pre>
|
22
|
-
</body>
|
23
|
-
</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>get_fail_file_for (Pho::RDFCollection)</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/rdf_collection.rb, line 103</span>
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_fail_file_for</span>(<span class="ruby-identifier">filename</span>)
|
15
|
-
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">filename</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-node">/\.#{@rdf_suffix}/</span>, <span class="ruby-node">".#{@fail_suffix}"</span>)
|
16
|
-
<span class="ruby-keyword kw">end</span></pre>
|
17
|
-
</body>
|
18
|
-
</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>get_ok_file_for (Pho::RDFCollection)</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/rdf_collection.rb, line 107</span>
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_ok_file_for</span>(<span class="ruby-identifier">filename</span>)
|
15
|
-
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">filename</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-node">/\.#{@rdf_suffix}/</span>, <span class="ruby-node">".#{@ok_suffix}"</span>)
|
16
|
-
<span class="ruby-keyword kw">end</span></pre>
|
17
|
-
</body>
|
18
|
-
</html>
|
@@ -1,31 +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>parse (Pho::Snapshot)</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/snapshot.rb, line 33</span>
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-constant">Snapshot</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">resp</span>)
|
15
|
-
<span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">resp</span>.<span class="ruby-identifier">status</span> <span class="ruby-operator">></span> <span class="ruby-value">200</span>)
|
16
|
-
<span class="ruby-identifier">raise</span> <span class="ruby-node">"Response was not successful. Status code was: #{resp.status}"</span>
|
17
|
-
<span class="ruby-keyword kw">end</span>
|
18
|
-
<span class="ruby-identifier">content</span> = <span class="ruby-identifier">resp</span>.<span class="ruby-identifier">content</span>
|
19
|
-
|
20
|
-
<span class="ruby-identifier">snapshot_url</span> = <span class="ruby-identifier">content</span>.<span class="ruby-identifier">match</span>(<span class="ruby-value str">"<a href=\"(http://api.talis.com/stores/\.+/snapshots/\.+tar)\">\.+</a>"</span>)[<span class="ruby-value">1</span>]
|
21
|
-
|
22
|
-
<span class="ruby-identifier">metadata</span> = <span class="ruby-constant">Regexp</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">"<a href=\"(http://api.talis.com/stores/\.+/snapshots/\.+tar\.md5)\">\.+</a>\n\s+\-\s+([0-9]+) ([a-zA-Z]+)"</span>, <span class="ruby-value str">"m"</span>)
|
23
|
-
<span class="ruby-identifier">snapshot_md5_url</span> = <span class="ruby-identifier">metadata</span>.<span class="ruby-identifier">match</span>(<span class="ruby-identifier">content</span>)[<span class="ruby-value">1</span>]
|
24
|
-
<span class="ruby-identifier">snapshot_size</span> = <span class="ruby-identifier">metadata</span>.<span class="ruby-identifier">match</span>(<span class="ruby-identifier">content</span>)[<span class="ruby-value">2</span>]
|
25
|
-
<span class="ruby-identifier">snapshot_units</span> = <span class="ruby-identifier">metadata</span>.<span class="ruby-identifier">match</span>(<span class="ruby-identifier">content</span>)[<span class="ruby-value">3</span>]
|
26
|
-
|
27
|
-
<span class="ruby-keyword kw">return</span> <span class="ruby-constant">Snapshot</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">snapshot_url</span>, <span class="ruby-identifier">snapshot_md5_url</span>, <span class="ruby-identifier">snapshot_size</span>, <span class="ruby-identifier">snapshot_units</span>)
|
28
|
-
|
29
|
-
<span class="ruby-keyword kw">end</span></pre>
|
30
|
-
</body>
|
31
|
-
</html>
|
@@ -1,21 +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 (Pho::Snapshot)</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/snapshot.rb, line 50</span>
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">url</span>, <span class="ruby-identifier">md5_url</span>, <span class="ruby-identifier">size</span>, <span class="ruby-identifier">units</span>)
|
15
|
-
<span class="ruby-ivar">@url</span> = <span class="ruby-identifier">url</span>
|
16
|
-
<span class="ruby-ivar">@md5_url</span> = <span class="ruby-identifier">md5_url</span>
|
17
|
-
<span class="ruby-ivar">@size</span> = <span class="ruby-identifier">size</span>
|
18
|
-
<span class="ruby-ivar">@units</span> = <span class="ruby-identifier">units</span>
|
19
|
-
<span class="ruby-keyword kw">end</span></pre>
|
20
|
-
</body>
|
21
|
-
</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>read_md5 (Pho::Snapshot)</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/snapshot.rb, line 59</span>
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">read_md5</span>(<span class="ruby-identifier">client</span>=<span class="ruby-constant">HttpClient</span>.<span class="ruby-identifier">new</span>())
|
15
|
-
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">client</span>.<span class="ruby-identifier">get_content</span>(<span class="ruby-ivar">@md5_url</span>)
|
16
|
-
<span class="ruby-keyword kw">end</span></pre>
|
17
|
-
</body>
|
18
|
-
</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>download (Pho::Snapshot)</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/snapshot.rb, line 69</span>
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">download</span>(<span class="ruby-identifier">dir</span>, <span class="ruby-identifier">client</span>=<span class="ruby-constant">HTTPClient</span>.<span class="ruby-identifier">new</span>())
|
15
|
-
|
16
|
-
<span class="ruby-identifier">published_md5</span> = <span class="ruby-identifier">read_md5</span>(<span class="ruby-identifier">client</span>)
|
17
|
-
|
18
|
-
<span class="ruby-identifier">digest</span> = <span class="ruby-constant">Digest</span><span class="ruby-operator">::</span><span class="ruby-constant">MD5</span>.<span class="ruby-identifier">new</span>()
|
19
|
-
|
20
|
-
<span class="ruby-identifier">filename</span> = <span class="ruby-ivar">@url</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">"/"</span>).<span class="ruby-identifier">last</span>
|
21
|
-
<span class="ruby-identifier">file</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>( <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">dir</span>, <span class="ruby-identifier">filename</span>), <span class="ruby-value str">"w"</span> ) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">file</span><span class="ruby-operator">|</span>
|
22
|
-
|
23
|
-
<span class="ruby-comment cmt">#FIXME: this is not efficient as the snapshot may be very large and this</span>
|
24
|
-
<span class="ruby-comment cmt">#will just read all of the data into memory</span>
|
25
|
-
<span class="ruby-identifier">content</span> = <span class="ruby-identifier">client</span>.<span class="ruby-identifier">get_content</span>(<span class="ruby-ivar">@url</span>)
|
26
|
-
<span class="ruby-identifier">file</span>.<span class="ruby-identifier">print</span>(<span class="ruby-identifier">content</span>)
|
27
|
-
<span class="ruby-identifier">digest</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">content</span>
|
28
|
-
|
29
|
-
<span class="ruby-keyword kw">end</span>
|
30
|
-
|
31
|
-
<span class="ruby-identifier">calc_md5</span> = <span class="ruby-identifier">digest</span>.<span class="ruby-identifier">hexdigest</span>
|
32
|
-
<span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">calc_md5</span> <span class="ruby-operator">!=</span> <span class="ruby-identifier">published_md5</span>)
|
33
|
-
<span class="ruby-identifier">raise</span> <span class="ruby-node">"Calculated digest of #{calc_md5} but does not match published md5 #{published_md5}"</span>
|
34
|
-
<span class="ruby-keyword kw">end</span>
|
35
|
-
<span class="ruby-keyword kw">end</span></pre>
|
36
|
-
</body>
|
37
|
-
</html>
|