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.
Files changed (49) hide show
  1. data/bin/therush.rb +112 -0
  2. data/doc/classes/Builtin.html +175 -0
  3. data/doc/classes/Builtin.src/M000005.html +44 -0
  4. data/doc/classes/Builtin.src/M000006.html +44 -0
  5. data/doc/classes/Builtin.src/M000007.html +44 -0
  6. data/doc/classes/History.html +223 -0
  7. data/doc/classes/History.src/M000006.html +28 -0
  8. data/doc/classes/History.src/M000007.html +28 -0
  9. data/doc/classes/History.src/M000008.html +37 -0
  10. data/doc/classes/Shellfuncs.html +261 -0
  11. data/doc/classes/Shellfuncs.src/M000002.html +18 -0
  12. data/doc/classes/Shellfuncs.src/M000003.html +23 -0
  13. data/doc/classes/Shellfuncs.src/M000004.html +27 -0
  14. data/doc/classes/Shellfuncs.src/M000005.html +23 -0
  15. data/doc/created.rid +1 -0
  16. data/doc/dot/f_0.dot +14 -0
  17. data/doc/dot/f_0.png +0 -0
  18. data/doc/dot/f_1.dot +30 -0
  19. data/doc/dot/f_1.png +0 -0
  20. data/doc/dot/f_2.dot +30 -0
  21. data/doc/dot/f_2.png +0 -0
  22. data/doc/dot/f_3.dot +30 -0
  23. data/doc/dot/f_3.png +0 -0
  24. data/doc/dot/m_1_0.dot +30 -0
  25. data/doc/dot/m_1_0.png +0 -0
  26. data/doc/dot/m_2_0.dot +30 -0
  27. data/doc/dot/m_2_0.png +0 -0
  28. data/doc/dot/m_3_0.dot +30 -0
  29. data/doc/dot/m_3_0.png +0 -0
  30. data/doc/files/builtins_rb.html +107 -0
  31. data/doc/files/builtins_rb.src/M000007.html +44 -0
  32. data/doc/files/history_rb.html +108 -0
  33. data/doc/files/rubyshell_rb.html +188 -0
  34. data/doc/files/rubyshell_rb.src/M000001.html +41 -0
  35. data/doc/files/rubyshell_rb.src/M000002.html +25 -0
  36. data/doc/files/rubyshell_rb.src/M000003.html +41 -0
  37. data/doc/files/rubyshell_rb.src/M000004.html +28 -0
  38. data/doc/files/rubyshell_rb.src/M000005.html +41 -0
  39. data/doc/files/rubyshell_rb.src/M000006.html +28 -0
  40. data/doc/files/rubyshell_rb.src/M000007.html +28 -0
  41. data/doc/files/shellfuncs_rb.html +121 -0
  42. data/doc/fr_class_index.html +29 -0
  43. data/doc/fr_file_index.html +30 -0
  44. data/doc/fr_method_index.html +34 -0
  45. data/doc/index.html +24 -0
  46. data/lib/builtins.rb +39 -0
  47. data/lib/history.rb +48 -0
  48. data/lib/shellfuncs.rb +57 -0
  49. metadata +101 -0
@@ -0,0 +1,188 @@
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>File: rubyshell.rb</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="fileHeader">
50
+ <h1>rubyshell.rb</h1>
51
+ <table class="header-table">
52
+ <tr class="top-aligned-row">
53
+ <td><strong>Path:</strong></td>
54
+ <td>rubyshell.rb
55
+ </td>
56
+ </tr>
57
+ <tr class="top-aligned-row">
58
+ <td><strong>Last Update:</strong></td>
59
+ <td>Mon Sep 18 12:40:52 EDT 2006</td>
60
+ </tr>
61
+ </table>
62
+ </div>
63
+ <!-- banner header -->
64
+
65
+ <div id="bodyContent">
66
+
67
+
68
+
69
+ <div id="contextContent">
70
+
71
+ <div id="description">
72
+ <h2>THERuSH</h2>
73
+ <p>
74
+ The Highly Experimental Ruby Shell
75
+ </p>
76
+
77
+ </div>
78
+
79
+ <div id="requires-list">
80
+ <h3 class="section-bar">Required files</h3>
81
+
82
+ <div class="name-list">
83
+ history.rb&nbsp;&nbsp;
84
+ builtins.rb&nbsp;&nbsp;
85
+ shellfuncs.rb&nbsp;&nbsp;
86
+ shellwords&nbsp;&nbsp;
87
+ </div>
88
+ </div>
89
+
90
+ </div>
91
+
92
+ <div id="method-list">
93
+ <h3 class="section-bar">Methods</h3>
94
+
95
+ <div class="name-list">
96
+ <a href="#M000001">mathMethod</a>&nbsp;&nbsp;
97
+ </div>
98
+ </div>
99
+
100
+ </div>
101
+
102
+
103
+ <!-- if includes -->
104
+ <div id="includes">
105
+ <h3 class="section-bar">Included Modules</h3>
106
+
107
+ <div id="includes-list">
108
+ <span class="include-name"><a href="../classes/Builtin.html">Builtin</a></span>
109
+ <span class="include-name"><a href="../classes/History.html">History</a></span>
110
+ <span class="include-name"><a href="../classes/Shellfuncs.html">Shellfuncs</a></span>
111
+ </div>
112
+ </div>
113
+
114
+ <div id="section">
115
+
116
+
117
+
118
+
119
+
120
+
121
+
122
+
123
+ <!-- if method_list -->
124
+ <div id="methods">
125
+ <h3 class="section-bar">Public Instance methods</h3>
126
+
127
+ <div id="method-M000001" class="method-detail">
128
+ <a name="M000001"></a>
129
+
130
+ <div class="method-heading">
131
+ <a href="#M000001" class="method-signature">
132
+ <span class="method-name">mathMethod</span><span class="method-args">( lhs, opr, rhs )</span>
133
+ </a>
134
+ </div>
135
+
136
+ <div class="method-description">
137
+ <p>
138
+ The method for the built in calculator
139
+ </p>
140
+ <p><a class="source-toggle" href="#"
141
+ onclick="toggleCode('M000001-source');return false;">[Source]</a></p>
142
+ <div class="method-source-code" id="M000001-source">
143
+ <pre>
144
+ <span class="ruby-comment cmt"># File rubyshell.rb, line 24</span>
145
+ 24: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">mathMethod</span>( <span class="ruby-identifier">lhs</span>, <span class="ruby-identifier">opr</span>, <span class="ruby-identifier">rhs</span> )
146
+ 25:
147
+ 26: <span class="ruby-comment cmt">## All this Debugging is getting tiring :D</span>
148
+ 27: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$DEBUG</span>
149
+ 28: <span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;DEBUGGING VALUES: lhs: &quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">lhs</span> <span class="ruby-operator">+</span> <span class="ruby-value str">&quot; opr: &quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">opr</span> <span class="ruby-operator">+</span> <span class="ruby-value str">&quot; rhs: &quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">rhs</span>
150
+ 29: <span class="ruby-keyword kw">end</span>
151
+ 30:
152
+ 31: <span class="ruby-comment cmt">## Convert lhs and rhs to integers</span>
153
+ 32: <span class="ruby-identifier">lhs</span> = <span class="ruby-identifier">lhs</span>.<span class="ruby-identifier">to_i</span>
154
+ 33: <span class="ruby-identifier">rhs</span> = <span class="ruby-identifier">rhs</span>.<span class="ruby-identifier">to_i</span>
155
+ 34:
156
+ 35: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">opr</span>
157
+ 36: <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;+&quot;</span> <span class="ruby-comment cmt">## Our Addition case</span>
158
+ 37: <span class="ruby-identifier">puts</span> <span class="ruby-identifier">lhs</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">rhs</span>
159
+ 38: <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;-&quot;</span> <span class="ruby-comment cmt">## Our subtraction case</span>
160
+ 39: <span class="ruby-identifier">puts</span> <span class="ruby-identifier">lhs</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">rhs</span>
161
+ 40: <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;*&quot;</span> <span class="ruby-comment cmt">## Our multiplication case</span>
162
+ 41: <span class="ruby-identifier">puts</span> <span class="ruby-identifier">lhs</span> <span class="ruby-operator">*</span> <span class="ruby-identifier">rhs</span>
163
+ 42: <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;/&quot;</span> <span class="ruby-comment cmt">## Our Division case</span>
164
+ 43: <span class="ruby-identifier">puts</span> <span class="ruby-identifier">lhs</span> <span class="ruby-operator">/</span> <span class="ruby-identifier">rhs</span>
165
+ 44: <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;**&quot;</span> <span class="ruby-comment cmt">## Our exponentiation case</span>
166
+ 45: <span class="ruby-identifier">puts</span> <span class="ruby-identifier">lhs</span> <span class="ruby-operator">**</span> <span class="ruby-identifier">rhs</span>
167
+ 46: <span class="ruby-keyword kw">else</span>
168
+ 47: <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;Illegal operator #{opr}&quot;</span>
169
+ 48: <span class="ruby-keyword kw">end</span>
170
+ 49: <span class="ruby-keyword kw">end</span>
171
+ </pre>
172
+ </div>
173
+ </div>
174
+ </div>
175
+
176
+
177
+ </div>
178
+
179
+
180
+ </div>
181
+
182
+
183
+ <div id="validator-badges">
184
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
185
+ </div>
186
+
187
+ </body>
188
+ </html>
@@ -0,0 +1,41 @@
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>mathMethod (rubyshell.rb)</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 rubyshell.rb, line 23</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">mathMethod</span>( <span class="ruby-identifier">lhs</span>, <span class="ruby-identifier">opr</span>, <span class="ruby-identifier">rhs</span> )
15
+
16
+ <span class="ruby-comment cmt">## All this Debugging is getting tiring :D</span>
17
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$DEBUG</span>
18
+ <span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;DEBUGGING VALUES: lhs: &quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">lhs</span> <span class="ruby-operator">+</span> <span class="ruby-value str">&quot; opr: &quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">opr</span> <span class="ruby-operator">+</span> <span class="ruby-value str">&quot; rhs: &quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">rhs</span>
19
+ <span class="ruby-keyword kw">end</span>
20
+
21
+ <span class="ruby-comment cmt">## Convert lhs and rhs to integers</span>
22
+ <span class="ruby-identifier">lhs</span> = <span class="ruby-identifier">lhs</span>.<span class="ruby-identifier">to_i</span>
23
+ <span class="ruby-identifier">rhs</span> = <span class="ruby-identifier">rhs</span>.<span class="ruby-identifier">to_i</span>
24
+
25
+ <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">opr</span>
26
+ <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;+&quot;</span> <span class="ruby-comment cmt">## Our Addition case</span>
27
+ <span class="ruby-identifier">puts</span> <span class="ruby-identifier">lhs</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">rhs</span>
28
+ <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;-&quot;</span> <span class="ruby-comment cmt">## Our subtraction case</span>
29
+ <span class="ruby-identifier">puts</span> <span class="ruby-identifier">lhs</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">rhs</span>
30
+ <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;*&quot;</span> <span class="ruby-comment cmt">## Our multiplication case</span>
31
+ <span class="ruby-identifier">puts</span> <span class="ruby-identifier">lhs</span> <span class="ruby-operator">*</span> <span class="ruby-identifier">rhs</span>
32
+ <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;/&quot;</span> <span class="ruby-comment cmt">## Our Division case</span>
33
+ <span class="ruby-identifier">puts</span> <span class="ruby-identifier">lhs</span> <span class="ruby-operator">/</span> <span class="ruby-identifier">rhs</span>
34
+ <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;**&quot;</span> <span class="ruby-comment cmt">## Our exponentiation case</span>
35
+ <span class="ruby-identifier">puts</span> <span class="ruby-identifier">lhs</span> <span class="ruby-operator">**</span> <span class="ruby-identifier">rhs</span>
36
+ <span class="ruby-keyword kw">else</span>
37
+ <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;Illegal operator #{opr}&quot;</span>
38
+ <span class="ruby-keyword kw">end</span>
39
+ <span class="ruby-keyword kw">end</span></pre>
40
+ </body>
41
+ </html>
@@ -0,0 +1,25 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>commandRun (rubyshell.rb)</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 rubyshell.rb, line 40</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">commandRun</span>( <span class="ruby-identifier">cmd</span> )
15
+
16
+ <span class="ruby-comment cmt">## More Debugging</span>
17
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$DEBUG</span>
18
+ <span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;DEBUGGING VALUES: cmd: &quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">cmd</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">&quot; &quot;</span>)
19
+ <span class="ruby-keyword kw">end</span>
20
+
21
+ <span class="ruby-identifier">system</span>( <span class="ruby-node">&quot;#{cmd.join(' ')}&quot;</span> )
22
+ <span class="ruby-constant">History</span>.<span class="ruby-identifier">histAdd</span>( <span class="ruby-node">&quot;#{cmd.join(' ')}&quot;</span> )
23
+ <span class="ruby-keyword kw">end</span></pre>
24
+ </body>
25
+ </html>
@@ -0,0 +1,41 @@
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>mathMethod (rubyshell.rb)</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 rubyshell.rb, line 52</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">mathMethod</span>( <span class="ruby-identifier">lhs</span>, <span class="ruby-identifier">opr</span>, <span class="ruby-identifier">rhs</span> )
15
+
16
+ <span class="ruby-comment cmt">## All this Debugging is getting tiring :D</span>
17
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$DEBUG</span>
18
+ <span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;DEBUGGING VALUES: lhs: &quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">lhs</span> <span class="ruby-operator">+</span> <span class="ruby-value str">&quot; opr: &quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">opr</span> <span class="ruby-operator">+</span> <span class="ruby-value str">&quot; rhs: &quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">rhs</span>
19
+ <span class="ruby-keyword kw">end</span>
20
+
21
+ <span class="ruby-comment cmt">## Convert lhs and rhs to integers</span>
22
+ <span class="ruby-identifier">lhs</span> = <span class="ruby-identifier">lhs</span>.<span class="ruby-identifier">to_i</span>
23
+ <span class="ruby-identifier">rhs</span> = <span class="ruby-identifier">rhs</span>.<span class="ruby-identifier">to_i</span>
24
+
25
+ <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">opr</span>
26
+ <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;+&quot;</span> <span class="ruby-comment cmt">## Our Addition case</span>
27
+ <span class="ruby-identifier">puts</span> <span class="ruby-identifier">lhs</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">rhs</span>
28
+ <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;-&quot;</span> <span class="ruby-comment cmt">## Our subtraction case</span>
29
+ <span class="ruby-identifier">puts</span> <span class="ruby-identifier">lhs</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">rhs</span>
30
+ <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;*&quot;</span> <span class="ruby-comment cmt">## Our multiplication case</span>
31
+ <span class="ruby-identifier">puts</span> <span class="ruby-identifier">lhs</span> <span class="ruby-operator">*</span> <span class="ruby-identifier">rhs</span>
32
+ <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;/&quot;</span> <span class="ruby-comment cmt">## Our Division case</span>
33
+ <span class="ruby-identifier">puts</span> <span class="ruby-identifier">lhs</span> <span class="ruby-operator">/</span> <span class="ruby-identifier">rhs</span>
34
+ <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;**&quot;</span> <span class="ruby-comment cmt">## Our exponentiation case</span>
35
+ <span class="ruby-identifier">puts</span> <span class="ruby-identifier">lhs</span> <span class="ruby-operator">**</span> <span class="ruby-identifier">rhs</span>
36
+ <span class="ruby-keyword kw">else</span>
37
+ <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;Illegal operator #{opr}&quot;</span>
38
+ <span class="ruby-keyword kw">end</span>
39
+ <span class="ruby-keyword kw">end</span></pre>
40
+ </body>
41
+ </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>inPath (rubyshell.rb)</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 rubyshell.rb, line 80</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">inPath</span>( <span class="ruby-identifier">cmd</span> )
15
+
16
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$DEBUG</span>
17
+ <span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;DEBUGGING VALUES: cmd: &quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">cmd</span>
18
+ <span class="ruby-keyword kw">end</span>
19
+
20
+ <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 each entry in the PATH Array</span>
21
+ <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">&quot;/&quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">cmd</span> )
22
+ <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> <span class="ruby-comment cmt">## Return true if it was found</span>
23
+ <span class="ruby-keyword kw">end</span>
24
+ <span class="ruby-keyword kw">end</span>
25
+ <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span>
26
+ <span class="ruby-keyword kw">end</span></pre>
27
+ </body>
28
+ </html>
@@ -0,0 +1,41 @@
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>mathMethod (rubyshell.rb)</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 rubyshell.rb, line 94</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">mathMethod</span>( <span class="ruby-identifier">lhs</span>, <span class="ruby-identifier">opr</span>, <span class="ruby-identifier">rhs</span> )
15
+
16
+ <span class="ruby-comment cmt">## All this Debugging is getting tiring :D</span>
17
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$DEBUG</span>
18
+ <span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;DEBUGGING VALUES: lhs: &quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">lhs</span> <span class="ruby-operator">+</span> <span class="ruby-value str">&quot; opr: &quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">opr</span> <span class="ruby-operator">+</span> <span class="ruby-value str">&quot; rhs: &quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">rhs</span>
19
+ <span class="ruby-keyword kw">end</span>
20
+
21
+ <span class="ruby-comment cmt">## Convert lhs and rhs to integers</span>
22
+ <span class="ruby-identifier">lhs</span> = <span class="ruby-identifier">lhs</span>.<span class="ruby-identifier">to_i</span>
23
+ <span class="ruby-identifier">rhs</span> = <span class="ruby-identifier">rhs</span>.<span class="ruby-identifier">to_i</span>
24
+
25
+ <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">opr</span>
26
+ <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;+&quot;</span> <span class="ruby-comment cmt">## Our Addition case</span>
27
+ <span class="ruby-identifier">puts</span> <span class="ruby-identifier">lhs</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">rhs</span>
28
+ <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;-&quot;</span> <span class="ruby-comment cmt">## Our subtraction case</span>
29
+ <span class="ruby-identifier">puts</span> <span class="ruby-identifier">lhs</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">rhs</span>
30
+ <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;*&quot;</span> <span class="ruby-comment cmt">## Our multiplication case</span>
31
+ <span class="ruby-identifier">puts</span> <span class="ruby-identifier">lhs</span> <span class="ruby-operator">*</span> <span class="ruby-identifier">rhs</span>
32
+ <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;/&quot;</span> <span class="ruby-comment cmt">## Our Division case</span>
33
+ <span class="ruby-identifier">puts</span> <span class="ruby-identifier">lhs</span> <span class="ruby-operator">/</span> <span class="ruby-identifier">rhs</span>
34
+ <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;**&quot;</span> <span class="ruby-comment cmt">## Our exponentiation case</span>
35
+ <span class="ruby-identifier">puts</span> <span class="ruby-identifier">lhs</span> <span class="ruby-operator">**</span> <span class="ruby-identifier">rhs</span>
36
+ <span class="ruby-keyword kw">else</span>
37
+ <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;Illegal operator #{opr}&quot;</span>
38
+ <span class="ruby-keyword kw">end</span>
39
+ <span class="ruby-keyword kw">end</span></pre>
40
+ </body>
41
+ </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>inPath (rubyshell.rb)</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 rubyshell.rb, line 122</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">inPath</span>( <span class="ruby-identifier">cmd</span> )
15
+
16
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$DEBUG</span>
17
+ <span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;DEBUGGING VALUES: cmd: &quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">cmd</span>
18
+ <span class="ruby-keyword kw">end</span>
19
+
20
+ <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 each entry in the PATH Array</span>
21
+ <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">&quot;/&quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">cmd</span> )
22
+ <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> <span class="ruby-comment cmt">## Return true if it was found</span>
23
+ <span class="ruby-keyword kw">end</span>
24
+ <span class="ruby-keyword kw">end</span>
25
+ <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</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>inPath (rubyshell.rb)</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 rubyshell.rb, line 150</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">inPath</span>( <span class="ruby-identifier">cmd</span> )
15
+
16
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$DEBUG</span>
17
+ <span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;DEBUGGING VALUES: cmd: &quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">cmd</span>
18
+ <span class="ruby-keyword kw">end</span>
19
+
20
+ <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 each entry in the PATH Array</span>
21
+ <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">&quot;/&quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">cmd</span> )
22
+ <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> <span class="ruby-comment cmt">## Return true if it was found</span>
23
+ <span class="ruby-keyword kw">end</span>
24
+ <span class="ruby-keyword kw">end</span>
25
+ <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span>
26
+ <span class="ruby-keyword kw">end</span></pre>
27
+ </body>
28
+ </html>
@@ -0,0 +1,121 @@
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>File: shellfuncs.rb</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="fileHeader">
50
+ <h1>shellfuncs.rb</h1>
51
+ <table class="header-table">
52
+ <tr class="top-aligned-row">
53
+ <td><strong>Path:</strong></td>
54
+ <td>shellfuncs.rb
55
+ </td>
56
+ </tr>
57
+ <tr class="top-aligned-row">
58
+ <td><strong>Last Update:</strong></td>
59
+ <td>Mon Sep 18 12:41:18 EDT 2006</td>
60
+ </tr>
61
+ </table>
62
+ </div>
63
+ <!-- banner header -->
64
+
65
+ <div id="bodyContent">
66
+
67
+
68
+
69
+ <div id="contextContent">
70
+
71
+ <div id="description">
72
+ <p>
73
+ Misc shell functions for THERuSH
74
+ </p>
75
+
76
+ </div>
77
+
78
+ <div id="requires-list">
79
+ <h3 class="section-bar">Required files</h3>
80
+
81
+ <div class="name-list">
82
+ history.rb&nbsp;&nbsp;
83
+ </div>
84
+ </div>
85
+
86
+ </div>
87
+
88
+
89
+ </div>
90
+
91
+
92
+ <!-- if includes -->
93
+ <div id="includes">
94
+ <h3 class="section-bar">Included Modules</h3>
95
+
96
+ <div id="includes-list">
97
+ <span class="include-name"><a href="../classes/History.html">History</a></span>
98
+ </div>
99
+ </div>
100
+
101
+ <div id="section">
102
+
103
+
104
+
105
+
106
+
107
+
108
+
109
+
110
+ <!-- if method_list -->
111
+
112
+
113
+ </div>
114
+
115
+
116
+ <div id="validator-badges">
117
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
118
+ </div>
119
+
120
+ </body>
121
+ </html>