THERuSH 0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/bin/therush.rb +112 -0
- data/doc/classes/Builtin.html +175 -0
- data/doc/classes/Builtin.src/M000005.html +44 -0
- data/doc/classes/Builtin.src/M000006.html +44 -0
- data/doc/classes/Builtin.src/M000007.html +44 -0
- data/doc/classes/History.html +223 -0
- data/doc/classes/History.src/M000006.html +28 -0
- data/doc/classes/History.src/M000007.html +28 -0
- data/doc/classes/History.src/M000008.html +37 -0
- data/doc/classes/Shellfuncs.html +261 -0
- data/doc/classes/Shellfuncs.src/M000002.html +18 -0
- data/doc/classes/Shellfuncs.src/M000003.html +23 -0
- data/doc/classes/Shellfuncs.src/M000004.html +27 -0
- data/doc/classes/Shellfuncs.src/M000005.html +23 -0
- data/doc/created.rid +1 -0
- data/doc/dot/f_0.dot +14 -0
- data/doc/dot/f_0.png +0 -0
- data/doc/dot/f_1.dot +30 -0
- data/doc/dot/f_1.png +0 -0
- data/doc/dot/f_2.dot +30 -0
- data/doc/dot/f_2.png +0 -0
- data/doc/dot/f_3.dot +30 -0
- data/doc/dot/f_3.png +0 -0
- data/doc/dot/m_1_0.dot +30 -0
- data/doc/dot/m_1_0.png +0 -0
- data/doc/dot/m_2_0.dot +30 -0
- data/doc/dot/m_2_0.png +0 -0
- data/doc/dot/m_3_0.dot +30 -0
- data/doc/dot/m_3_0.png +0 -0
- data/doc/files/builtins_rb.html +107 -0
- data/doc/files/builtins_rb.src/M000007.html +44 -0
- data/doc/files/history_rb.html +108 -0
- data/doc/files/rubyshell_rb.html +188 -0
- data/doc/files/rubyshell_rb.src/M000001.html +41 -0
- data/doc/files/rubyshell_rb.src/M000002.html +25 -0
- data/doc/files/rubyshell_rb.src/M000003.html +41 -0
- data/doc/files/rubyshell_rb.src/M000004.html +28 -0
- data/doc/files/rubyshell_rb.src/M000005.html +41 -0
- data/doc/files/rubyshell_rb.src/M000006.html +28 -0
- data/doc/files/rubyshell_rb.src/M000007.html +28 -0
- data/doc/files/shellfuncs_rb.html +121 -0
- data/doc/fr_class_index.html +29 -0
- data/doc/fr_file_index.html +30 -0
- data/doc/fr_method_index.html +34 -0
- data/doc/index.html +24 -0
- data/lib/builtins.rb +39 -0
- data/lib/history.rb +48 -0
- data/lib/shellfuncs.rb +57 -0
- metadata +101 -0
@@ -0,0 +1,28 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>histAdd (History)</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 history.rb, line 10</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">histAdd</span>( <span class="ruby-identifier">cmd</span> )
|
15
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$DEBUG</span>
|
16
|
+
<span class="ruby-identifier">puts</span> <span class="ruby-value str">"DEBUGGING VALUES: cmd: "</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">cmd</span>
|
17
|
+
<span class="ruby-keyword kw">end</span>
|
18
|
+
|
19
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-constant">HISTORY</span>.<span class="ruby-identifier">include?</span>( <span class="ruby-identifier">cmd</span> )
|
20
|
+
<span class="ruby-constant">HISTORY</span>.<span class="ruby-identifier">push</span>( <span class="ruby-identifier">cmd</span> )
|
21
|
+
<span class="ruby-keyword kw">end</span>
|
22
|
+
|
23
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$DEBUG</span>
|
24
|
+
<span class="ruby-identifier">puts</span> <span class="ruby-value str">"DEBUGGING VALUES: HISTORY: "</span> <span class="ruby-operator">+</span> <span class="ruby-constant">HISTORY</span>.<span class="ruby-identifier">join</span>( <span class="ruby-value str">" , "</span>)
|
25
|
+
<span class="ruby-keyword kw">end</span>
|
26
|
+
<span class="ruby-keyword kw">end</span></pre>
|
27
|
+
</body>
|
28
|
+
</html>
|
@@ -0,0 +1,28 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>histAdd (History)</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 history.rb, line 10</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">histAdd</span>( <span class="ruby-identifier">cmd</span> )
|
15
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$DEBUG</span>
|
16
|
+
<span class="ruby-identifier">puts</span> <span class="ruby-value str">"DEBUGGING VALUES: cmd: "</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">cmd</span>
|
17
|
+
<span class="ruby-keyword kw">end</span>
|
18
|
+
|
19
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-constant">HISTORY</span>.<span class="ruby-identifier">include?</span>( <span class="ruby-identifier">cmd</span> )
|
20
|
+
<span class="ruby-constant">HISTORY</span>.<span class="ruby-identifier">push</span>( <span class="ruby-identifier">cmd</span> )
|
21
|
+
<span class="ruby-keyword kw">end</span>
|
22
|
+
|
23
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$DEBUG</span>
|
24
|
+
<span class="ruby-identifier">puts</span> <span class="ruby-value str">"DEBUGGING VALUES: HISTORY: "</span> <span class="ruby-operator">+</span> <span class="ruby-constant">HISTORY</span>.<span class="ruby-identifier">join</span>( <span class="ruby-value str">" , "</span>)
|
25
|
+
<span class="ruby-keyword kw">end</span>
|
26
|
+
<span class="ruby-keyword kw">end</span></pre>
|
27
|
+
</body>
|
28
|
+
</html>
|
@@ -0,0 +1,37 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>histCmd (History)</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 history.rb, line 25</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">histCmd</span>( <span class="ruby-identifier">hist</span> )
|
15
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$DEBUG</span>
|
16
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">hist</span>.<span class="ruby-identifier">nil?</span>
|
17
|
+
<span class="ruby-identifier">puts</span> <span class="ruby-value str">"DEBUGGING VALUES: hist: nil"</span>
|
18
|
+
<span class="ruby-keyword kw">else</span>
|
19
|
+
<span class="ruby-identifier">puts</span> <span class="ruby-value str">"DEBUGGING VALUES: hist: "</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">hist</span>
|
20
|
+
<span class="ruby-keyword kw">end</span>
|
21
|
+
<span class="ruby-keyword kw">end</span>
|
22
|
+
|
23
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">hist</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-comment cmt">## Just entering !h will print out the array</span>
|
24
|
+
<span class="ruby-constant">HISTORY</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span> <span class="ruby-identifier">entry</span> <span class="ruby-operator">|</span>
|
25
|
+
<span class="ruby-identifier">puts</span> <span class="ruby-constant">HISTORY</span>.<span class="ruby-identifier">index</span>( <span class="ruby-identifier">entry</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">entry</span>
|
26
|
+
<span class="ruby-keyword kw">end</span>
|
27
|
+
<span class="ruby-keyword kw">else</span>
|
28
|
+
<span class="ruby-identifier">hist</span> = <span class="ruby-identifier">hist</span>.<span class="ruby-identifier">to_i</span>
|
29
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-constant">HISTORY</span>.<span class="ruby-identifier">at</span>( <span class="ruby-identifier">hist</span> ).<span class="ruby-identifier">nil?</span>
|
30
|
+
<span class="ruby-identifier">puts</span> <span class="ruby-value str">"Invalid history reference"</span>
|
31
|
+
<span class="ruby-keyword kw">else</span>
|
32
|
+
<span class="ruby-identifier">system</span>( <span class="ruby-node">"#{HISTORY.at( hist )}"</span> )
|
33
|
+
<span class="ruby-keyword kw">end</span>
|
34
|
+
<span class="ruby-keyword kw">end</span>
|
35
|
+
<span class="ruby-keyword kw">end</span></pre>
|
36
|
+
</body>
|
37
|
+
</html>
|
@@ -0,0 +1,261 @@
|
|
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: Shellfuncs</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">Shellfuncs</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../files/shellfuncs_rb.html">
|
59
|
+
shellfuncs.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
|
+
|
75
|
+
|
76
|
+
|
77
|
+
</div>
|
78
|
+
|
79
|
+
<div id="method-list">
|
80
|
+
<h3 class="section-bar">Methods</h3>
|
81
|
+
|
82
|
+
<div class="name-list">
|
83
|
+
<a href="#M000005">commandRun</a>
|
84
|
+
<a href="#M000003">envUpdate</a>
|
85
|
+
<a href="#M000004">inPath</a>
|
86
|
+
<a href="#M000002">promptPrint</a>
|
87
|
+
</div>
|
88
|
+
</div>
|
89
|
+
|
90
|
+
</div>
|
91
|
+
|
92
|
+
|
93
|
+
<!-- if includes -->
|
94
|
+
|
95
|
+
<div id="section">
|
96
|
+
|
97
|
+
|
98
|
+
<div id="constants-list">
|
99
|
+
<h3 class="section-bar">Constants</h3>
|
100
|
+
|
101
|
+
<div class="name-list">
|
102
|
+
<table summary="Constants">
|
103
|
+
<tr class="top-aligned-row context-row">
|
104
|
+
<td class="context-item-name">PATH</td>
|
105
|
+
<td>=</td>
|
106
|
+
<td class="context-item-value">Array[ "/bin", "/sbin", "/usr/bin", "/usr/sbin", "/usr/local/bin"]</td>
|
107
|
+
<td width="3em"> </td>
|
108
|
+
<td class="context-item-desc">
|
109
|
+
The PATH
|
110
|
+
|
111
|
+
</td>
|
112
|
+
</tr>
|
113
|
+
</table>
|
114
|
+
</div>
|
115
|
+
</div>
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
|
122
|
+
<!-- if method_list -->
|
123
|
+
<div id="methods">
|
124
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
125
|
+
|
126
|
+
<div id="method-M000005" class="method-detail">
|
127
|
+
<a name="M000005"></a>
|
128
|
+
|
129
|
+
<div class="method-heading">
|
130
|
+
<a href="#M000005" class="method-signature">
|
131
|
+
<span class="method-name">commandRun</span><span class="method-args">( cmd )</span>
|
132
|
+
</a>
|
133
|
+
</div>
|
134
|
+
|
135
|
+
<div class="method-description">
|
136
|
+
<p>
|
137
|
+
Runs the command from the command line and pushes it onto the stack
|
138
|
+
</p>
|
139
|
+
<p><a class="source-toggle" href="#"
|
140
|
+
onclick="toggleCode('M000005-source');return false;">[Source]</a></p>
|
141
|
+
<div class="method-source-code" id="M000005-source">
|
142
|
+
<pre>
|
143
|
+
<span class="ruby-comment cmt"># File shellfuncs.rb, line 48</span>
|
144
|
+
48: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">commandRun</span>( <span class="ruby-identifier">cmd</span> )
|
145
|
+
49: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$DEBUG</span>
|
146
|
+
50: <span class="ruby-identifier">puts</span> <span class="ruby-value str">"DEBUGGING VALUES: cmd: "</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">cmd</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">" "</span>) <span class="ruby-operator">+</span> <span class="ruby-node">" at Line #{__LINE__} in #{__FILE__}"</span>
|
147
|
+
51: <span class="ruby-keyword kw">end</span>
|
148
|
+
52:
|
149
|
+
53: <span class="ruby-identifier">system</span>( <span class="ruby-node">"#{cmd.join(' ')}"</span> )
|
150
|
+
54: <span class="ruby-constant">History</span>.<span class="ruby-identifier">histAdd</span>( <span class="ruby-node">"#{cmd.join(' ')}"</span> )
|
151
|
+
55: <span class="ruby-keyword kw">end</span>
|
152
|
+
</pre>
|
153
|
+
</div>
|
154
|
+
</div>
|
155
|
+
</div>
|
156
|
+
|
157
|
+
<div id="method-M000003" class="method-detail">
|
158
|
+
<a name="M000003"></a>
|
159
|
+
|
160
|
+
<div class="method-heading">
|
161
|
+
<a href="#M000003" class="method-signature">
|
162
|
+
<span class="method-name">envUpdate</span><span class="method-args">()</span>
|
163
|
+
</a>
|
164
|
+
</div>
|
165
|
+
|
166
|
+
<div class="method-description">
|
167
|
+
<p>
|
168
|
+
Updates Environment Variables and the prompt
|
169
|
+
</p>
|
170
|
+
<p><a class="source-toggle" href="#"
|
171
|
+
onclick="toggleCode('M000003-source');return false;">[Source]</a></p>
|
172
|
+
<div class="method-source-code" id="M000003-source">
|
173
|
+
<pre>
|
174
|
+
<span class="ruby-comment cmt"># File shellfuncs.rb, line 24</span>
|
175
|
+
24: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">envUpdate</span>
|
176
|
+
25: <span class="ruby-identifier">$cwd</span> = <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">pwd</span>
|
177
|
+
26: <span class="ruby-identifier">$prompt</span> = <span class="ruby-identifier">$cwd</span> <span class="ruby-operator">+</span> <span class="ruby-value str">"> "</span>
|
178
|
+
27:
|
179
|
+
28: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$DEBUG</span>
|
180
|
+
29: <span class="ruby-identifier">puts</span> <span class="ruby-value str">"DEBUGGING VALUES: CWD: "</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">$cwd</span> <span class="ruby-operator">+</span> <span class="ruby-value str">" PROMPT: "</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">$prompt</span> <span class="ruby-operator">+</span> <span class="ruby-node">" at Line #{__LINE__} in #{__FILE__}"</span>
|
181
|
+
30: <span class="ruby-keyword kw">end</span>
|
182
|
+
31: <span class="ruby-keyword kw">end</span>
|
183
|
+
</pre>
|
184
|
+
</div>
|
185
|
+
</div>
|
186
|
+
</div>
|
187
|
+
|
188
|
+
<div id="method-M000004" class="method-detail">
|
189
|
+
<a name="M000004"></a>
|
190
|
+
|
191
|
+
<div class="method-heading">
|
192
|
+
<a href="#M000004" class="method-signature">
|
193
|
+
<span class="method-name">inPath</span><span class="method-args">( cmd )</span>
|
194
|
+
</a>
|
195
|
+
</div>
|
196
|
+
|
197
|
+
<div class="method-description">
|
198
|
+
<p>
|
199
|
+
Checks cmd to see if its in the PATH
|
200
|
+
</p>
|
201
|
+
<p><a class="source-toggle" href="#"
|
202
|
+
onclick="toggleCode('M000004-source');return false;">[Source]</a></p>
|
203
|
+
<div class="method-source-code" id="M000004-source">
|
204
|
+
<pre>
|
205
|
+
<span class="ruby-comment cmt"># File shellfuncs.rb, line 34</span>
|
206
|
+
34: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">inPath</span>( <span class="ruby-identifier">cmd</span> )
|
207
|
+
35: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$DEBUG</span>
|
208
|
+
36: <span class="ruby-identifier">puts</span> <span class="ruby-value str">"DEBUGGING VALUES: cmd: "</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">cmd</span> <span class="ruby-operator">+</span> <span class="ruby-node">" at Line #{__LINE__} in #{__FILE__}"</span>
|
209
|
+
37: <span class="ruby-keyword kw">end</span>
|
210
|
+
38:
|
211
|
+
39: <span class="ruby-constant">PATH</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span> <span class="ruby-identifier">dir</span> <span class="ruby-operator">|</span> <span class="ruby-comment cmt">## For every entry in the PATH</span>
|
212
|
+
40: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>( <span class="ruby-identifier">dir</span> <span class="ruby-operator">+</span> <span class="ruby-value str">"/"</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">cmd</span> )
|
213
|
+
41: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span>
|
214
|
+
42: <span class="ruby-keyword kw">end</span>
|
215
|
+
43: <span class="ruby-keyword kw">end</span>
|
216
|
+
44: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span>
|
217
|
+
45: <span class="ruby-keyword kw">end</span>
|
218
|
+
</pre>
|
219
|
+
</div>
|
220
|
+
</div>
|
221
|
+
</div>
|
222
|
+
|
223
|
+
<div id="method-M000002" class="method-detail">
|
224
|
+
<a name="M000002"></a>
|
225
|
+
|
226
|
+
<div class="method-heading">
|
227
|
+
<a href="#M000002" class="method-signature">
|
228
|
+
<span class="method-name">promptPrint</span><span class="method-args">()</span>
|
229
|
+
</a>
|
230
|
+
</div>
|
231
|
+
|
232
|
+
<div class="method-description">
|
233
|
+
<p>
|
234
|
+
Prints out the prompt
|
235
|
+
</p>
|
236
|
+
<p><a class="source-toggle" href="#"
|
237
|
+
onclick="toggleCode('M000002-source');return false;">[Source]</a></p>
|
238
|
+
<div class="method-source-code" id="M000002-source">
|
239
|
+
<pre>
|
240
|
+
<span class="ruby-comment cmt"># File shellfuncs.rb, line 19</span>
|
241
|
+
19: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">promptPrint</span>
|
242
|
+
20: <span class="ruby-identifier">print</span> <span class="ruby-node">"#{$prompt}"</span>.<span class="ruby-identifier">chomp</span>
|
243
|
+
21: <span class="ruby-keyword kw">end</span>
|
244
|
+
</pre>
|
245
|
+
</div>
|
246
|
+
</div>
|
247
|
+
</div>
|
248
|
+
|
249
|
+
|
250
|
+
</div>
|
251
|
+
|
252
|
+
|
253
|
+
</div>
|
254
|
+
|
255
|
+
|
256
|
+
<div id="validator-badges">
|
257
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
258
|
+
</div>
|
259
|
+
|
260
|
+
</body>
|
261
|
+
</html>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>promptPrint (Shellfuncs)</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 shellfuncs.rb, line 19</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">promptPrint</span>
|
15
|
+
<span class="ruby-identifier">puts</span> <span class="ruby-identifier">$prompt</span>.<span class="ruby-identifier">chomp</span>
|
16
|
+
<span class="ruby-keyword kw">end</span></pre>
|
17
|
+
</body>
|
18
|
+
</html>
|
@@ -0,0 +1,23 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>envUpdate (Shellfuncs)</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 shellfuncs.rb, line 24</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">envUpdate</span>
|
15
|
+
<span class="ruby-identifier">cwd</span> = <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">pwd</span>
|
16
|
+
<span class="ruby-identifier">prompt</span> = <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">pwd</span> <span class="ruby-operator">+</span> <span class="ruby-value str">"> "</span>
|
17
|
+
|
18
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$DEBUG</span>
|
19
|
+
<span class="ruby-identifier">puts</span> <span class="ruby-value str">"DEBUGGING VALUES: CWD: "</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">cwd</span> <span class="ruby-operator">+</span> <span class="ruby-value str">" PROMPT: "</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">prompt</span>
|
20
|
+
<span class="ruby-keyword kw">end</span>
|
21
|
+
<span class="ruby-keyword kw">end</span></pre>
|
22
|
+
</body>
|
23
|
+
</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>inPath (Shellfuncs)</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 shellfuncs.rb, line 34</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">inPath</span>( <span class="ruby-identifier">cmd</span> )
|
15
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$DEBUG</span>
|
16
|
+
<span class="ruby-identifier">puts</span> <span class="ruby-value str">"DEBUGGING VALUES: cmd: "</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">cmd</span>
|
17
|
+
<span class="ruby-keyword kw">end</span>
|
18
|
+
|
19
|
+
<span class="ruby-constant">PATH</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span> <span class="ruby-identifier">dir</span> <span class="ruby-operator">|</span> <span class="ruby-comment cmt">## For every entry in the PATH</span>
|
20
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>( <span class="ruby-identifier">dir</span> <span class="ruby-operator">+</span> <span class="ruby-value str">"/"</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">cmd</span> )
|
21
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span>
|
22
|
+
<span class="ruby-keyword kw">end</span>
|
23
|
+
<span class="ruby-keyword kw">end</span>
|
24
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span>
|
25
|
+
<span class="ruby-keyword kw">end</span></pre>
|
26
|
+
</body>
|
27
|
+
</html>
|
@@ -0,0 +1,23 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>commandRun (Shellfuncs)</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 shellfuncs.rb, line 48</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">commandRun</span>( <span class="ruby-identifier">cmd</span> )
|
15
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$DEBUG</span>
|
16
|
+
<span class="ruby-identifier">puts</span> <span class="ruby-value str">"DEBUGGING VALUES: cmd: "</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">cmd</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">" "</span>)
|
17
|
+
<span class="ruby-keyword kw">end</span>
|
18
|
+
|
19
|
+
<span class="ruby-identifier">system</span>( <span class="ruby-node">"#{cmd.join(' ')}"</span> )
|
20
|
+
<span class="ruby-constant">History</span>.<span class="ruby-identifier">histAdd</span>( <span class="ruby-node">"#{cmd.join(' ')}"</span> )
|
21
|
+
<span class="ruby-keyword kw">end</span></pre>
|
22
|
+
</body>
|
23
|
+
</html>
|