yax 0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/yax-0.1/docs/classes/IO.html +251 -0
- data/yax-0.1/docs/classes/IO.src/M000003.html +46 -0
- data/yax-0.1/docs/classes/IO.src/M000004.html +27 -0
- data/yax-0.1/docs/classes/Module.html +156 -0
- data/yax-0.1/docs/classes/Module.src/M000002.html +23 -0
- data/yax-0.1/docs/classes/MultiIO.html +217 -0
- data/yax-0.1/docs/classes/MultiIO.src/M000006.html +18 -0
- data/yax-0.1/docs/classes/MultiIO.src/M000007.html +19 -0
- data/yax-0.1/docs/classes/MultiIO.src/M000008.html +20 -0
- data/yax-0.1/docs/classes/Numeric.html +155 -0
- data/yax-0.1/docs/classes/Numeric.src/M000005.html +16 -0
- data/yax-0.1/docs/classes/Regexp.html +153 -0
- data/yax-0.1/docs/classes/Regexp.src/M000001.html +16 -0
- data/yax-0.1/docs/classes/String.html +270 -0
- data/yax-0.1/docs/classes/String.src/M000009.html +18 -0
- data/yax-0.1/docs/classes/String.src/M000010.html +16 -0
- data/yax-0.1/docs/classes/String.src/M000011.html +22 -0
- data/yax-0.1/docs/classes/String.src/M000012.html +27 -0
- data/yax-0.1/docs/classes/String.src/M000013.html +21 -0
- data/yax-0.1/docs/classes/String.src/M000014.html +20 -0
- data/yax-0.1/docs/classes/Yax.html +256 -0
- data/yax-0.1/docs/classes/Yax.src/M000015.html +20 -0
- data/yax-0.1/docs/classes/Yax/Session.html +1661 -0
- data/yax-0.1/docs/classes/Yax/Session.src/M000016.html +20 -0
- data/yax-0.1/docs/classes/Yax/Session.src/M000017.html +18 -0
- data/yax-0.1/docs/classes/Yax/Session.src/M000018.html +19 -0
- data/yax-0.1/docs/classes/Yax/Session.src/M000019.html +19 -0
- data/yax-0.1/docs/classes/Yax/Session.src/M000020.html +19 -0
- data/yax-0.1/docs/classes/Yax/Session.src/M000021.html +46 -0
- data/yax-0.1/docs/classes/Yax/Session.src/M000022.html +19 -0
- data/yax-0.1/docs/classes/Yax/Session.src/M000023.html +18 -0
- data/yax-0.1/docs/classes/Yax/Session.src/M000024.html +20 -0
- data/yax-0.1/docs/classes/Yax/Session.src/M000025.html +18 -0
- data/yax-0.1/docs/classes/Yax/Session.src/M000026.html +19 -0
- data/yax-0.1/docs/classes/Yax/Session.src/M000027.html +20 -0
- data/yax-0.1/docs/classes/Yax/Session.src/M000028.html +18 -0
- data/yax-0.1/docs/classes/Yax/Session.src/M000029.html +18 -0
- data/yax-0.1/docs/classes/Yax/Session.src/M000030.html +19 -0
- data/yax-0.1/docs/classes/Yax/Session.src/M000031.html +25 -0
- data/yax-0.1/docs/classes/Yax/Session.src/M000032.html +18 -0
- data/yax-0.1/docs/classes/Yax/Session.src/M000033.html +36 -0
- data/yax-0.1/docs/classes/Yax/Session.src/M000034.html +34 -0
- data/yax-0.1/docs/classes/Yax/Session.src/M000035.html +23 -0
- data/yax-0.1/docs/classes/Yax/Session.src/M000036.html +20 -0
- data/yax-0.1/docs/classes/Yax/Session.src/M000037.html +32 -0
- data/yax-0.1/docs/classes/Yax/Session.src/M000038.html +20 -0
- data/yax-0.1/docs/classes/Yax/Session.src/M000042.html +18 -0
- data/yax-0.1/docs/classes/Yax/Session.src/M000043.html +18 -0
- data/yax-0.1/docs/classes/Yax/Session.src/M000044.html +20 -0
- data/yax-0.1/docs/classes/Yax/Session.src/M000046.html +37 -0
- data/yax-0.1/docs/classes/Yax/Session.src/M000047.html +29 -0
- data/yax-0.1/docs/classes/Yax/Session.src/M000048.html +29 -0
- data/yax-0.1/docs/classes/Yax/Session.src/M000049.html +30 -0
- data/yax-0.1/docs/classes/Yax/Session.src/M000050.html +22 -0
- data/yax-0.1/docs/classes/Yax/Session.src/M000051.html +20 -0
- data/yax-0.1/docs/classes/Yax/Session.src/M000052.html +20 -0
- data/yax-0.1/docs/classes/Yax/Session.src/M000053.html +19 -0
- data/yax-0.1/docs/classes/Yax/Session.src/M000054.html +28 -0
- data/yax-0.1/docs/classes/Yax/Session.src/M000055.html +21 -0
- data/yax-0.1/docs/classes/Yax/Session.src/M000056.html +27 -0
- data/yax-0.1/docs/classes/Yax/Session.src/M000057.html +20 -0
- data/yax-0.1/docs/classes/Yax/Session.src/M000058.html +22 -0
- data/yax-0.1/docs/classes/Yax/Session.src/M000059.html +21 -0
- data/yax-0.1/docs/classes/Yax/Session.src/M000060.html +21 -0
- data/yax-0.1/docs/classes/Yax/Session.src/M000061.html +20 -0
- data/yax-0.1/docs/classes/Yax/Session.src/M000062.html +21 -0
- data/yax-0.1/docs/classes/Yax/Session.src/M000063.html +20 -0
- data/yax-0.1/docs/classes/Yax/Session.src/M000064.html +21 -0
- data/yax-0.1/docs/classes/Yax/Session.src/M000065.html +26 -0
- data/yax-0.1/docs/classes/Yax/Session.src/M000066.html +25 -0
- data/yax-0.1/docs/classes/Yax/Session.src/M000067.html +29 -0
- data/yax-0.1/docs/classes/Yax/Session.src/M000068.html +26 -0
- data/yax-0.1/docs/classes/Yax/Session.src/M000069.html +19 -0
- data/yax-0.1/docs/classes/Yax/Session.src/M000070.html +31 -0
- data/yax-0.1/docs/classes/Yax/Session.src/M000071.html +25 -0
- data/yax-0.1/docs/created.rid +1 -0
- data/yax-0.1/docs/dot/f_0.dot +14 -0
- data/yax-0.1/docs/dot/f_0.png +0 -0
- data/yax-0.1/docs/dot/f_1.dot +14 -0
- data/yax-0.1/docs/dot/f_1.png +0 -0
- data/yax-0.1/docs/dot/f_2.dot +14 -0
- data/yax-0.1/docs/dot/f_2.png +0 -0
- data/yax-0.1/docs/dot/f_3.dot +93 -0
- data/yax-0.1/docs/dot/f_3.png +0 -0
- data/yax-0.1/docs/dot/m_3_0.dot +39 -0
- data/yax-0.1/docs/dot/m_3_0.png +0 -0
- data/yax-0.1/docs/files/License_txt.html +124 -0
- data/yax-0.1/docs/files/ReadMe_Amber_txt.html +489 -0
- data/yax-0.1/docs/files/ReadMe_txt.html +444 -0
- data/yax-0.1/docs/files/nist/yax_rb.html +138 -0
- data/yax-0.1/docs/fr_class_index.html +34 -0
- data/yax-0.1/docs/fr_file_index.html +30 -0
- data/yax-0.1/docs/fr_method_index.html +97 -0
- data/yax-0.1/docs/index.html +24 -0
- data/yax-0.1/docs/rdoc-style.css +208 -0
- data/yax-0.1/lib/nist/yax.rb +1367 -0
- data/yax-0.1/tests/test_yax.rb +190 -0
- metadata +195 -0
@@ -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>url? (String)</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 nist/yax.rb, line 22</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">url?</span>
|
15
|
+
<span class="ruby-constant">URL_PAT</span>.<span class="ruby-identifier">match</span>(<span class="ruby-keyword kw">self</span>)
|
16
|
+
<span class="ruby-keyword kw">end</span></pre>
|
17
|
+
</body>
|
18
|
+
</html>
|
@@ -0,0 +1,16 @@
|
|
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_regexp (String)</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 nist/yax.rb, line 26</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_regexp</span>; <span class="ruby-constant">Regexp</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">Regexp</span>.<span class="ruby-identifier">quote</span>(<span class="ruby-keyword kw">self</span>)); <span class="ruby-keyword kw">end</span></pre>
|
15
|
+
</body>
|
16
|
+
</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>match_pattern_hash (String)</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 nist/yax.rb, line 32</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">match_pattern_hash</span>(<span class="ruby-identifier">hash</span>)
|
15
|
+
<span class="ruby-identifier">hash</span>.<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">key</span>, <span class="ruby-identifier">pattern</span><span class="ruby-operator">|</span>
|
16
|
+
<span class="ruby-identifier">match</span> = <span class="ruby-identifier">pattern</span>.<span class="ruby-identifier">match</span>(<span class="ruby-keyword kw">self</span>)
|
17
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">key</span>, <span class="ruby-identifier">match</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">match</span>
|
18
|
+
}
|
19
|
+
<span class="ruby-keyword kw">nil</span>
|
20
|
+
<span class="ruby-keyword kw">end</span></pre>
|
21
|
+
</body>
|
22
|
+
</html>
|
@@ -0,0 +1,27 @@
|
|
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_seconds (String)</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 nist/yax.rb, line 45</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_seconds</span>
|
15
|
+
<span class="ruby-identifier">parts</span> = <span class="ruby-identifier">split</span>(<span class="ruby-value str">':'</span>)
|
16
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-value str">"To convert a String to seconds, it needs to be expressed as dd:hh:mm:ss"</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">parts</span>.<span class="ruby-identifier">size!</span>=<span class="ruby-value">4</span>
|
17
|
+
<span class="ruby-identifier">answer</span> = <span class="ruby-identifier">parts</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">to_i</span>
|
18
|
+
<span class="ruby-identifier">answer</span> <span class="ruby-operator">*=</span> <span class="ruby-value">24</span>
|
19
|
+
<span class="ruby-identifier">answer</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">parts</span>[<span class="ruby-value">1</span>].<span class="ruby-identifier">to_i</span>
|
20
|
+
<span class="ruby-identifier">answer</span> <span class="ruby-operator">*=</span> <span class="ruby-value">60</span>
|
21
|
+
<span class="ruby-identifier">answer</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">parts</span>[<span class="ruby-value">2</span>].<span class="ruby-identifier">to_i</span>
|
22
|
+
<span class="ruby-identifier">answer</span> <span class="ruby-operator">*=</span> <span class="ruby-value">60</span>
|
23
|
+
<span class="ruby-identifier">answer</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">parts</span>[<span class="ruby-value">3</span>].<span class="ruby-identifier">to_i</span>
|
24
|
+
<span class="ruby-identifier">answer</span>
|
25
|
+
<span class="ruby-keyword kw">end</span></pre>
|
26
|
+
</body>
|
27
|
+
</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>from_seconds (String)</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 nist/yax.rb, line 58</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">from_seconds</span>(<span class="ruby-identifier">seconds</span>)
|
15
|
+
<span class="ruby-identifier">mm</span>, <span class="ruby-identifier">ss</span> = <span class="ruby-identifier">seconds</span>.<span class="ruby-identifier">ceil</span>.<span class="ruby-identifier">divmod</span>(<span class="ruby-value">60</span>)
|
16
|
+
<span class="ruby-identifier">hh</span>, <span class="ruby-identifier">mm</span> = <span class="ruby-identifier">mm</span>.<span class="ruby-identifier">divmod</span>(<span class="ruby-value">60</span>)
|
17
|
+
<span class="ruby-identifier">dd</span>, <span class="ruby-identifier">hh</span> = <span class="ruby-identifier">hh</span>.<span class="ruby-identifier">divmod</span>(<span class="ruby-value">24</span>)
|
18
|
+
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">new</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">dd</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">':'</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">hh</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">':'</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">mm</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">':'</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">ss</span>.<span class="ruby-identifier">to_s</span>
|
19
|
+
<span class="ruby-keyword kw">end</span></pre>
|
20
|
+
</body>
|
21
|
+
</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>last_line (String)</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 nist/yax.rb, line 66</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">last_line</span>
|
15
|
+
<span class="ruby-identifier">i</span>=<span class="ruby-identifier">rindex</span>(<span class="ruby-value str">"\n"</span>)
|
16
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">i</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">size</span><span class="ruby-operator">></span>(<span class="ruby-identifier">i</span><span class="ruby-operator">+</span><span class="ruby-value">1</span>)
|
17
|
+
<span class="ruby-keyword kw">self</span>[(<span class="ruby-identifier">i</span><span class="ruby-operator">+</span><span class="ruby-value">1</span>)<span class="ruby-operator">..</span><span class="ruby-value">-1</span>]
|
18
|
+
<span class="ruby-keyword kw">end</span></pre>
|
19
|
+
</body>
|
20
|
+
</html>
|
@@ -0,0 +1,256 @@
|
|
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>Module: Yax</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>Module</strong></td>
|
53
|
+
<td class="class-name-in-header">Yax</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../files/nist/yax_rb.html">
|
59
|
+
nist/yax.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
</td>
|
63
|
+
</tr>
|
64
|
+
|
65
|
+
</table>
|
66
|
+
</div>
|
67
|
+
<!-- banner header -->
|
68
|
+
|
69
|
+
<div id="bodyContent">
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
<div id="contextContent">
|
74
|
+
<div id="diagram">
|
75
|
+
<map id="map" name="map">
|
76
|
+
<area shape="RECT" coords="29,52,101,100" href="Yax/Session.html" alt="Session">
|
77
|
+
<area shape="RECT" coords="18,18,138,110" href="Yax.html" alt="Yax">
|
78
|
+
</map>
|
79
|
+
<img src="../dot/m_3_0.png" usemap="#map" border=0 alt="Module: Yax">
|
80
|
+
</div>
|
81
|
+
|
82
|
+
<div id="description">
|
83
|
+
<h1>Overview</h1>
|
84
|
+
<p>
|
85
|
+
In addition to providing a namespace for <a
|
86
|
+
href="Yax/Session.html">Yax::Session</a>, the <a href="Yax.html">Yax</a> <a
|
87
|
+
href="Module.html">Module</a> offers singleton-like reflections of <a
|
88
|
+
href="Yax/Session.html">Session</a> instance methods, implemented by <a
|
89
|
+
href="Module.html#M000002">Module#yaxify</a>. If these methods don’t
|
90
|
+
conflict with others, you can "include <a
|
91
|
+
href="Yax.html">Yax</a>" to access them.
|
92
|
+
</p>
|
93
|
+
<p>
|
94
|
+
These methods are not shown below under "Public Instance methods"
|
95
|
+
because they are constructed by meta-programming. They are not visible to
|
96
|
+
rdoc. If you need some extra <a href="Yax/Session.html">Session</a>
|
97
|
+
behaviors, you can easily add them using <a
|
98
|
+
href="Module.html#M000002">Module#yaxify</a>.
|
99
|
+
</p>
|
100
|
+
<h2>Reflected Methods</h2>
|
101
|
+
<h3>Reflected Interactions</h3>
|
102
|
+
<ul>
|
103
|
+
<li><a href="Yax/Session.html#M000044">Session#command</a>, <a
|
104
|
+
href="Yax/Session.html#M000045">Session#cmd</a>
|
105
|
+
|
106
|
+
</li>
|
107
|
+
<li><a href="Yax/Session.html#M000043">Session#expect</a>
|
108
|
+
|
109
|
+
</li>
|
110
|
+
<li><a href="Yax/Session.html#M000038">Session#respond</a>, <a
|
111
|
+
href="Yax/Session.html#M000039">Session#answer</a>, <a
|
112
|
+
href="Yax/Session.html#M000040">Session#snd</a>, <a
|
113
|
+
href="Yax/Session.html#M000041">Session#reply</a>
|
114
|
+
|
115
|
+
</li>
|
116
|
+
<li><a href="Yax/Session.html#M000046">Session#finish</a>
|
117
|
+
|
118
|
+
</li>
|
119
|
+
<li><a href="Yax/Session.html#M000035">Session#die</a>
|
120
|
+
|
121
|
+
</li>
|
122
|
+
</ul>
|
123
|
+
<h3>Reflected Name Resolution & Management</h3>
|
124
|
+
<ul>
|
125
|
+
<li><a href="Yax/Session.html#M000047">Session#resolve_url</a>, <a
|
126
|
+
href="Yax/Session.html#M000048">Session#resolve_dir</a>, <a
|
127
|
+
href="Yax/Session.html#M000049">Session#resolve_file</a>
|
128
|
+
|
129
|
+
</li>
|
130
|
+
<li><a href="Yax/Session.html#M000050">Session#dirName</a>, <a
|
131
|
+
href="Yax/Session.html#M000051">Session#fileName</a>
|
132
|
+
|
133
|
+
</li>
|
134
|
+
<li><a href="Yax/Session.html#M000052">Session#d</a>, <a
|
135
|
+
href="Yax/Session.html#M000053">Session#f</a>
|
136
|
+
|
137
|
+
</li>
|
138
|
+
<li><a href="Yax/Session.html#M000056">Session#cd</a>!
|
139
|
+
|
140
|
+
</li>
|
141
|
+
</ul>
|
142
|
+
<h3>Reflected File Operations</h3>
|
143
|
+
<ul>
|
144
|
+
<li><a href="Yax/Session.html#M000061">Session#mkdir</a>, <a
|
145
|
+
href="Yax/Session.html#M000057">Session#chmod</a>
|
146
|
+
|
147
|
+
</li>
|
148
|
+
<li><a href="Yax/Session.html#M000056">Session#cd</a>
|
149
|
+
|
150
|
+
</li>
|
151
|
+
<li><a href="Yax/Session.html#M000062">Session#mv</a>, <a
|
152
|
+
href="Yax/Session.html#M000063">Session#rm_rf</a>, <a
|
153
|
+
href="Yax/Session.html#M000058">Session#cp</a>
|
154
|
+
|
155
|
+
</li>
|
156
|
+
<li><a href="Yax/Session.html#M000059">Session#ln</a>, <a
|
157
|
+
href="Yax/Session.html#M000060">Session#ln_sf</a>
|
158
|
+
|
159
|
+
</li>
|
160
|
+
<li><a href="Yax/Session.html#M000064">Session#cmp</a>
|
161
|
+
|
162
|
+
</li>
|
163
|
+
</ul>
|
164
|
+
<h3>Reflected Other Helpers</h3>
|
165
|
+
<ul>
|
166
|
+
<li><a href="Yax/Session.html#M000065">Session#mangle</a>
|
167
|
+
|
168
|
+
</li>
|
169
|
+
<li><a href="Yax/Session.html#M000069">Session#curl</a>
|
170
|
+
|
171
|
+
</li>
|
172
|
+
<li><a href="Yax/Session.html#M000067">Session#untgz</a>, <a
|
173
|
+
href="Yax/Session.html#M000068">Session#tgz</a>
|
174
|
+
|
175
|
+
</li>
|
176
|
+
<li><a href="Yax/Session.html#M000070">Session#env</a>, <a
|
177
|
+
href="Yax/Session.html#M000071">Session#env_path</a>
|
178
|
+
|
179
|
+
</li>
|
180
|
+
</ul>
|
181
|
+
<h3>Reflected Output Methods</h3>
|
182
|
+
<ul>
|
183
|
+
<li><a href="Yax/Session.html#M000032">Session#note</a>, <a
|
184
|
+
href="Yax/Session.html#M000066">Session#banner</a>
|
185
|
+
|
186
|
+
</li>
|
187
|
+
</ul>
|
188
|
+
|
189
|
+
</div>
|
190
|
+
|
191
|
+
|
192
|
+
</div>
|
193
|
+
|
194
|
+
<div id="method-list">
|
195
|
+
<h3 class="section-bar">Methods</h3>
|
196
|
+
|
197
|
+
<div class="name-list">
|
198
|
+
<a href="#M000015">yax</a>
|
199
|
+
</div>
|
200
|
+
</div>
|
201
|
+
|
202
|
+
</div>
|
203
|
+
|
204
|
+
|
205
|
+
<!-- if includes -->
|
206
|
+
|
207
|
+
<div id="section">
|
208
|
+
|
209
|
+
<div id="class-list">
|
210
|
+
<h3 class="section-bar">Classes and Modules</h3>
|
211
|
+
|
212
|
+
Class <a href="Yax/Session.html" class="link">Yax::Session</a><br />
|
213
|
+
|
214
|
+
</div>
|
215
|
+
|
216
|
+
|
217
|
+
|
218
|
+
|
219
|
+
|
220
|
+
|
221
|
+
|
222
|
+
<!-- if method_list -->
|
223
|
+
<div id="methods">
|
224
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
225
|
+
|
226
|
+
<div id="method-M000015" class="method-detail">
|
227
|
+
<a name="M000015"></a>
|
228
|
+
|
229
|
+
<div class="method-heading">
|
230
|
+
<a href="Yax.src/M000015.html" target="Code" class="method-signature"
|
231
|
+
onclick="popupCode('Yax.src/M000015.html');return false;">
|
232
|
+
<span class="method-name">yax</span><span class="method-args">(program='bash', klass=Yax::Session)</span>
|
233
|
+
</a>
|
234
|
+
</div>
|
235
|
+
|
236
|
+
<div class="method-description">
|
237
|
+
<p>
|
238
|
+
Returns a default instance, which is created on the first invocation. This
|
239
|
+
instance is stored in $YAX.
|
240
|
+
</p>
|
241
|
+
</div>
|
242
|
+
</div>
|
243
|
+
|
244
|
+
|
245
|
+
</div>
|
246
|
+
|
247
|
+
|
248
|
+
</div>
|
249
|
+
|
250
|
+
|
251
|
+
<div id="validator-badges">
|
252
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
253
|
+
</div>
|
254
|
+
|
255
|
+
</body>
|
256
|
+
</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>yax (Yax)</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 nist/yax.rb, line 1337</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">yax</span>(<span class="ruby-identifier">program</span>=<span class="ruby-value str">'bash'</span>, <span class="ruby-identifier">klass</span>=<span class="ruby-constant">Yax</span><span class="ruby-operator">::</span><span class="ruby-constant">Session</span>)
|
15
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">$YAX</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$YAX</span>
|
16
|
+
<span class="ruby-identifier">$YAX</span> = <span class="ruby-identifier">program</span> <span class="ruby-value">? </span><span class="ruby-identifier">klass</span>.<span class="ruby-identifier">spawn</span>(<span class="ruby-identifier">program</span>) <span class="ruby-operator">:</span> <span class="ruby-identifier">klass</span>.<span class="ruby-identifier">new</span>
|
17
|
+
<span class="ruby-identifier">$YAX</span>
|
18
|
+
<span class="ruby-keyword kw">end</span></pre>
|
19
|
+
</body>
|
20
|
+
</html>
|
@@ -0,0 +1,1661 @@
|
|
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: Yax::Session</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">Yax::Session</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../../files/nist/yax_rb.html">
|
59
|
+
nist/yax.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
|
+
<div id="diagram">
|
81
|
+
<map id="map" name="map">
|
82
|
+
<area shape="RECT" coords="29,52,101,100" href="Session.html" alt="Session">
|
83
|
+
<area shape="RECT" coords="18,18,138,110" href="../Yax.html" alt="Yax">
|
84
|
+
</map>
|
85
|
+
<img src="../../dot/m_3_0.png" usemap="#map" border=0 alt="Module: Yax">
|
86
|
+
</div>
|
87
|
+
|
88
|
+
<div id="description">
|
89
|
+
<p>
|
90
|
+
Represents an environment in which one can script an interaction with a
|
91
|
+
process (others should be possible, but only bash has been tested).
|
92
|
+
</p>
|
93
|
+
<p>
|
94
|
+
For an overview of use, features, and an example, see <a
|
95
|
+
href="../../files/ReadMe_txt.html">ReadMe.txt</a>.
|
96
|
+
</p>
|
97
|
+
|
98
|
+
</div>
|
99
|
+
|
100
|
+
|
101
|
+
</div>
|
102
|
+
|
103
|
+
<div id="method-list">
|
104
|
+
<h3 class="section-bar">Methods</h3>
|
105
|
+
|
106
|
+
<div class="name-list">
|
107
|
+
<a href="#M000039">answer</a>
|
108
|
+
<a href="#M000054">archive_type</a>
|
109
|
+
<a href="#M000066">banner</a>
|
110
|
+
<a href="#M000025">build_default_dir_hash</a>
|
111
|
+
<a href="#M000056">cd</a>
|
112
|
+
<a href="#M000055">cd!</a>
|
113
|
+
<a href="#M000057">chmod</a>
|
114
|
+
<a href="#M000045">cmd</a>
|
115
|
+
<a href="#M000064">cmp</a>
|
116
|
+
<a href="#M000044">command</a>
|
117
|
+
<a href="#M000058">cp</a>
|
118
|
+
<a href="#M000069">curl</a>
|
119
|
+
<a href="#M000052">d</a>
|
120
|
+
<a href="#M000019">default_error_log_path</a>
|
121
|
+
<a href="#M000020">default_exit_status_path</a>
|
122
|
+
<a href="#M000022">default_prompt</a>
|
123
|
+
<a href="#M000023">default_prompt</a>
|
124
|
+
<a href="#M000018">default_time_log_path</a>
|
125
|
+
<a href="#M000035">die</a>
|
126
|
+
<a href="#M000050">dirName</a>
|
127
|
+
<a href="#M000070">env</a>
|
128
|
+
<a href="#M000071">env_path</a>
|
129
|
+
<a href="#M000043">expect</a>
|
130
|
+
<a href="#M000053">f</a>
|
131
|
+
<a href="#M000051">fileName</a>
|
132
|
+
<a href="#M000046">finish</a>
|
133
|
+
<a href="#M000027">get_password</a>
|
134
|
+
<a href="#M000029">inverse_scaled_seconds</a>
|
135
|
+
<a href="#M000036">kill</a>
|
136
|
+
<a href="#M000030">limit</a>
|
137
|
+
<a href="#M000059">ln</a>
|
138
|
+
<a href="#M000060">ln_sf</a>
|
139
|
+
<a href="#M000033">log</a>
|
140
|
+
<a href="#M000042">log_output</a>
|
141
|
+
<a href="#M000031">log_time</a>
|
142
|
+
<a href="#M000065">mangle</a>
|
143
|
+
<a href="#M000061">mkdir</a>
|
144
|
+
<a href="#M000062">mv</a>
|
145
|
+
<a href="#M000021">new</a>
|
146
|
+
<a href="#M000024">normalize_paths</a>
|
147
|
+
<a href="#M000032">note</a>
|
148
|
+
<a href="#M000017">phb_available</a>
|
149
|
+
<a href="#M000041">reply</a>
|
150
|
+
<a href="#M000048">resolve_dir</a>
|
151
|
+
<a href="#M000049">resolve_file</a>
|
152
|
+
<a href="#M000047">resolve_url</a>
|
153
|
+
<a href="#M000038">respond</a>
|
154
|
+
<a href="#M000063">rm_rf</a>
|
155
|
+
<a href="#M000028">scaled_seconds</a>
|
156
|
+
<a href="#M000040">snd</a>
|
157
|
+
<a href="#M000034">spawn</a>
|
158
|
+
<a href="#M000016">spawn</a>
|
159
|
+
<a href="#M000068">tgz</a>
|
160
|
+
<a href="#M000026">truncate_time_log</a>
|
161
|
+
<a href="#M000067">untgz</a>
|
162
|
+
<a href="#M000037">wait</a>
|
163
|
+
</div>
|
164
|
+
</div>
|
165
|
+
|
166
|
+
</div>
|
167
|
+
|
168
|
+
|
169
|
+
<!-- if includes -->
|
170
|
+
|
171
|
+
<div id="section">
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
<div id="aliases-list">
|
176
|
+
<h3 class="section-bar">External Aliases</h3>
|
177
|
+
|
178
|
+
<div class="name-list">
|
179
|
+
<table summary="aliases">
|
180
|
+
<tr class="top-aligned-row context-row">
|
181
|
+
<td class="context-item-name">default_maxSeconds</td>
|
182
|
+
<td>-></td>
|
183
|
+
<td class="context-item-value">time_out</td>
|
184
|
+
</tr>
|
185
|
+
<tr class="top-aligned-row context-row">
|
186
|
+
<td class="context-item-name">default_maxSeconds=</td>
|
187
|
+
<td>-></td>
|
188
|
+
<td class="context-item-value">time_out=</td>
|
189
|
+
</tr>
|
190
|
+
</table>
|
191
|
+
</div>
|
192
|
+
</div>
|
193
|
+
|
194
|
+
|
195
|
+
<div id="attribute-list">
|
196
|
+
<h3 class="section-bar">Attributes</h3>
|
197
|
+
|
198
|
+
<div class="name-list">
|
199
|
+
<table>
|
200
|
+
<tr class="top-aligned-row context-row">
|
201
|
+
<td class="context-item-name">cd_max_seconds</td>
|
202
|
+
<td class="context-item-value"> [RW] </td>
|
203
|
+
<td class="context-item-desc">
|
204
|
+
<a href="Session.html">Session</a>’s file operations other than cd
|
205
|
+
are thin wrappers on FileUtil, that make logging consistent, but which do
|
206
|
+
not have time limits. <a href="Session.html#M000056">cd</a> is different
|
207
|
+
because it needs to invoke both "cd" using <a
|
208
|
+
href="Session.html#M000044">command</a>, and the FileUtil version (so that
|
209
|
+
tests like File.exist? and File.directory? work). If we don’t assign
|
210
|
+
a time limit to "command cd", the subsequent operation will apply
|
211
|
+
one of it’s own. So we need to define a limit for <a
|
212
|
+
href="Session.html#M000056">cd</a>.
|
213
|
+
|
214
|
+
</td>
|
215
|
+
</tr>
|
216
|
+
<tr class="top-aligned-row context-row">
|
217
|
+
<td class="context-item-name">default_maxSeconds</td>
|
218
|
+
<td class="context-item-value"> [RW] </td>
|
219
|
+
<td class="context-item-desc">
|
220
|
+
Specifies the maximum time that expect and finish will wait, if the script
|
221
|
+
does not supply a time.
|
222
|
+
|
223
|
+
</td>
|
224
|
+
</tr>
|
225
|
+
<tr class="top-aligned-row context-row">
|
226
|
+
<td class="context-item-name">dir_hash</td>
|
227
|
+
<td class="context-item-value"> [RW] </td>
|
228
|
+
<td class="context-item-desc">
|
229
|
+
@dir_hash lets you assign symbolic names to directories @dir_hash has:
|
230
|
+
|
231
|
+
<ul>
|
232
|
+
<li>key is a Symbol
|
233
|
+
|
234
|
+
</li>
|
235
|
+
<li>value is an absolute path to a directory
|
236
|
+
|
237
|
+
</li>
|
238
|
+
</ul>
|
239
|
+
</td>
|
240
|
+
</tr>
|
241
|
+
<tr class="top-aligned-row context-row">
|
242
|
+
<td class="context-item-name">dir_overide</td>
|
243
|
+
<td class="context-item-value"> [RW] </td>
|
244
|
+
<td class="context-item-desc">
|
245
|
+
@dir_overide lets you override the name of directory resulting from
|
246
|
+
decompression of an archive. @dir_overide is a Hash with:
|
247
|
+
|
248
|
+
<ul>
|
249
|
+
<li>key is a string URL basename without extension
|
250
|
+
|
251
|
+
</li>
|
252
|
+
<li>value is a directory name.
|
253
|
+
|
254
|
+
</li>
|
255
|
+
</ul>
|
256
|
+
</td>
|
257
|
+
</tr>
|
258
|
+
<tr class="top-aligned-row context-row">
|
259
|
+
<td class="context-item-name">error_log_path</td>
|
260
|
+
<td class="context-item-value"> [RW] </td>
|
261
|
+
<td class="context-item-desc">
|
262
|
+
@error_log_path contains a required absolute path to the error log file.
|
263
|
+
Each command replaces this file: if you want the errors for the entire <a
|
264
|
+
href="Session.html">Session</a>, consult the transcript.
|
265
|
+
|
266
|
+
</td>
|
267
|
+
</tr>
|
268
|
+
<tr class="top-aligned-row context-row">
|
269
|
+
<td class="context-item-name">exit_status</td>
|
270
|
+
<td class="context-item-value"> [RW] </td>
|
271
|
+
<td class="context-item-desc">
|
272
|
+
The exit_status is an integer returned by most recently finished command: 0
|
273
|
+
is success.
|
274
|
+
|
275
|
+
</td>
|
276
|
+
</tr>
|
277
|
+
<tr class="top-aligned-row context-row">
|
278
|
+
<td class="context-item-name">exit_status_path</td>
|
279
|
+
<td class="context-item-value"> [RW] </td>
|
280
|
+
<td class="context-item-desc">
|
281
|
+
@exit_status_path contains a required absolute path to a file that’s
|
282
|
+
used to record <a href="Session.html#M000044">command</a> exit statuses.
|
283
|
+
|
284
|
+
</td>
|
285
|
+
</tr>
|
286
|
+
<tr class="top-aligned-row context-row">
|
287
|
+
<td class="context-item-name">give_finishing_notice</td>
|
288
|
+
<td class="context-item-value"> [RW] </td>
|
289
|
+
<td class="context-item-desc">
|
290
|
+
If true, provides extra debug information at the price of excessive
|
291
|
+
transcript verbosity.
|
292
|
+
|
293
|
+
</td>
|
294
|
+
</tr>
|
295
|
+
<tr class="top-aligned-row context-row">
|
296
|
+
<td class="context-item-name">log_prompt</td>
|
297
|
+
<td class="context-item-value"> [RW] </td>
|
298
|
+
<td class="context-item-desc">
|
299
|
+
If true, prompts are logged like other output
|
300
|
+
|
301
|
+
</td>
|
302
|
+
</tr>
|
303
|
+
<tr class="top-aligned-row context-row">
|
304
|
+
<td class="context-item-name">password</td>
|
305
|
+
<td class="context-item-value"> [RW] </td>
|
306
|
+
<td class="context-item-desc">
|
307
|
+
The automatic response to @password_prompt
|
308
|
+
|
309
|
+
</td>
|
310
|
+
</tr>
|
311
|
+
<tr class="top-aligned-row context-row">
|
312
|
+
<td class="context-item-name">password_prompt</td>
|
313
|
+
<td class="context-item-value"> [RW] </td>
|
314
|
+
<td class="context-item-desc">
|
315
|
+
A <a href="../String.html">String</a> or Regex used to decide when an
|
316
|
+
administrative password is required (such as when a script or a command
|
317
|
+
uses sudo). If this is nil, <a href="Session.html">Session</a> will not
|
318
|
+
attempt to detect and answer administative passwords. If a password is
|
319
|
+
actually demanded, your script will hang until the operation times out.
|
320
|
+
|
321
|
+
</td>
|
322
|
+
</tr>
|
323
|
+
<tr class="top-aligned-row context-row">
|
324
|
+
<td class="context-item-name">pattern_hash_class</td>
|
325
|
+
<td class="context-item-value"> [RW] </td>
|
326
|
+
<td class="context-item-desc">
|
327
|
+
To accomodate multiple possible outcomes, <a
|
328
|
+
href="Session.html#M000043">expect</a> can take a Hash argument. In many
|
329
|
+
cases, however, a <a href="../String.html">String</a> or Regex good enough
|
330
|
+
to specify the next response from the spawned process. In that case,
|
331
|
+
@pattern_hash_class is instantiated, containing the expected <a
|
332
|
+
href="../String.html">String</a> or Regex.
|
333
|
+
|
334
|
+
</td>
|
335
|
+
</tr>
|
336
|
+
<tr class="top-aligned-row context-row">
|
337
|
+
<td class="context-item-name">pid</td>
|
338
|
+
<td class="context-item-value"> [RW] </td>
|
339
|
+
<td class="context-item-desc">
|
340
|
+
The process ID of the spawned process
|
341
|
+
|
342
|
+
</td>
|
343
|
+
</tr>
|
344
|
+
<tr class="top-aligned-row context-row">
|
345
|
+
<td class="context-item-name">prefixes</td>
|
346
|
+
<td class="context-item-value"> [RW] </td>
|
347
|
+
<td class="context-item-desc">
|
348
|
+
A Hash used to specify the prefixes that identify lines in the transcript.
|
349
|
+
|
350
|
+
</td>
|
351
|
+
</tr>
|
352
|
+
<tr class="top-aligned-row context-row">
|
353
|
+
<td class="context-item-name">prompt</td>
|
354
|
+
<td class="context-item-value"> [RW] </td>
|
355
|
+
<td class="context-item-desc">
|
356
|
+
A <a href="../String.html">String</a> or <a
|
357
|
+
href="../Regexp.html">Regexp</a> describing the prompt issued by the
|
358
|
+
spawned process. You may need to change this if you:
|
359
|
+
|
360
|
+
<ul>
|
361
|
+
<li>spawn a process other than bash
|
362
|
+
|
363
|
+
</li>
|
364
|
+
<li>don’t use OS X
|
365
|
+
|
366
|
+
</li>
|
367
|
+
<li>customize your shell
|
368
|
+
|
369
|
+
</li>
|
370
|
+
</ul>
|
371
|
+
<p>
|
372
|
+
Do not confuse this attribute with @password_prompt.
|
373
|
+
</p>
|
374
|
+
</td>
|
375
|
+
</tr>
|
376
|
+
<tr class="top-aligned-row context-row">
|
377
|
+
<td class="context-item-name">pty_workaround</td>
|
378
|
+
<td class="context-item-value"> [RW] </td>
|
379
|
+
<td class="context-item-desc">
|
380
|
+
When set to true, <a href="Session.html">Session</a> attempts to work
|
381
|
+
around some PTY idiosyncrasies
|
382
|
+
|
383
|
+
</td>
|
384
|
+
</tr>
|
385
|
+
<tr class="top-aligned-row context-row">
|
386
|
+
<td class="context-item-name">stdin</td>
|
387
|
+
<td class="context-item-value"> [RW] </td>
|
388
|
+
<td class="context-item-desc">
|
389
|
+
<a href="../IO.html">IO</a> that the spawned process takes input from.
|
390
|
+
|
391
|
+
</td>
|
392
|
+
</tr>
|
393
|
+
<tr class="top-aligned-row context-row">
|
394
|
+
<td class="context-item-name">stdout</td>
|
395
|
+
<td class="context-item-value"> [RW] </td>
|
396
|
+
<td class="context-item-desc">
|
397
|
+
<a href="../IO.html">IO</a> that the spawned process writes to.
|
398
|
+
|
399
|
+
</td>
|
400
|
+
</tr>
|
401
|
+
<tr class="top-aligned-row context-row">
|
402
|
+
<td class="context-item-name">time_log_path</td>
|
403
|
+
<td class="context-item-value"> [RW] </td>
|
404
|
+
<td class="context-item-desc">
|
405
|
+
@time_log_path is optional. If present, a log of execution times will be
|
406
|
+
kept.
|
407
|
+
|
408
|
+
</td>
|
409
|
+
</tr>
|
410
|
+
<tr class="top-aligned-row context-row">
|
411
|
+
<td class="context-item-name">time_log_reset</td>
|
412
|
+
<td class="context-item-value"> [RW] </td>
|
413
|
+
<td class="context-item-desc">
|
414
|
+
If @time_log_reset is true, the previous time log (if any) will be removed
|
415
|
+
when each session is spawned. Otherwise a single log will be used across
|
416
|
+
sessions.
|
417
|
+
|
418
|
+
</td>
|
419
|
+
</tr>
|
420
|
+
<tr class="top-aligned-row context-row">
|
421
|
+
<td class="context-item-name">time_stamp_banners</td>
|
422
|
+
<td class="context-item-value"> [RW] </td>
|
423
|
+
<td class="context-item-desc">
|
424
|
+
Turning off timestamps is nice to keep regression test results date
|
425
|
+
independent.
|
426
|
+
|
427
|
+
</td>
|
428
|
+
</tr>
|
429
|
+
<tr class="top-aligned-row context-row">
|
430
|
+
<td class="context-item-name">timeout_multiplier</td>
|
431
|
+
<td class="context-item-value"> [RW] </td>
|
432
|
+
<td class="context-item-desc">
|
433
|
+
Scripts should express time limits as measurements made under a particular
|
434
|
+
set of conditions. You can then set the @timeout_multiplier to increase or
|
435
|
+
decrease time limits according to the new hardware. The @timeout_offset is
|
436
|
+
a minimal time added to every time limit (after multiplication by
|
437
|
+
@timeout_multiplier)
|
438
|
+
|
439
|
+
</td>
|
440
|
+
</tr>
|
441
|
+
<tr class="top-aligned-row context-row">
|
442
|
+
<td class="context-item-name">timeout_offset</td>
|
443
|
+
<td class="context-item-value"> [RW] </td>
|
444
|
+
<td class="context-item-desc">
|
445
|
+
Used to scale timeouts: see @timeout_multiplier
|
446
|
+
|
447
|
+
</td>
|
448
|
+
</tr>
|
449
|
+
<tr class="top-aligned-row context-row">
|
450
|
+
<td class="context-item-name">transcript</td>
|
451
|
+
<td class="context-item-value"> [RW] </td>
|
452
|
+
<td class="context-item-desc">
|
453
|
+
The @trascript records the session for debug purposes. When @transcript is
|
454
|
+
not nil, it must respond to <<. If it also responds to flush, each
|
455
|
+
log entry will be flushed.
|
456
|
+
|
457
|
+
</td>
|
458
|
+
</tr>
|
459
|
+
<tr class="top-aligned-row context-row">
|
460
|
+
<td class="context-item-name">url_hash</td>
|
461
|
+
<td class="context-item-value"> [RW] </td>
|
462
|
+
<td class="context-item-desc">
|
463
|
+
@url_hash lets you assign symbolic names to URLs @url_hash has:
|
464
|
+
|
465
|
+
<ul>
|
466
|
+
<li>key is a Symbol
|
467
|
+
|
468
|
+
</li>
|
469
|
+
<li>value is a URL
|
470
|
+
|
471
|
+
</li>
|
472
|
+
</ul>
|
473
|
+
</td>
|
474
|
+
</tr>
|
475
|
+
</table>
|
476
|
+
</div>
|
477
|
+
</div>
|
478
|
+
|
479
|
+
|
480
|
+
|
481
|
+
<!-- if method_list -->
|
482
|
+
<div id="methods">
|
483
|
+
<h3 class="section-bar">Public Class methods</h3>
|
484
|
+
|
485
|
+
<div id="method-M000022" class="method-detail">
|
486
|
+
<a name="M000022"></a>
|
487
|
+
|
488
|
+
<div class="method-heading">
|
489
|
+
<a href="Session.src/M000022.html" target="Code" class="method-signature"
|
490
|
+
onclick="popupCode('Session.src/M000022.html');return false;">
|
491
|
+
<span class="method-name">default_prompt</span><span class="method-args">()</span>
|
492
|
+
</a>
|
493
|
+
</div>
|
494
|
+
|
495
|
+
<div class="method-description">
|
496
|
+
<p>
|
497
|
+
Specifies the default value of the prompt attribute. This returns the
|
498
|
+
default pattern that cmd will wait for. This is user dependent. Possible
|
499
|
+
improvements:
|
500
|
+
</p>
|
501
|
+
<ul>
|
502
|
+
<li>include the host name
|
503
|
+
|
504
|
+
</li>
|
505
|
+
<li>include the current working directory.
|
506
|
+
|
507
|
+
</li>
|
508
|
+
</ul>
|
509
|
+
<p>
|
510
|
+
Tested only under OS X, where the prompt for root ends with # instead of $
|
511
|
+
The root prompt is used if the script is invoked with sudo TBD: there is
|
512
|
+
probably a better way to get this from the OS, rather than guessing it.
|
513
|
+
</p>
|
514
|
+
</div>
|
515
|
+
</div>
|
516
|
+
|
517
|
+
<div id="method-M000021" class="method-detail">
|
518
|
+
<a name="M000021"></a>
|
519
|
+
|
520
|
+
<div class="method-heading">
|
521
|
+
<a href="Session.src/M000021.html" target="Code" class="method-signature"
|
522
|
+
onclick="popupCode('Session.src/M000021.html');return false;">
|
523
|
+
<span class="method-name">new</span><span class="method-args">()</span>
|
524
|
+
</a>
|
525
|
+
</div>
|
526
|
+
|
527
|
+
<div class="method-description">
|
528
|
+
<p>
|
529
|
+
<a href="Session.html#M000021">new</a> does not make the instance usable:
|
530
|
+
it needs to <a href="Session.html#M000016">spawn</a> first. After you
|
531
|
+
create an instance you can tweak its attributes before spawning.
|
532
|
+
</p>
|
533
|
+
</div>
|
534
|
+
</div>
|
535
|
+
|
536
|
+
<div id="method-M000016" class="method-detail">
|
537
|
+
<a name="M000016"></a>
|
538
|
+
|
539
|
+
<div class="method-heading">
|
540
|
+
<a href="Session.src/M000016.html" target="Code" class="method-signature"
|
541
|
+
onclick="popupCode('Session.src/M000016.html');return false;">
|
542
|
+
<span class="method-name">spawn</span><span class="method-args">(program)</span>
|
543
|
+
</a>
|
544
|
+
</div>
|
545
|
+
|
546
|
+
<div class="method-description">
|
547
|
+
<p>
|
548
|
+
Spawn a new process, executing the indicated program, and create a new
|
549
|
+
instance that communicates with the process. Use <a
|
550
|
+
href="Session.html#M000021">new</a> instead if you want to adjust the
|
551
|
+
attributes.
|
552
|
+
</p>
|
553
|
+
</div>
|
554
|
+
</div>
|
555
|
+
|
556
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
557
|
+
|
558
|
+
<div id="method-M000039" class="method-detail">
|
559
|
+
<a name="M000039"></a>
|
560
|
+
|
561
|
+
<div class="method-heading">
|
562
|
+
<span class="method-name">answer</span><span class="method-args">(response)</span>
|
563
|
+
</div>
|
564
|
+
|
565
|
+
<div class="method-description">
|
566
|
+
<p>
|
567
|
+
Alias for <a href="Session.html#M000038">respond</a>
|
568
|
+
</p>
|
569
|
+
</div>
|
570
|
+
</div>
|
571
|
+
|
572
|
+
<div id="method-M000054" class="method-detail">
|
573
|
+
<a name="M000054"></a>
|
574
|
+
|
575
|
+
<div class="method-heading">
|
576
|
+
<a href="Session.src/M000054.html" target="Code" class="method-signature"
|
577
|
+
onclick="popupCode('Session.src/M000054.html');return false;">
|
578
|
+
<span class="method-name">archive_type</span><span class="method-args">(fName)</span>
|
579
|
+
</a>
|
580
|
+
</div>
|
581
|
+
|
582
|
+
<div class="method-description">
|
583
|
+
<p>
|
584
|
+
Examines the extension of a file name or URL to determine the type of
|
585
|
+
archive. Returns a two element array containing:
|
586
|
+
</p>
|
587
|
+
<pre>
|
588
|
+
result[0] = the extension
|
589
|
+
result[1] = gnutar decompression option
|
590
|
+
</pre>
|
591
|
+
</div>
|
592
|
+
</div>
|
593
|
+
|
594
|
+
<div id="method-M000066" class="method-detail">
|
595
|
+
<a name="M000066"></a>
|
596
|
+
|
597
|
+
<div class="method-heading">
|
598
|
+
<a href="Session.src/M000066.html" target="Code" class="method-signature"
|
599
|
+
onclick="popupCode('Session.src/M000066.html');return false;">
|
600
|
+
<span class="method-name">banner</span><span class="method-args">(what)</span>
|
601
|
+
</a>
|
602
|
+
</div>
|
603
|
+
|
604
|
+
<div class="method-description">
|
605
|
+
<p>
|
606
|
+
Display a banner on both the console and the transcript. The banner
|
607
|
+
contains the specified text. It may also have a timestamp (if
|
608
|
+
@time_stamp_banners is true).
|
609
|
+
</p>
|
610
|
+
</div>
|
611
|
+
</div>
|
612
|
+
|
613
|
+
<div id="method-M000025" class="method-detail">
|
614
|
+
<a name="M000025"></a>
|
615
|
+
|
616
|
+
<div class="method-heading">
|
617
|
+
<a href="Session.src/M000025.html" target="Code" class="method-signature"
|
618
|
+
onclick="popupCode('Session.src/M000025.html');return false;">
|
619
|
+
<span class="method-name">build_default_dir_hash</span><span class="method-args">()</span>
|
620
|
+
</a>
|
621
|
+
</div>
|
622
|
+
|
623
|
+
<div class="method-description">
|
624
|
+
<p>
|
625
|
+
Constructs @dir_hash from @url_hash
|
626
|
+
</p>
|
627
|
+
</div>
|
628
|
+
</div>
|
629
|
+
|
630
|
+
<div id="method-M000056" class="method-detail">
|
631
|
+
<a name="M000056"></a>
|
632
|
+
|
633
|
+
<div class="method-heading">
|
634
|
+
<a href="Session.src/M000056.html" target="Code" class="method-signature"
|
635
|
+
onclick="popupCode('Session.src/M000056.html');return false;">
|
636
|
+
<span class="method-name">cd</span><span class="method-args">(nameSymbol, *more) {|| ...}</span>
|
637
|
+
</a>
|
638
|
+
</div>
|
639
|
+
|
640
|
+
<div class="method-description">
|
641
|
+
<p>
|
642
|
+
Set the working directory (both the shell’s via :command, and Ruby
|
643
|
+
via FileUtils::cd) to a specified value. Several types of argument are
|
644
|
+
acceptable:
|
645
|
+
</p>
|
646
|
+
<ul>
|
647
|
+
<li>’-’ which returns to the previous directory
|
648
|
+
|
649
|
+
</li>
|
650
|
+
<li>A <a href="../String.html">String</a> path (relative or absolute)
|
651
|
+
|
652
|
+
</li>
|
653
|
+
<li>A Symbol previously associated with a path in dir_hash
|
654
|
+
|
655
|
+
</li>
|
656
|
+
</ul>
|
657
|
+
<p>
|
658
|
+
dir_hash is setup by
|
659
|
+
</p>
|
660
|
+
<ul>
|
661
|
+
<li>cd! which you invoke at your discretion
|
662
|
+
|
663
|
+
</li>
|
664
|
+
<li><a href="Session.html#M000025">build_default_dir_hash</a>, which is called
|
665
|
+
by :prepare during :spawn. This method adds to dir_hash keys that are
|
666
|
+
present in url_hash, but missing from dir_hash. The values are derived by
|
667
|
+
dirName.
|
668
|
+
|
669
|
+
</li>
|
670
|
+
</ul>
|
671
|
+
<p>
|
672
|
+
This method can be fed an optional block. The new directory is set before
|
673
|
+
the block executes, and the original directory is restored after the block
|
674
|
+
has finished. The previous_directory is also restored, so that a subsequent
|
675
|
+
"cd ’-’" takes you to the directory before this
|
676
|
+
method executed (instead of the one specified here).
|
677
|
+
</p>
|
678
|
+
<p>
|
679
|
+
Unlike the bash command, this takes any number of arguments which it
|
680
|
+
assembles with the appropriate separator into a single path. Also unlike
|
681
|
+
bash, it raises an exception if the argument does not correspond to a
|
682
|
+
reachable directory.
|
683
|
+
</p>
|
684
|
+
</div>
|
685
|
+
</div>
|
686
|
+
|
687
|
+
<div id="method-M000055" class="method-detail">
|
688
|
+
<a name="M000055"></a>
|
689
|
+
|
690
|
+
<div class="method-heading">
|
691
|
+
<a href="Session.src/M000055.html" target="Code" class="method-signature"
|
692
|
+
onclick="popupCode('Session.src/M000055.html');return false;">
|
693
|
+
<span class="method-name">cd!</span><span class="method-args">(nameSymbol, directory=FileUtils::pwd)</span>
|
694
|
+
</a>
|
695
|
+
</div>
|
696
|
+
|
697
|
+
<div class="method-description">
|
698
|
+
<p>
|
699
|
+
Associate a directory with nameSymbol, so that you can go there using
|
700
|
+
‘cd nameSymbol’. Does not change the current directory.
|
701
|
+
directory can be absolute or relative. If it is relative, it is made
|
702
|
+
absolute based on the current working directory.
|
703
|
+
</p>
|
704
|
+
</div>
|
705
|
+
</div>
|
706
|
+
|
707
|
+
<div id="method-M000057" class="method-detail">
|
708
|
+
<a name="M000057"></a>
|
709
|
+
|
710
|
+
<div class="method-heading">
|
711
|
+
<a href="Session.src/M000057.html" target="Code" class="method-signature"
|
712
|
+
onclick="popupCode('Session.src/M000057.html');return false;">
|
713
|
+
<span class="method-name">chmod</span><span class="method-args">(mode, list, *args)</span>
|
714
|
+
</a>
|
715
|
+
</div>
|
716
|
+
|
717
|
+
<div class="method-description">
|
718
|
+
<p>
|
719
|
+
Change permissions
|
720
|
+
</p>
|
721
|
+
</div>
|
722
|
+
</div>
|
723
|
+
|
724
|
+
<div id="method-M000045" class="method-detail">
|
725
|
+
<a name="M000045"></a>
|
726
|
+
|
727
|
+
<div class="method-heading">
|
728
|
+
<span class="method-name">cmd</span><span class="method-args">(command, maxSeconds=nil, silentlyIgnoreNonzeroExitStatus=false)</span>
|
729
|
+
</div>
|
730
|
+
|
731
|
+
<div class="method-description">
|
732
|
+
<p>
|
733
|
+
Alias for <a href="Session.html#M000044">command</a>
|
734
|
+
</p>
|
735
|
+
</div>
|
736
|
+
</div>
|
737
|
+
|
738
|
+
<div id="method-M000064" class="method-detail">
|
739
|
+
<a name="M000064"></a>
|
740
|
+
|
741
|
+
<div class="method-heading">
|
742
|
+
<a href="Session.src/M000064.html" target="Code" class="method-signature"
|
743
|
+
onclick="popupCode('Session.src/M000064.html');return false;">
|
744
|
+
<span class="method-name">cmp</span><span class="method-args">(a, b, silent=true)</span>
|
745
|
+
</a>
|
746
|
+
</div>
|
747
|
+
|
748
|
+
<div class="method-description">
|
749
|
+
<p>
|
750
|
+
Return a Boolean, true if files have identical contents.
|
751
|
+
</p>
|
752
|
+
</div>
|
753
|
+
</div>
|
754
|
+
|
755
|
+
<div id="method-M000044" class="method-detail">
|
756
|
+
<a name="M000044"></a>
|
757
|
+
|
758
|
+
<div class="method-heading">
|
759
|
+
<a href="Session.src/M000044.html" target="Code" class="method-signature"
|
760
|
+
onclick="popupCode('Session.src/M000044.html');return false;">
|
761
|
+
<span class="method-name">command</span><span class="method-args">(command, maxSeconds=nil, silentlyIgnoreNonzeroExitStatus=false)</span>
|
762
|
+
</a>
|
763
|
+
</div>
|
764
|
+
|
765
|
+
<div class="method-description">
|
766
|
+
<p>
|
767
|
+
Send a string to the spawned process. If maxSeconds is specified, the
|
768
|
+
command will block until finished. If maxSedonds is not specified, or nil,
|
769
|
+
you can :expect and :reply. Each invocation rewrites the error log (which
|
770
|
+
is copied to transcript).
|
771
|
+
</p>
|
772
|
+
</div>
|
773
|
+
</div>
|
774
|
+
|
775
|
+
<div id="method-M000058" class="method-detail">
|
776
|
+
<a name="M000058"></a>
|
777
|
+
|
778
|
+
<div class="method-heading">
|
779
|
+
<a href="Session.src/M000058.html" target="Code" class="method-signature"
|
780
|
+
onclick="popupCode('Session.src/M000058.html');return false;">
|
781
|
+
<span class="method-name">cp</span><span class="method-args">(src, dest, *args)</span>
|
782
|
+
</a>
|
783
|
+
</div>
|
784
|
+
|
785
|
+
<div class="method-description">
|
786
|
+
<p>
|
787
|
+
Copies a file(s) src to dest. If dest is a directory, copies src to
|
788
|
+
dest/src. src can be a list or a directory: unlike bash, you don’t
|
789
|
+
need a -r for directories. Also unlike bash (but like FileUtils::cp_r) you
|
790
|
+
use ’.’ as a wildcard instead of ’*’ when you want
|
791
|
+
to copy all files in directory.
|
792
|
+
</p>
|
793
|
+
</div>
|
794
|
+
</div>
|
795
|
+
|
796
|
+
<div id="method-M000069" class="method-detail">
|
797
|
+
<a name="M000069"></a>
|
798
|
+
|
799
|
+
<div class="method-heading">
|
800
|
+
<a href="Session.src/M000069.html" target="Code" class="method-signature"
|
801
|
+
onclick="popupCode('Session.src/M000069.html');return false;">
|
802
|
+
<span class="method-name">curl</span><span class="method-args">(url, maxSeconds=60*10)</span>
|
803
|
+
</a>
|
804
|
+
</div>
|
805
|
+
|
806
|
+
<div class="method-description">
|
807
|
+
<p>
|
808
|
+
Download the file specified by the given URL or symbolic name (if it has
|
809
|
+
not already been downloaded). You need to have curl installed.
|
810
|
+
</p>
|
811
|
+
</div>
|
812
|
+
</div>
|
813
|
+
|
814
|
+
<div id="method-M000052" class="method-detail">
|
815
|
+
<a name="M000052"></a>
|
816
|
+
|
817
|
+
<div class="method-heading">
|
818
|
+
<a href="Session.src/M000052.html" target="Code" class="method-signature"
|
819
|
+
onclick="popupCode('Session.src/M000052.html');return false;">
|
820
|
+
<span class="method-name">d</span><span class="method-args">(input, silent=false)</span>
|
821
|
+
</a>
|
822
|
+
</div>
|
823
|
+
|
824
|
+
<div class="method-description">
|
825
|
+
<p>
|
826
|
+
Similar to <a href="Session.html#M000048">resolve_dir</a>, but further
|
827
|
+
processes <a href="../String.html">String</a> inputs to remove the
|
828
|
+
extension and the leading path. Similar to dirName, but accepts Array
|
829
|
+
inputs, and attempts to look up dir in dir_hash. Returns a local directory.
|
830
|
+
</p>
|
831
|
+
</div>
|
832
|
+
</div>
|
833
|
+
|
834
|
+
<div id="method-M000019" class="method-detail">
|
835
|
+
<a name="M000019"></a>
|
836
|
+
|
837
|
+
<div class="method-heading">
|
838
|
+
<a href="Session.src/M000019.html" target="Code" class="method-signature"
|
839
|
+
onclick="popupCode('Session.src/M000019.html');return false;">
|
840
|
+
<span class="method-name">default_error_log_path</span><span class="method-args">()</span>
|
841
|
+
</a>
|
842
|
+
</div>
|
843
|
+
|
844
|
+
<div class="method-description">
|
845
|
+
<p>
|
846
|
+
Guesses where to put the error log
|
847
|
+
</p>
|
848
|
+
</div>
|
849
|
+
</div>
|
850
|
+
|
851
|
+
<div id="method-M000020" class="method-detail">
|
852
|
+
<a name="M000020"></a>
|
853
|
+
|
854
|
+
<div class="method-heading">
|
855
|
+
<a href="Session.src/M000020.html" target="Code" class="method-signature"
|
856
|
+
onclick="popupCode('Session.src/M000020.html');return false;">
|
857
|
+
<span class="method-name">default_exit_status_path</span><span class="method-args">()</span>
|
858
|
+
</a>
|
859
|
+
</div>
|
860
|
+
|
861
|
+
<div class="method-description">
|
862
|
+
<p>
|
863
|
+
Guesses where to put the error status collection file.
|
864
|
+
</p>
|
865
|
+
</div>
|
866
|
+
</div>
|
867
|
+
|
868
|
+
<div id="method-M000023" class="method-detail">
|
869
|
+
<a name="M000023"></a>
|
870
|
+
|
871
|
+
<div class="method-heading">
|
872
|
+
<a href="Session.src/M000023.html" target="Code" class="method-signature"
|
873
|
+
onclick="popupCode('Session.src/M000023.html');return false;">
|
874
|
+
<span class="method-name">default_prompt</span><span class="method-args">()</span>
|
875
|
+
</a>
|
876
|
+
</div>
|
877
|
+
|
878
|
+
<div class="method-description">
|
879
|
+
<p>
|
880
|
+
Instance side behavior of class method with same name.
|
881
|
+
</p>
|
882
|
+
</div>
|
883
|
+
</div>
|
884
|
+
|
885
|
+
<div id="method-M000018" class="method-detail">
|
886
|
+
<a name="M000018"></a>
|
887
|
+
|
888
|
+
<div class="method-heading">
|
889
|
+
<a href="Session.src/M000018.html" target="Code" class="method-signature"
|
890
|
+
onclick="popupCode('Session.src/M000018.html');return false;">
|
891
|
+
<span class="method-name">default_time_log_path</span><span class="method-args">()</span>
|
892
|
+
</a>
|
893
|
+
</div>
|
894
|
+
|
895
|
+
<div class="method-description">
|
896
|
+
<p>
|
897
|
+
Guesses where to put the time log.
|
898
|
+
</p>
|
899
|
+
</div>
|
900
|
+
</div>
|
901
|
+
|
902
|
+
<div id="method-M000035" class="method-detail">
|
903
|
+
<a name="M000035"></a>
|
904
|
+
|
905
|
+
<div class="method-heading">
|
906
|
+
<a href="Session.src/M000035.html" target="Code" class="method-signature"
|
907
|
+
onclick="popupCode('Session.src/M000035.html');return false;">
|
908
|
+
<span class="method-name">die</span><span class="method-args">(maxSeconds=1)</span>
|
909
|
+
</a>
|
910
|
+
</div>
|
911
|
+
|
912
|
+
<div class="method-description">
|
913
|
+
<p>
|
914
|
+
Attempts to kill the pocess with SIGTERM. If the process has not terminated
|
915
|
+
by maxSeconds, follows up with SIGKILL.
|
916
|
+
</p>
|
917
|
+
</div>
|
918
|
+
</div>
|
919
|
+
|
920
|
+
<div id="method-M000050" class="method-detail">
|
921
|
+
<a name="M000050"></a>
|
922
|
+
|
923
|
+
<div class="method-heading">
|
924
|
+
<a href="Session.src/M000050.html" target="Code" class="method-signature"
|
925
|
+
onclick="popupCode('Session.src/M000050.html');return false;">
|
926
|
+
<span class="method-name">dirName</span><span class="method-args">(url, silent=false)</span>
|
927
|
+
</a>
|
928
|
+
</div>
|
929
|
+
|
930
|
+
<div class="method-description">
|
931
|
+
<p>
|
932
|
+
Given a symoblic name of an entry in url_hash, or an URL that points to a
|
933
|
+
.tgz or .tar.gz file, return the relative directory expected to result from
|
934
|
+
untgz, by removing the extension and the path leading up to the file name.
|
935
|
+
Return this result, unless it is a key into dir_override, in which case the
|
936
|
+
corresponding value is returned. If an overide is specified in dir_overide,
|
937
|
+
that is used instead.
|
938
|
+
</p>
|
939
|
+
</div>
|
940
|
+
</div>
|
941
|
+
|
942
|
+
<div id="method-M000070" class="method-detail">
|
943
|
+
<a name="M000070"></a>
|
944
|
+
|
945
|
+
<div class="method-heading">
|
946
|
+
<a href="Session.src/M000070.html" target="Code" class="method-signature"
|
947
|
+
onclick="popupCode('Session.src/M000070.html');return false;">
|
948
|
+
<span class="method-name">env</span><span class="method-args">(name, value, forceValue=false, warning=true)</span>
|
949
|
+
</a>
|
950
|
+
</div>
|
951
|
+
|
952
|
+
<div class="method-description">
|
953
|
+
<p>
|
954
|
+
Sets the named environmental variable for use during the session,
|
955
|
+
optionally warning the user to make a more permanent setting. If warn is
|
956
|
+
false, the user is not asked to make any changes. This is useful for
|
957
|
+
settings that are necessary only for compilation.
|
958
|
+
</p>
|
959
|
+
<p>
|
960
|
+
If forceValue is false, any previously value is acceptable, so an existing
|
961
|
+
value is not changed. In this case the user is not asked to do anything
|
962
|
+
unless the value is undefined.
|
963
|
+
</p>
|
964
|
+
<p>
|
965
|
+
If forceValue is true, only the provided value is acceptable. The
|
966
|
+
environmental variable will be changed if necessary. If it is changed, and
|
967
|
+
warning==true, the user is advised change the value.
|
968
|
+
</p>
|
969
|
+
<p>
|
970
|
+
If value is nil, the environmental variable is unset. In this case
|
971
|
+
forceValue and warning have no effect.
|
972
|
+
</p>
|
973
|
+
<p>
|
974
|
+
Returns the final value of the named environmental variable. (an empty <a
|
975
|
+
href="../String.html">String</a> if the value is unset).
|
976
|
+
</p>
|
977
|
+
<p>
|
978
|
+
Note that OS X is smart enough to give you access to these when you sudo.
|
979
|
+
You can readily prove this by executing in a bash shell ‘export
|
980
|
+
AnswerToEverything=42’ and then executing ‘sudo echo
|
981
|
+
$AnswerToEverything‘
|
982
|
+
</p>
|
983
|
+
</div>
|
984
|
+
</div>
|
985
|
+
|
986
|
+
<div id="method-M000071" class="method-detail">
|
987
|
+
<a name="M000071"></a>
|
988
|
+
|
989
|
+
<div class="method-heading">
|
990
|
+
<a href="Session.src/M000071.html" target="Code" class="method-signature"
|
991
|
+
onclick="popupCode('Session.src/M000071.html');return false;">
|
992
|
+
<span class="method-name">env_path</span><span class="method-args">(name, value, warning=true, sep=':')</span>
|
993
|
+
</a>
|
994
|
+
</div>
|
995
|
+
|
996
|
+
<div class="method-description">
|
997
|
+
<p>
|
998
|
+
Sets the named environmental path variable to include value (for use during
|
999
|
+
the session), optionally warning the user to make a more permanent setting.
|
1000
|
+
</p>
|
1001
|
+
<p>
|
1002
|
+
If the path is not defined at all, this will define it. If the path is
|
1003
|
+
defined, and contains value, nothing happens. If the path is defined but
|
1004
|
+
does not contain value,this prefixes value onto the path.
|
1005
|
+
</p>
|
1006
|
+
</div>
|
1007
|
+
</div>
|
1008
|
+
|
1009
|
+
<div id="method-M000043" class="method-detail">
|
1010
|
+
<a name="M000043"></a>
|
1011
|
+
|
1012
|
+
<div class="method-heading">
|
1013
|
+
<a href="Session.src/M000043.html" target="Code" class="method-signature"
|
1014
|
+
onclick="popupCode('Session.src/M000043.html');return false;">
|
1015
|
+
<span class="method-name">expect</span><span class="method-args">(pat, maxSeconds=60, silentlyContinueAfterTimeout=false)</span>
|
1016
|
+
</a>
|
1017
|
+
</div>
|
1018
|
+
|
1019
|
+
<div class="method-description">
|
1020
|
+
<p>
|
1021
|
+
Expect the spawned process to produce some output. pat can be a <a
|
1022
|
+
href="../String.html">String</a>, a <a href="../Regexp.html">Regexp</a>, or
|
1023
|
+
a Hash (keys identify patterns, values are Strings or <a
|
1024
|
+
href="../Regexp.html">Regexp</a>). Raises an exception if no match occurs,
|
1025
|
+
unless silentlyContinueAfterTimeout is true. If a match does occur, returns
|
1026
|
+
an Array:
|
1027
|
+
</p>
|
1028
|
+
<pre>
|
1029
|
+
result[0]=key for pattern that matched (:expected if pat is a String or Regexp)
|
1030
|
+
result[1]=match result
|
1031
|
+
</pre>
|
1032
|
+
</div>
|
1033
|
+
</div>
|
1034
|
+
|
1035
|
+
<div id="method-M000053" class="method-detail">
|
1036
|
+
<a name="M000053"></a>
|
1037
|
+
|
1038
|
+
<div class="method-heading">
|
1039
|
+
<a href="Session.src/M000053.html" target="Code" class="method-signature"
|
1040
|
+
onclick="popupCode('Session.src/M000053.html');return false;">
|
1041
|
+
<span class="method-name">f</span><span class="method-args">(input, silent=false)</span>
|
1042
|
+
</a>
|
1043
|
+
</div>
|
1044
|
+
|
1045
|
+
<div class="method-description">
|
1046
|
+
<p>
|
1047
|
+
Similar to <a href="Session.html#M000049">resolve_file</a>, but further
|
1048
|
+
processes <a href="../String.html">String</a> inputs to remove the leading
|
1049
|
+
path. Similar to fileName, but accepts Array inputs. Returns a local
|
1050
|
+
directory.
|
1051
|
+
</p>
|
1052
|
+
</div>
|
1053
|
+
</div>
|
1054
|
+
|
1055
|
+
<div id="method-M000051" class="method-detail">
|
1056
|
+
<a name="M000051"></a>
|
1057
|
+
|
1058
|
+
<div class="method-heading">
|
1059
|
+
<a href="Session.src/M000051.html" target="Code" class="method-signature"
|
1060
|
+
onclick="popupCode('Session.src/M000051.html');return false;">
|
1061
|
+
<span class="method-name">fileName</span><span class="method-args">(url, silent=false)</span>
|
1062
|
+
</a>
|
1063
|
+
</div>
|
1064
|
+
|
1065
|
+
<div class="method-description">
|
1066
|
+
<p>
|
1067
|
+
Given a symbolic name of an entry in url_hash, or an URL that refers to a
|
1068
|
+
file, return the relative name of the file, by removing the path leading up
|
1069
|
+
to the file name, but keeping the extension.
|
1070
|
+
</p>
|
1071
|
+
</div>
|
1072
|
+
</div>
|
1073
|
+
|
1074
|
+
<div id="method-M000046" class="method-detail">
|
1075
|
+
<a name="M000046"></a>
|
1076
|
+
|
1077
|
+
<div class="method-heading">
|
1078
|
+
<a href="Session.src/M000046.html" target="Code" class="method-signature"
|
1079
|
+
onclick="popupCode('Session.src/M000046.html');return false;">
|
1080
|
+
<span class="method-name">finish</span><span class="method-args">(maxSeconds=60, hasErrLog=true, doTimeLog=true)</span>
|
1081
|
+
</a>
|
1082
|
+
</div>
|
1083
|
+
|
1084
|
+
<div class="method-description">
|
1085
|
+
<p>
|
1086
|
+
Finish executing the most recent <a
|
1087
|
+
href="Session.html#M000044">command</a>. If this has already been called
|
1088
|
+
since the most recent <a href="Session.html#M000044">command</a> started,
|
1089
|
+
does nothing. Otherwise it blocks until the shell issues a prompt. You
|
1090
|
+
usually don’t need to explicitly call this, because it’s done
|
1091
|
+
automatically. When a <a href="Session.html#M000044">command</a> has
|
1092
|
+
maxSeconds, this is called automatically. When a <a
|
1093
|
+
href="Session.html#M000044">command</a> does not have maxSeconds (so that
|
1094
|
+
<a href="Session.html#M000043">expect</a> can be called), the subsequent <a
|
1095
|
+
href="Session.html#M000044">command</a> will call this before issuing
|
1096
|
+
itself to the shell. If you ask the shell to die, it will also call this
|
1097
|
+
(in case the previous <a href="Session.html#M000044">command</a> was called
|
1098
|
+
without maxSeconds).
|
1099
|
+
</p>
|
1100
|
+
</div>
|
1101
|
+
</div>
|
1102
|
+
|
1103
|
+
<div id="method-M000027" class="method-detail">
|
1104
|
+
<a name="M000027"></a>
|
1105
|
+
|
1106
|
+
<div class="method-heading">
|
1107
|
+
<a href="Session.src/M000027.html" target="Code" class="method-signature"
|
1108
|
+
onclick="popupCode('Session.src/M000027.html');return false;">
|
1109
|
+
<span class="method-name">get_password</span><span class="method-args">()</span>
|
1110
|
+
</a>
|
1111
|
+
</div>
|
1112
|
+
|
1113
|
+
<div class="method-description">
|
1114
|
+
<p>
|
1115
|
+
Prompts the user for password and saves it in the @passsword attribute, in
|
1116
|
+
order to provide it to ‘sudo’.
|
1117
|
+
</p>
|
1118
|
+
</div>
|
1119
|
+
</div>
|
1120
|
+
|
1121
|
+
<div id="method-M000029" class="method-detail">
|
1122
|
+
<a name="M000029"></a>
|
1123
|
+
|
1124
|
+
<div class="method-heading">
|
1125
|
+
<a href="Session.src/M000029.html" target="Code" class="method-signature"
|
1126
|
+
onclick="popupCode('Session.src/M000029.html');return false;">
|
1127
|
+
<span class="method-name">inverse_scaled_seconds</span><span class="method-args">(limit)</span>
|
1128
|
+
</a>
|
1129
|
+
</div>
|
1130
|
+
|
1131
|
+
<div class="method-description">
|
1132
|
+
<p>
|
1133
|
+
Given a scaled time, return an unscaled time. This is the inverse of <a
|
1134
|
+
href="Session.html#M000028">scaled_seconds</a>
|
1135
|
+
</p>
|
1136
|
+
</div>
|
1137
|
+
</div>
|
1138
|
+
|
1139
|
+
<div id="method-M000036" class="method-detail">
|
1140
|
+
<a name="M000036"></a>
|
1141
|
+
|
1142
|
+
<div class="method-heading">
|
1143
|
+
<a href="Session.src/M000036.html" target="Code" class="method-signature"
|
1144
|
+
onclick="popupCode('Session.src/M000036.html');return false;">
|
1145
|
+
<span class="method-name">kill</span><span class="method-args">( signal='SIGTERM', maxSeconds=1)</span>
|
1146
|
+
</a>
|
1147
|
+
</div>
|
1148
|
+
|
1149
|
+
<div class="method-description">
|
1150
|
+
<p>
|
1151
|
+
Send a signal to the spawned process. ‘SIGTERM’ is polite, but
|
1152
|
+
not guaranteed to stop the process. ‘SIGKILL’ is guaranteed to
|
1153
|
+
stop the process
|
1154
|
+
</p>
|
1155
|
+
</div>
|
1156
|
+
</div>
|
1157
|
+
|
1158
|
+
<div id="method-M000030" class="method-detail">
|
1159
|
+
<a name="M000030"></a>
|
1160
|
+
|
1161
|
+
<div class="method-heading">
|
1162
|
+
<a href="Session.src/M000030.html" target="Code" class="method-signature"
|
1163
|
+
onclick="popupCode('Session.src/M000030.html');return false;">
|
1164
|
+
<span class="method-name">limit</span><span class="method-args">(measuredSeconds, &block)</span>
|
1165
|
+
</a>
|
1166
|
+
</div>
|
1167
|
+
|
1168
|
+
<div class="method-description">
|
1169
|
+
<p>
|
1170
|
+
Execute block under a time limit (which gets scaled).
|
1171
|
+
</p>
|
1172
|
+
</div>
|
1173
|
+
</div>
|
1174
|
+
|
1175
|
+
<div id="method-M000059" class="method-detail">
|
1176
|
+
<a name="M000059"></a>
|
1177
|
+
|
1178
|
+
<div class="method-heading">
|
1179
|
+
<a href="Session.src/M000059.html" target="Code" class="method-signature"
|
1180
|
+
onclick="popupCode('Session.src/M000059.html');return false;">
|
1181
|
+
<span class="method-name">ln</span><span class="method-args">(old, new, *args)</span>
|
1182
|
+
</a>
|
1183
|
+
</div>
|
1184
|
+
|
1185
|
+
<div class="method-description">
|
1186
|
+
<p>
|
1187
|
+
Creates a hard link new which points to old. If new already exists and it
|
1188
|
+
is a directory, creates a symbolic link new/old
|
1189
|
+
</p>
|
1190
|
+
</div>
|
1191
|
+
</div>
|
1192
|
+
|
1193
|
+
<div id="method-M000060" class="method-detail">
|
1194
|
+
<a name="M000060"></a>
|
1195
|
+
|
1196
|
+
<div class="method-heading">
|
1197
|
+
<a href="Session.src/M000060.html" target="Code" class="method-signature"
|
1198
|
+
onclick="popupCode('Session.src/M000060.html');return false;">
|
1199
|
+
<span class="method-name">ln_sf</span><span class="method-args">(old, new, *args)</span>
|
1200
|
+
</a>
|
1201
|
+
</div>
|
1202
|
+
|
1203
|
+
<div class="method-description">
|
1204
|
+
<p>
|
1205
|
+
Creates a symbolic link new which points to old. If new already exists and
|
1206
|
+
it is a directory, creates a symbolic link new/old. If new already exists
|
1207
|
+
and is a link, replaces it.
|
1208
|
+
</p>
|
1209
|
+
</div>
|
1210
|
+
</div>
|
1211
|
+
|
1212
|
+
<div id="method-M000033" class="method-detail">
|
1213
|
+
<a name="M000033"></a>
|
1214
|
+
|
1215
|
+
<div class="method-heading">
|
1216
|
+
<a href="Session.src/M000033.html" target="Code" class="method-signature"
|
1217
|
+
onclick="popupCode('Session.src/M000033.html');return false;">
|
1218
|
+
<span class="method-name">log</span><span class="method-args">(type, string, *args)</span>
|
1219
|
+
</a>
|
1220
|
+
</div>
|
1221
|
+
|
1222
|
+
<div class="method-description">
|
1223
|
+
<p>
|
1224
|
+
Write a string onto the @transcript. The string can take optional arguments
|
1225
|
+
along the lines of printf. A prefix that describes the type of string is
|
1226
|
+
applied.
|
1227
|
+
</p>
|
1228
|
+
</div>
|
1229
|
+
</div>
|
1230
|
+
|
1231
|
+
<div id="method-M000042" class="method-detail">
|
1232
|
+
<a name="M000042"></a>
|
1233
|
+
|
1234
|
+
<div class="method-heading">
|
1235
|
+
<a href="Session.src/M000042.html" target="Code" class="method-signature"
|
1236
|
+
onclick="popupCode('Session.src/M000042.html');return false;">
|
1237
|
+
<span class="method-name">log_output</span><span class="method-args">(line)</span>
|
1238
|
+
</a>
|
1239
|
+
</div>
|
1240
|
+
|
1241
|
+
<div class="method-description">
|
1242
|
+
<p>
|
1243
|
+
Log some output from the spawned process.
|
1244
|
+
</p>
|
1245
|
+
</div>
|
1246
|
+
</div>
|
1247
|
+
|
1248
|
+
<div id="method-M000031" class="method-detail">
|
1249
|
+
<a name="M000031"></a>
|
1250
|
+
|
1251
|
+
<div class="method-heading">
|
1252
|
+
<a href="Session.src/M000031.html" target="Code" class="method-signature"
|
1253
|
+
onclick="popupCode('Session.src/M000031.html');return false;">
|
1254
|
+
<span class="method-name">log_time</span><span class="method-args">(description, doLog=true) {|unless time_log_path && doLog| ...}</span>
|
1255
|
+
</a>
|
1256
|
+
</div>
|
1257
|
+
|
1258
|
+
<div class="method-description">
|
1259
|
+
<p>
|
1260
|
+
Logs execution time of block, if @time_log_path is specified. Without
|
1261
|
+
@time_log_path, executes block without timing it. In either case, returns
|
1262
|
+
the block result.
|
1263
|
+
</p>
|
1264
|
+
</div>
|
1265
|
+
</div>
|
1266
|
+
|
1267
|
+
<div id="method-M000065" class="method-detail">
|
1268
|
+
<a name="M000065"></a>
|
1269
|
+
|
1270
|
+
<div class="method-heading">
|
1271
|
+
<a href="Session.src/M000065.html" target="Code" class="method-signature"
|
1272
|
+
onclick="popupCode('Session.src/M000065.html');return false;">
|
1273
|
+
<span class="method-name">mangle</span><span class="method-args">(input, changes, output=nil, silent=false)</span>
|
1274
|
+
</a>
|
1275
|
+
</div>
|
1276
|
+
|
1277
|
+
<div class="method-description">
|
1278
|
+
<p>
|
1279
|
+
Load the input file into memory, make the specified changes, and write the
|
1280
|
+
modified file to output. If output is nil, replace the input file. Changes
|
1281
|
+
is a hash: keys are <a href="../String.html">String</a> or <a
|
1282
|
+
href="../Regexp.html">Regexp</a> patterns to be globally replaced, values
|
1283
|
+
are <a href="../String.html">String</a> replacement values.
|
1284
|
+
</p>
|
1285
|
+
</div>
|
1286
|
+
</div>
|
1287
|
+
|
1288
|
+
<div id="method-M000061" class="method-detail">
|
1289
|
+
<a name="M000061"></a>
|
1290
|
+
|
1291
|
+
<div class="method-heading">
|
1292
|
+
<a href="Session.src/M000061.html" target="Code" class="method-signature"
|
1293
|
+
onclick="popupCode('Session.src/M000061.html');return false;">
|
1294
|
+
<span class="method-name">mkdir</span><span class="method-args">(list, *args)</span>
|
1295
|
+
</a>
|
1296
|
+
</div>
|
1297
|
+
|
1298
|
+
<div class="method-description">
|
1299
|
+
<p>
|
1300
|
+
Creates one or more directories (including any necessary parent
|
1301
|
+
directories)
|
1302
|
+
</p>
|
1303
|
+
</div>
|
1304
|
+
</div>
|
1305
|
+
|
1306
|
+
<div id="method-M000062" class="method-detail">
|
1307
|
+
<a name="M000062"></a>
|
1308
|
+
|
1309
|
+
<div class="method-heading">
|
1310
|
+
<a href="Session.src/M000062.html" target="Code" class="method-signature"
|
1311
|
+
onclick="popupCode('Session.src/M000062.html');return false;">
|
1312
|
+
<span class="method-name">mv</span><span class="method-args">(src, dest, *args)</span>
|
1313
|
+
</a>
|
1314
|
+
</div>
|
1315
|
+
|
1316
|
+
<div class="method-description">
|
1317
|
+
<p>
|
1318
|
+
Moves file(s) src to dest. If file and dest exist on the different disk
|
1319
|
+
partition, the file is copied instead. Unlike cp, the src argument does not
|
1320
|
+
accept ’.’ wilcards (or ’*’ for that matter).
|
1321
|
+
</p>
|
1322
|
+
</div>
|
1323
|
+
</div>
|
1324
|
+
|
1325
|
+
<div id="method-M000024" class="method-detail">
|
1326
|
+
<a name="M000024"></a>
|
1327
|
+
|
1328
|
+
<div class="method-heading">
|
1329
|
+
<a href="Session.src/M000024.html" target="Code" class="method-signature"
|
1330
|
+
onclick="popupCode('Session.src/M000024.html');return false;">
|
1331
|
+
<span class="method-name">normalize_paths</span><span class="method-args">()</span>
|
1332
|
+
</a>
|
1333
|
+
</div>
|
1334
|
+
|
1335
|
+
<div class="method-description">
|
1336
|
+
<p>
|
1337
|
+
Ensure that file paths are absolute. This is necessary so that these files
|
1338
|
+
can be found after a <a href="Session.html#M000056">cd</a>.
|
1339
|
+
</p>
|
1340
|
+
</div>
|
1341
|
+
</div>
|
1342
|
+
|
1343
|
+
<div id="method-M000032" class="method-detail">
|
1344
|
+
<a name="M000032"></a>
|
1345
|
+
|
1346
|
+
<div class="method-heading">
|
1347
|
+
<a href="Session.src/M000032.html" target="Code" class="method-signature"
|
1348
|
+
onclick="popupCode('Session.src/M000032.html');return false;">
|
1349
|
+
<span class="method-name">note</span><span class="method-args">(string, *args)</span>
|
1350
|
+
</a>
|
1351
|
+
</div>
|
1352
|
+
|
1353
|
+
<div class="method-description">
|
1354
|
+
<p>
|
1355
|
+
Write a notice to @transcript. The string can take optional arguments along
|
1356
|
+
the lines of printf.
|
1357
|
+
</p>
|
1358
|
+
</div>
|
1359
|
+
</div>
|
1360
|
+
|
1361
|
+
<div id="method-M000017" class="method-detail">
|
1362
|
+
<a name="M000017"></a>
|
1363
|
+
|
1364
|
+
<div class="method-heading">
|
1365
|
+
<a href="Session.src/M000017.html" target="Code" class="method-signature"
|
1366
|
+
onclick="popupCode('Session.src/M000017.html');return false;">
|
1367
|
+
<span class="method-name">phb_available</span><span class="method-args">()</span>
|
1368
|
+
</a>
|
1369
|
+
</div>
|
1370
|
+
|
1371
|
+
<div class="method-description">
|
1372
|
+
<p>
|
1373
|
+
PHB knows the directory structure of Amber projects, so when PHB is
|
1374
|
+
available, various temp files can be placed in more appropriate
|
1375
|
+
directories.
|
1376
|
+
</p>
|
1377
|
+
</div>
|
1378
|
+
</div>
|
1379
|
+
|
1380
|
+
<div id="method-M000041" class="method-detail">
|
1381
|
+
<a name="M000041"></a>
|
1382
|
+
|
1383
|
+
<div class="method-heading">
|
1384
|
+
<span class="method-name">reply</span><span class="method-args">(response)</span>
|
1385
|
+
</div>
|
1386
|
+
|
1387
|
+
<div class="method-description">
|
1388
|
+
<p>
|
1389
|
+
Alias for <a href="Session.html#M000038">respond</a>
|
1390
|
+
</p>
|
1391
|
+
</div>
|
1392
|
+
</div>
|
1393
|
+
|
1394
|
+
<div id="method-M000048" class="method-detail">
|
1395
|
+
<a name="M000048"></a>
|
1396
|
+
|
1397
|
+
<div class="method-heading">
|
1398
|
+
<a href="Session.src/M000048.html" target="Code" class="method-signature"
|
1399
|
+
onclick="popupCode('Session.src/M000048.html');return false;">
|
1400
|
+
<span class="method-name">resolve_dir</span><span class="method-args">(input, silent=false)</span>
|
1401
|
+
</a>
|
1402
|
+
</div>
|
1403
|
+
|
1404
|
+
<div class="method-description">
|
1405
|
+
<p>
|
1406
|
+
If input is:
|
1407
|
+
</p>
|
1408
|
+
<ul>
|
1409
|
+
<li>A Symbol, a directory is looked up in dir_hash
|
1410
|
+
|
1411
|
+
</li>
|
1412
|
+
<li>A <a href="../String.html">String</a>, it is returned unchanged
|
1413
|
+
|
1414
|
+
</li>
|
1415
|
+
<li>An Array, each element is recursively resolved
|
1416
|
+
|
1417
|
+
</li>
|
1418
|
+
</ul>
|
1419
|
+
<p>
|
1420
|
+
Raises an exception if a symbolic name does not have a corresponding value,
|
1421
|
+
unless silent is true.
|
1422
|
+
</p>
|
1423
|
+
</div>
|
1424
|
+
</div>
|
1425
|
+
|
1426
|
+
<div id="method-M000049" class="method-detail">
|
1427
|
+
<a name="M000049"></a>
|
1428
|
+
|
1429
|
+
<div class="method-heading">
|
1430
|
+
<a href="Session.src/M000049.html" target="Code" class="method-signature"
|
1431
|
+
onclick="popupCode('Session.src/M000049.html');return false;">
|
1432
|
+
<span class="method-name">resolve_file</span><span class="method-args">(input, silent=false)</span>
|
1433
|
+
</a>
|
1434
|
+
</div>
|
1435
|
+
|
1436
|
+
<div class="method-description">
|
1437
|
+
<p>
|
1438
|
+
If input is:
|
1439
|
+
</p>
|
1440
|
+
<ul>
|
1441
|
+
<li>A Symbol, a file is computed from the corresponding value in url_hash
|
1442
|
+
|
1443
|
+
</li>
|
1444
|
+
<li>A <a href="../String.html">String</a>, it is returned unchanged
|
1445
|
+
|
1446
|
+
</li>
|
1447
|
+
<li>An Array, each element is recursively resolved
|
1448
|
+
|
1449
|
+
</li>
|
1450
|
+
</ul>
|
1451
|
+
<p>
|
1452
|
+
Raises an exception if a symbolic name does not have a corresponding value,
|
1453
|
+
unless silent is true.
|
1454
|
+
</p>
|
1455
|
+
</div>
|
1456
|
+
</div>
|
1457
|
+
|
1458
|
+
<div id="method-M000047" class="method-detail">
|
1459
|
+
<a name="M000047"></a>
|
1460
|
+
|
1461
|
+
<div class="method-heading">
|
1462
|
+
<a href="Session.src/M000047.html" target="Code" class="method-signature"
|
1463
|
+
onclick="popupCode('Session.src/M000047.html');return false;">
|
1464
|
+
<span class="method-name">resolve_url</span><span class="method-args">(input, silent=false)</span>
|
1465
|
+
</a>
|
1466
|
+
</div>
|
1467
|
+
|
1468
|
+
<div class="method-description">
|
1469
|
+
<p>
|
1470
|
+
If input is:
|
1471
|
+
</p>
|
1472
|
+
<ul>
|
1473
|
+
<li>A Symbol, return a URL by lookup in url_hash
|
1474
|
+
|
1475
|
+
</li>
|
1476
|
+
<li>A <a href="../String.html">String</a>, return the input
|
1477
|
+
|
1478
|
+
</li>
|
1479
|
+
<li>An Array, each element is recursively resolved
|
1480
|
+
|
1481
|
+
</li>
|
1482
|
+
</ul>
|
1483
|
+
<p>
|
1484
|
+
Raises an exception if a symbolic name does not have a corresponding value,
|
1485
|
+
unless silent is true.
|
1486
|
+
</p>
|
1487
|
+
</div>
|
1488
|
+
</div>
|
1489
|
+
|
1490
|
+
<div id="method-M000038" class="method-detail">
|
1491
|
+
<a name="M000038"></a>
|
1492
|
+
|
1493
|
+
<div class="method-heading">
|
1494
|
+
<a href="Session.src/M000038.html" target="Code" class="method-signature"
|
1495
|
+
onclick="popupCode('Session.src/M000038.html');return false;">
|
1496
|
+
<span class="method-name">respond</span><span class="method-args">(response)</span>
|
1497
|
+
</a>
|
1498
|
+
</div>
|
1499
|
+
|
1500
|
+
<div class="method-description">
|
1501
|
+
<p>
|
1502
|
+
Send a string to the spawned process
|
1503
|
+
</p>
|
1504
|
+
</div>
|
1505
|
+
</div>
|
1506
|
+
|
1507
|
+
<div id="method-M000063" class="method-detail">
|
1508
|
+
<a name="M000063"></a>
|
1509
|
+
|
1510
|
+
<div class="method-heading">
|
1511
|
+
<a href="Session.src/M000063.html" target="Code" class="method-signature"
|
1512
|
+
onclick="popupCode('Session.src/M000063.html');return false;">
|
1513
|
+
<span class="method-name">rm_rf</span><span class="method-args">(list, *args)</span>
|
1514
|
+
</a>
|
1515
|
+
</div>
|
1516
|
+
|
1517
|
+
<div class="method-description">
|
1518
|
+
<p>
|
1519
|
+
Remove files and directories named in list.
|
1520
|
+
</p>
|
1521
|
+
</div>
|
1522
|
+
</div>
|
1523
|
+
|
1524
|
+
<div id="method-M000028" class="method-detail">
|
1525
|
+
<a name="M000028"></a>
|
1526
|
+
|
1527
|
+
<div class="method-heading">
|
1528
|
+
<a href="Session.src/M000028.html" target="Code" class="method-signature"
|
1529
|
+
onclick="popupCode('Session.src/M000028.html');return false;">
|
1530
|
+
<span class="method-name">scaled_seconds</span><span class="method-args">(limit)</span>
|
1531
|
+
</a>
|
1532
|
+
</div>
|
1533
|
+
|
1534
|
+
<div class="method-description">
|
1535
|
+
<p>
|
1536
|
+
Given an unscaled time limit, scale it to make it appropriate for the
|
1537
|
+
current hardware.
|
1538
|
+
</p>
|
1539
|
+
</div>
|
1540
|
+
</div>
|
1541
|
+
|
1542
|
+
<div id="method-M000040" class="method-detail">
|
1543
|
+
<a name="M000040"></a>
|
1544
|
+
|
1545
|
+
<div class="method-heading">
|
1546
|
+
<span class="method-name">snd</span><span class="method-args">(response)</span>
|
1547
|
+
</div>
|
1548
|
+
|
1549
|
+
<div class="method-description">
|
1550
|
+
<p>
|
1551
|
+
Alias for <a href="Session.html#M000038">respond</a>
|
1552
|
+
</p>
|
1553
|
+
</div>
|
1554
|
+
</div>
|
1555
|
+
|
1556
|
+
<div id="method-M000034" class="method-detail">
|
1557
|
+
<a name="M000034"></a>
|
1558
|
+
|
1559
|
+
<div class="method-heading">
|
1560
|
+
<a href="Session.src/M000034.html" target="Code" class="method-signature"
|
1561
|
+
onclick="popupCode('Session.src/M000034.html');return false;">
|
1562
|
+
<span class="method-name">spawn</span><span class="method-args">(program='bash')</span>
|
1563
|
+
</a>
|
1564
|
+
</div>
|
1565
|
+
|
1566
|
+
<div class="method-description">
|
1567
|
+
<p>
|
1568
|
+
Spawn a new process, executing the indicated program. Once command has
|
1569
|
+
terminated, send, expect, and command will misbehave. You can, of course,
|
1570
|
+
spawn again. This has only been tested with bash!
|
1571
|
+
</p>
|
1572
|
+
</div>
|
1573
|
+
</div>
|
1574
|
+
|
1575
|
+
<div id="method-M000068" class="method-detail">
|
1576
|
+
<a name="M000068"></a>
|
1577
|
+
|
1578
|
+
<div class="method-heading">
|
1579
|
+
<a href="Session.src/M000068.html" target="Code" class="method-signature"
|
1580
|
+
onclick="popupCode('Session.src/M000068.html');return false;">
|
1581
|
+
<span class="method-name">tgz</span><span class="method-args">(dir, extension='.tgz', maxSeconds=60*5)</span>
|
1582
|
+
</a>
|
1583
|
+
</div>
|
1584
|
+
|
1585
|
+
<div class="method-description">
|
1586
|
+
<p>
|
1587
|
+
Compress the specified directory into an archive. The extension determines
|
1588
|
+
the compression type, and is used to derive the name of the resulting file.
|
1589
|
+
Instead of just specifying the extension, you can pass an entire sample
|
1590
|
+
filename to extension, and this method will extract the file name suffix
|
1591
|
+
and the compression type to use (throwing away the base name).
|
1592
|
+
</p>
|
1593
|
+
</div>
|
1594
|
+
</div>
|
1595
|
+
|
1596
|
+
<div id="method-M000026" class="method-detail">
|
1597
|
+
<a name="M000026"></a>
|
1598
|
+
|
1599
|
+
<div class="method-heading">
|
1600
|
+
<a href="Session.src/M000026.html" target="Code" class="method-signature"
|
1601
|
+
onclick="popupCode('Session.src/M000026.html');return false;">
|
1602
|
+
<span class="method-name">truncate_time_log</span><span class="method-args">()</span>
|
1603
|
+
</a>
|
1604
|
+
</div>
|
1605
|
+
|
1606
|
+
<div class="method-description">
|
1607
|
+
<p>
|
1608
|
+
Empties the time log (if any)
|
1609
|
+
</p>
|
1610
|
+
</div>
|
1611
|
+
</div>
|
1612
|
+
|
1613
|
+
<div id="method-M000067" class="method-detail">
|
1614
|
+
<a name="M000067"></a>
|
1615
|
+
|
1616
|
+
<div class="method-heading">
|
1617
|
+
<a href="Session.src/M000067.html" target="Code" class="method-signature"
|
1618
|
+
onclick="popupCode('Session.src/M000067.html');return false;">
|
1619
|
+
<span class="method-name">untgz</span><span class="method-args">(url, maxSeconds=60*5, silent=false)</span>
|
1620
|
+
</a>
|
1621
|
+
</div>
|
1622
|
+
|
1623
|
+
<div class="method-description">
|
1624
|
+
<p>
|
1625
|
+
Decompress the archive specifed by the given URL or symbolic name. Does not
|
1626
|
+
download the archive, just decompresses it. Can handle: .tgz, .tar.gz,
|
1627
|
+
.tar.bz2
|
1628
|
+
</p>
|
1629
|
+
</div>
|
1630
|
+
</div>
|
1631
|
+
|
1632
|
+
<div id="method-M000037" class="method-detail">
|
1633
|
+
<a name="M000037"></a>
|
1634
|
+
|
1635
|
+
<div class="method-heading">
|
1636
|
+
<a href="Session.src/M000037.html" target="Code" class="method-signature"
|
1637
|
+
onclick="popupCode('Session.src/M000037.html');return false;">
|
1638
|
+
<span class="method-name">wait</span><span class="method-args">(maxSeconds=1)</span>
|
1639
|
+
</a>
|
1640
|
+
</div>
|
1641
|
+
|
1642
|
+
<div class="method-description">
|
1643
|
+
<p>
|
1644
|
+
Wait for the spawned process to terminate on its own.
|
1645
|
+
</p>
|
1646
|
+
</div>
|
1647
|
+
</div>
|
1648
|
+
|
1649
|
+
|
1650
|
+
</div>
|
1651
|
+
|
1652
|
+
|
1653
|
+
</div>
|
1654
|
+
|
1655
|
+
|
1656
|
+
<div id="validator-badges">
|
1657
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
1658
|
+
</div>
|
1659
|
+
|
1660
|
+
</body>
|
1661
|
+
</html>
|