rbatch 1.6.6 → 1.7.0

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.
@@ -1,332 +1,317 @@
1
- <?xml version="1.0" encoding="utf-8"?>
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
2
  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
3
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4
4
  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
5
  <head>
6
- <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
6
+ <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
7
7
 
8
- <title>Class: RBatch::Cmd</title>
8
+ <title>Class: RBatch::Cmd</title>
9
9
 
10
- <link rel="stylesheet" href="../rdoc.css" type="text/css" media="screen" />
10
+ <link rel="stylesheet" href="../rdoc.css" type="text/css" media="screen" />
11
11
 
12
- <script src="../js/jquery.js" type="text/javascript"
13
- charset="utf-8"></script>
14
- <script src="../js/thickbox-compressed.js" type="text/javascript"
15
- charset="utf-8"></script>
16
- <script src="../js/quicksearch.js" type="text/javascript"
17
- charset="utf-8"></script>
18
- <script src="../js/darkfish.js" type="text/javascript"
19
- charset="utf-8"></script>
12
+ <script src="../js/jquery.js" type="text/javascript" charset="utf-8"></script>
13
+ <script src="../js/thickbox-compressed.js" type="text/javascript" charset="utf-8"></script>
14
+ <script src="../js/quicksearch.js" type="text/javascript" charset="utf-8"></script>
15
+ <script src="../js/darkfish.js" type="text/javascript" charset="utf-8"></script>
20
16
 
21
17
  </head>
22
- <body class="class">
18
+ <body id="top" class="class">
23
19
 
24
- <div id="metadata">
25
- <div id="home-metadata">
26
- <div id="home-section" class="section">
20
+ <div id="metadata">
21
+ <div id="home-metadata">
22
+ <div id="home-section" class="section">
27
23
  <h3 class="section-header">
28
24
  <a href="../index.html">Home</a>
29
25
  <a href="../index.html#classes">Classes</a>
30
26
  <a href="../index.html#methods">Methods</a>
31
27
  </h3>
32
- </div>
33
- </div>
34
-
35
- <div id="file-metadata">
36
- <div id="file-list-section" class="section">
37
- <h3 class="section-header">In Files</h3>
38
- <div class="section-body">
39
- <ul>
40
-
41
- <li><a href="../lib/rbatch/cmd_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
42
- class="thickbox" title="lib/rbatch/cmd.rb">lib/rbatch/cmd.rb</a></li>
43
-
44
- </ul>
45
- </div>
46
- </div>
47
-
48
-
49
- </div>
50
-
51
- <div id="class-metadata">
52
-
53
- <!-- Parent Class -->
54
-
55
- <div id="parent-class-section" class="section">
56
- <h3 class="section-header">Parent</h3>
57
-
58
- <p class="link">Object</p>
59
-
60
- </div>
61
-
62
-
63
- <!-- Namespace Contents -->
64
-
65
-
66
- <!-- Method Quickref -->
67
-
68
- <div id="method-list-section" class="section">
69
- <h3 class="section-header">Methods</h3>
70
- <ul class="link-list">
71
-
72
- <li><a href="#method-c-new">::new</a></li>
73
-
74
- <li><a href="#method-i-run">#run</a></li>
75
-
76
- </ul>
77
- </div>
78
-
79
-
80
- <!-- Included Modules -->
81
-
82
- </div>
83
-
84
- <div id="project-metadata">
85
-
86
-
87
- <div id="fileindex-section" class="section project-section">
88
- <h3 class="section-header">Files</h3>
89
- <ul>
90
-
91
- <li class="file"><a href="../CHANGELOG.html">CHANGELOG</a></li>
92
-
93
- <li class="file"><a href="../LICENSE.html">LICENSE</a></li>
94
-
95
- </ul>
96
- </div>
97
-
98
-
99
- <div id="classindex-section" class="section project-section">
100
- <h3 class="section-header">Class Index
101
- <span class="search-toggle"><img src="../images/find.png"
102
- height="16" width="16" alt="[+]"
103
- title="show/hide quicksearch" /></span></h3>
104
- <form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
105
- <fieldset>
106
- <legend>Quicksearch</legend>
107
- <input type="text" name="quicksearch" value=""
108
- class="quicksearch-field" />
109
- </fieldset>
110
- </form>
111
-
112
- <ul class="link-list">
113
-
114
- <li><a href="../RBatch.html">RBatch</a></li>
115
-
116
- <li><a href="../RBatch/Cmd.html">RBatch::Cmd</a></li>
117
-
118
- <li><a href="../RBatch/CmdException.html">RBatch::CmdException</a></li>
119
-
120
- <li><a href="../RBatch/CmdResult.html">RBatch::CmdResult</a></li>
121
-
122
- <li><a href="../RBatch/Config.html">RBatch::Config</a></li>
123
-
124
- <li><a href="../RBatch/Config/Exception.html">RBatch::Config::Exception</a></li>
125
-
126
- <li><a href="../RBatch/Log.html">RBatch::Log</a></li>
127
-
128
- </ul>
129
- <div id="no-class-search-results" style="display: none;">No matching classes.</div>
130
- </div>
131
-
132
-
133
- </div>
134
- </div>
135
-
136
- <div id="documentation">
137
- <h1 class="class">RBatch::Cmd</h1>
138
-
139
- <div id="description">
140
- <p>
141
- External command runcher.
142
- </p>
143
- <ul>
144
- <li><p>
145
- Input cmd_params into Kernel#spawn.
146
- </p>
147
- </li>
148
- <li><p>
149
- Write command&#8217;s stdout and stderr to tmp file.
150
- </p>
151
- </li>
152
- </ul>
153
- <pre>
154
- * If Platform is &quot;mswin&quot; or &quot;mingw&quot; , then temp directory is ENV[&quot;TEMP&quot;]
155
- * If Platform is &quot;linux&quot; or &quot;cygwin&quot; , then temp directory is &quot;/tmp/&quot;
156
- </pre>
157
- <ul>
158
- <li><p>
159
- Return hash object including stdout, stderr, and exit status.
160
- </p>
161
- </li>
162
- </ul>
28
+ </div>
29
+ </div>
30
+
31
+ <div id="file-metadata">
32
+ <div id="file-list-section" class="section">
33
+ <h3 class="section-header">In Files</h3>
34
+ <div class="section-body">
35
+ <ul>
36
+
37
+ <li><a href="../lib/rbatch/cmd_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
38
+ class="thickbox" title="lib/rbatch/cmd.rb">lib/rbatch/cmd.rb</a></li>
39
+
40
+ </ul>
41
+ </div>
42
+ </div>
43
+
44
+
45
+ </div>
46
+
47
+ <div id="class-metadata">
48
+
49
+ <!-- Parent Class -->
50
+ <div id="parent-class-section" class="section">
51
+ <h3 class="section-header">Parent</h3>
52
+
53
+ <p class="link">Object</p>
54
+
55
+ </div>
56
+
57
+
58
+
59
+
60
+
61
+
62
+
63
+ <!-- Method Quickref -->
64
+ <div id="method-list-section" class="section">
65
+ <h3 class="section-header">Methods</h3>
66
+ <ul class="link-list">
67
+
68
+ <li><a href="#method-c-new">::new</a></li>
69
+
70
+ <li><a href="#method-i-run">#run</a></li>
71
+
72
+ </ul>
73
+ </div>
74
+
75
+
76
+
77
+ </div>
78
+
79
+ <div id="project-metadata">
80
+
81
+
82
+ <div id="fileindex-section" class="section project-section">
83
+ <h3 class="section-header">Files</h3>
84
+ <ul>
85
+
86
+ <li class="file"><a href="../CHANGELOG.html">CHANGELOG</a></li>
87
+
88
+ <li class="file"><a href="../LICENSE.html">LICENSE</a></li>
89
+
90
+ </ul>
91
+ </div>
92
+
93
+
94
+ <div id="classindex-section" class="section project-section">
95
+ <h3 class="section-header">Class/Module Index
96
+ <span class="search-toggle"><img src="../images/find.png"
97
+ height="16" width="16" alt="[+]"
98
+ title="show/hide quicksearch" /></span></h3>
99
+ <form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
100
+ <fieldset>
101
+ <legend>Quicksearch</legend>
102
+ <input type="text" name="quicksearch" value=""
103
+ class="quicksearch-field" />
104
+ </fieldset>
105
+ </form>
106
+
107
+ <ul class="link-list">
108
+
109
+ <li><a href="../RBatch.html">RBatch</a></li>
110
+
111
+ <li><a href="../RBatch/Cmd.html">RBatch::Cmd</a></li>
112
+
113
+ <li><a href="../RBatch/CmdException.html">RBatch::CmdException</a></li>
114
+
115
+ <li><a href="../RBatch/CmdResult.html">RBatch::CmdResult</a></li>
116
+
117
+ <li><a href="../RBatch/Config.html">RBatch::Config</a></li>
118
+
119
+ <li><a href="../RBatch/Log.html">RBatch::Log</a></li>
120
+
121
+ <li><a href="../RBatch/RBatch.html">RBatch::RBatch</a></li>
122
+
123
+ <li><a href="../RBatch/RBatch/RBatch.html">RBatch::RBatch::RBatch</a></li>
124
+
125
+ <li><a href="../RBatch/RBatch/RBatch/Config.html">RBatch::RBatch::RBatch::Config</a></li>
126
+
127
+ <li><a href="../RBatch/RBatch/RBatch/Config/Exception.html">RBatch::RBatch::RBatch::Config::Exception</a></li>
128
+
129
+ </ul>
130
+ <div id="no-class-search-results" style="display: none;">No matching classes.</div>
131
+ </div>
132
+
133
+
134
+ </div>
135
+ </div>
136
+
137
+ <div id="documentation">
138
+ <h1 class="class">RBatch::Cmd</h1>
139
+
140
+ <div id="description" class="description">
141
+
142
+ <p>External command runcher.</p>
143
+ <ul><li>
144
+ <p>Input cmd_params into Kernel#spawn.</p>
145
+ </li><li>
146
+ <p>Write command’s stdout and stderr to tmp file.</p>
147
+ </li><li>
148
+ <p>If Platform is “mswin” or “mingw” , then temp directory is <a
149
+ href="http://"TEMP"">ENV</a></p>
150
+ </li><li>
151
+ <p>If Platform is linux or cygwin , then temp directory is “/tmp/”</p>
152
+ </li><li>
153
+ <p>Return hash object including stdout, stderr, and exit status.</p>
154
+ </li></ul>
155
+
163
156
  <h4>Sample 1</h4>
164
- <pre>
165
- require 'rbatch'
166
- cmd = RBatch::Cmd(&quot;ls&quot;)
167
- r = cmd.run
168
- p r.stdout
169
- =&gt; &quot;fileA\nfileB\n&quot;
170
- </pre>
157
+
158
+ <pre>require 'rbatch'
159
+ cmd = RBatch::Cmd(&quot;ls&quot;)
160
+ r = cmd.run
161
+ p r.stdout
162
+ =&gt; &quot;fileA\nfileB\n&quot;</pre>
163
+
171
164
  <h4>Sample 2 ( Use option)</h4>
172
- <pre>
173
- cmd = RBatch::Cmd(&quot;ls&quot;, {:verbose =&gt; true})
174
- r = cmd.run
175
- </pre>
165
+
166
+ <pre>cmd = RBatch::Cmd(&quot;ls&quot;, {:verbose =&gt; true})
167
+ r = cmd.run</pre>
168
+
176
169
  <h4>Sample 3 ( Use alias)</h4>
177
- <pre>
178
- require 'rbatch'
179
- r = RBatch::cmd(&quot;ls&quot;)
180
- p r.stdout
181
- =&gt; &quot;fileA\nfileB\n&quot;</pre>
182
-
183
- </div>
184
-
185
- <!-- Constants -->
186
-
187
-
188
- <!-- Attributes -->
189
-
190
-
191
- <!-- Methods -->
192
-
193
- <div id="public-class-method-details" class="method-section section">
194
- <h3 class="section-header">Public Class Methods</h3>
195
-
196
-
197
- <div id="new-method" class="method-detail ">
198
- <a name="method-c-new"></a>
199
-
200
- <div class="method-heading">
201
-
202
- <span class="method-name">new</span><span
203
- class="method-args">(cmd_str,opt = nil)</span>
204
- <span class="method-click-advice">click to toggle source</span>
205
-
206
- </div>
207
-
208
- <div class="method-description">
209
-
210
- <p>
211
- <a href="Cmd.html">Cmd</a> instance
212
- </p>
170
+
171
+ <pre>require 'rbatch'
172
+ r = RBatch::cmd(&quot;ls&quot;)
173
+ p r.stdout
174
+ =&gt; &quot;fileA\nfileB\n&quot;</pre>
175
+
176
+ </div><!-- description -->
177
+
178
+
179
+
180
+
181
+ <div id="5Buntitled-5D" class="documentation-section">
182
+
183
+
184
+
185
+
186
+
187
+
188
+
189
+
190
+ <!-- Methods -->
191
+
192
+ <div id="public-class-method-details" class="method-section section">
193
+ <h3 class="section-header">Public Class Methods</h3>
194
+
195
+
196
+ <div id="new-method" class="method-detail ">
197
+ <a name="method-c-new"></a>
198
+
199
+
200
+ <div class="method-heading">
201
+ <span class="method-name">new</span><span
202
+ class="method-args">(cmd_str,opt = nil)</span>
203
+ <span class="method-click-advice">click to toggle source</span>
204
+ </div>
205
+
206
+
207
+ <div class="method-description">
208
+
209
+ <p><a href="Cmd.html">Cmd</a> instance</p>
210
+
213
211
  <h4>Params</h4>
214
- <p>
215
- <tt>cmd_str</tt> = Command string. Such ad &#8220;ls -l&#8221; <tt>opt</tt>
216
- = Option hash object. Hash keys is follows.
217
- </p>
218
- <ul>
219
- <li><p>
220
- <tt>:raise</tt> (Boolean) = If command exit status is not 0, raise
221
- exception. Default is false.
222
- </p>
223
- </li>
224
- </ul>
225
-
226
-
227
-
228
- <div class="method-source-code"
229
- id="new-source">
212
+
213
+ <p><tt>cmd_str</tt> = Command string. Such ad "ls -l" <tt>opt</tt> = Option
214
+ hash object. Hash keys is follows.</p>
215
+ <ul><li>
216
+ <p><tt>:raise</tt> (Boolean) = If command exit status is not 0, raise
217
+ exception. Default is false.</p>
218
+ </li></ul>
219
+
220
+
221
+
222
+ <div class="method-source-code" id="new-source">
230
223
  <pre>
231
- <span class="ruby-comment cmt"># File lib/rbatch/cmd.rb, line 44</span>
232
- 44: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">cmd_str</span>,<span class="ruby-identifier">opt</span> = <span class="ruby-keyword kw">nil</span>)
233
- 45: <span class="ruby-identifier">raise</span>(<span class="ruby-constant">CmdException</span>,<span class="ruby-value str">&quot;Command string is nil&quot;</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">cmd_str</span>.<span class="ruby-identifier">nil?</span>
234
- 46: <span class="ruby-ivar">@cmd_str</span> = <span class="ruby-identifier">cmd_str</span>
235
- 47: <span class="ruby-comment cmt"># parse option</span>
236
- 48: <span class="ruby-ivar">@opt</span> = <span class="ruby-identifier">@@def_opt</span>.<span class="ruby-identifier">clone</span>
237
- 49: <span class="ruby-identifier">@@def_opt</span>.<span class="ruby-identifier">each_key</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">key</span><span class="ruby-operator">|</span>
238
- 50: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">opt</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">opt</span>[<span class="ruby-identifier">key</span>] <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
239
- 51: <span class="ruby-comment cmt"># use argument</span>
240
- 52: <span class="ruby-ivar">@opt</span>[<span class="ruby-identifier">key</span>] = <span class="ruby-identifier">opt</span>[<span class="ruby-identifier">key</span>]
241
- 53: <span class="ruby-keyword kw">elsif</span> <span class="ruby-constant">RBatch</span>.<span class="ruby-identifier">common_config</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-constant">RBatch</span>.<span class="ruby-identifier">common_config</span>[<span class="ruby-value str">&quot;cmd_&quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">key</span>.<span class="ruby-identifier">to_s</span>] <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
242
- 54: <span class="ruby-comment cmt"># use config</span>
243
- 55: <span class="ruby-ivar">@opt</span>[<span class="ruby-identifier">key</span>] = <span class="ruby-constant">RBatch</span>.<span class="ruby-identifier">common_config</span>[<span class="ruby-value str">&quot;cmd_&quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">key</span>.<span class="ruby-identifier">to_s</span>]
244
- 56: <span class="ruby-keyword kw">else</span>
245
- 57: <span class="ruby-comment cmt"># use default</span>
246
- 58: <span class="ruby-keyword kw">end</span>
247
- 59: <span class="ruby-keyword kw">end</span>
248
- 60: <span class="ruby-keyword kw">end</span></pre>
249
- </div>
250
-
251
- </div>
252
-
253
-
254
-
255
-
256
- </div>
257
-
258
-
259
- </div>
260
-
261
- <div id="public-instance-method-details" class="method-section section">
262
- <h3 class="section-header">Public Instance Methods</h3>
263
-
264
-
265
- <div id="run-method" class="method-detail ">
266
- <a name="method-i-run"></a>
267
-
268
- <div class="method-heading">
269
-
270
- <span class="method-name">run</span><span
271
- class="method-args">()</span>
272
- <span class="method-click-advice">click to toggle source</span>
273
-
274
- </div>
275
-
276
- <div class="method-description">
277
-
278
- <p>
279
- Run command
280
- </p>
224
+ <span class="ruby-comment"># File lib/rbatch/cmd.rb, line 44</span>
225
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">cmd_str</span>,<span class="ruby-identifier">opt</span> = <span class="ruby-keyword">nil</span>)
226
+ <span class="ruby-identifier">raise</span>(<span class="ruby-constant">CmdException</span>,<span class="ruby-string">&quot;Command string is nil&quot;</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">cmd_str</span>.<span class="ruby-identifier">nil?</span>
227
+ <span class="ruby-ivar">@cmd_str</span> = <span class="ruby-identifier">cmd_str</span>
228
+ <span class="ruby-comment"># parse option</span>
229
+ <span class="ruby-ivar">@opt</span> = <span class="ruby-identifier">@@def_opt</span>.<span class="ruby-identifier">clone</span>
230
+ <span class="ruby-identifier">@@def_opt</span>.<span class="ruby-identifier">each_key</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">key</span><span class="ruby-operator">|</span>
231
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">opt</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword">nil</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">opt</span>[<span class="ruby-identifier">key</span>] <span class="ruby-operator">!=</span> <span class="ruby-keyword">nil</span>
232
+ <span class="ruby-comment"># use argument</span>
233
+ <span class="ruby-ivar">@opt</span>[<span class="ruby-identifier">key</span>] = <span class="ruby-identifier">opt</span>[<span class="ruby-identifier">key</span>]
234
+ <span class="ruby-keyword">elsif</span> <span class="ruby-constant">RBatch</span>.<span class="ruby-identifier">common_config</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword">nil</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-constant">RBatch</span>.<span class="ruby-identifier">common_config</span>[<span class="ruby-string">&quot;cmd_&quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">key</span>.<span class="ruby-identifier">to_s</span>] <span class="ruby-operator">!=</span> <span class="ruby-keyword">nil</span>
235
+ <span class="ruby-comment"># use config</span>
236
+ <span class="ruby-ivar">@opt</span>[<span class="ruby-identifier">key</span>] = <span class="ruby-constant">RBatch</span>.<span class="ruby-identifier">common_config</span>[<span class="ruby-string">&quot;cmd_&quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">key</span>.<span class="ruby-identifier">to_s</span>]
237
+ <span class="ruby-keyword">else</span>
238
+ <span class="ruby-comment"># use default</span>
239
+ <span class="ruby-keyword">end</span>
240
+ <span class="ruby-keyword">end</span>
241
+ <span class="ruby-keyword">end</span></pre>
242
+ </div><!-- new-source -->
243
+
244
+ </div>
245
+
246
+
247
+
248
+
249
+ </div><!-- new-method -->
250
+
251
+
252
+ </div><!-- public-class-method-details -->
253
+
254
+ <div id="public-instance-method-details" class="method-section section">
255
+ <h3 class="section-header">Public Instance Methods</h3>
256
+
257
+
258
+ <div id="run-method" class="method-detail ">
259
+ <a name="method-i-run"></a>
260
+
261
+
262
+ <div class="method-heading">
263
+ <span class="method-name">run</span><span
264
+ class="method-args">()</span>
265
+ <span class="method-click-advice">click to toggle source</span>
266
+ </div>
267
+
268
+
269
+ <div class="method-description">
270
+
271
+ <p>Run command</p>
272
+
281
273
  <h4>Return</h4>
282
- <p>
283
- instance of <a href="CmdResult.html">RBatch::CmdResult</a>
284
- </p>
285
-
286
-
287
-
288
- <div class="method-source-code"
289
- id="run-source">
274
+
275
+ <p>instance of <a href="CmdResult.html">RBatch::CmdResult</a></p>
276
+
277
+
278
+
279
+ <div class="method-source-code" id="run-source">
290
280
  <pre>
291
- <span class="ruby-comment cmt"># File lib/rbatch/cmd.rb, line 67</span>
292
- 67: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">run</span>()
293
- 68: <span class="ruby-identifier">stdout_file</span> = <span class="ruby-constant">Tempfile</span><span class="ruby-operator">::</span><span class="ruby-identifier">new</span>(<span class="ruby-value str">&quot;rbatch_tmpout&quot;</span>,<span class="ruby-constant">RBatch</span><span class="ruby-operator">::</span><span class="ruby-identifier">tmp_dir</span>)
294
- 69: <span class="ruby-identifier">stderr_file</span> = <span class="ruby-constant">Tempfile</span><span class="ruby-operator">::</span><span class="ruby-identifier">new</span>(<span class="ruby-value str">&quot;rbatch_tmperr&quot;</span>,<span class="ruby-constant">RBatch</span><span class="ruby-operator">::</span><span class="ruby-identifier">tmp_dir</span>)
295
- 70: <span class="ruby-identifier">pid</span> = <span class="ruby-identifier">spawn</span>(<span class="ruby-ivar">@cmd_str</span>,<span class="ruby-value">:out</span> =<span class="ruby-operator">&gt;</span> [<span class="ruby-identifier">stdout_file</span>,<span class="ruby-value str">&quot;w&quot;</span>],<span class="ruby-value">:err</span> =<span class="ruby-operator">&gt;</span> [<span class="ruby-identifier">stderr_file</span>,<span class="ruby-value str">&quot;w&quot;</span>])
296
- 71: <span class="ruby-identifier">status</span> = <span class="ruby-constant">Process</span>.<span class="ruby-identifier">waitpid2</span>(<span class="ruby-identifier">pid</span>)[<span class="ruby-value">1</span>] <span class="ruby-operator">&gt;&gt;</span> <span class="ruby-value">8</span>
297
- 72: <span class="ruby-identifier">result</span> = <span class="ruby-constant">RBatch</span><span class="ruby-operator">::</span><span class="ruby-constant">CmdResult</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">stdout_file</span>,<span class="ruby-identifier">stderr_file</span>,<span class="ruby-identifier">status</span>,<span class="ruby-ivar">@cmd_str</span>)
298
- 73: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@opt</span>[<span class="ruby-value">:raise</span>] <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">status</span> <span class="ruby-operator">!=</span> <span class="ruby-value">0</span>
299
- 74: <span class="ruby-identifier">raise</span>(<span class="ruby-constant">CmdException</span>,<span class="ruby-value str">&quot;Command exit status is not 0. result: &quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">result</span>.<span class="ruby-identifier">to_s</span>)
300
- 75: <span class="ruby-keyword kw">end</span>
301
- 76: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">result</span>
302
- 77: <span class="ruby-keyword kw">end</span></pre>
303
- </div>
304
-
305
- </div>
306
-
307
-
308
-
309
-
310
- </div>
311
-
312
-
313
- </div>
314
-
315
-
316
- </div>
317
-
318
-
319
- <div id="rdoc-debugging-section-dump" class="debugging-section">
320
-
321
- <p>Disabled; run with --debug to generate this.</p>
322
-
323
- </div>
324
-
325
- <div id="validator-badges">
326
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
327
- <p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
328
- Rdoc Generator</a> 1.1.6</small>.</p>
329
- </div>
281
+ <span class="ruby-comment"># File lib/rbatch/cmd.rb, line 67</span>
282
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">run</span>()
283
+ <span class="ruby-identifier">stdout_file</span> = <span class="ruby-constant">Tempfile</span><span class="ruby-operator">::</span><span class="ruby-identifier">new</span>(<span class="ruby-string">&quot;rbatch_tmpout&quot;</span>,<span class="ruby-constant">RBatch</span><span class="ruby-operator">::</span><span class="ruby-identifier">tmp_dir</span>)
284
+ <span class="ruby-identifier">stderr_file</span> = <span class="ruby-constant">Tempfile</span><span class="ruby-operator">::</span><span class="ruby-identifier">new</span>(<span class="ruby-string">&quot;rbatch_tmperr&quot;</span>,<span class="ruby-constant">RBatch</span><span class="ruby-operator">::</span><span class="ruby-identifier">tmp_dir</span>)
285
+ <span class="ruby-identifier">pid</span> = <span class="ruby-identifier">spawn</span>(<span class="ruby-ivar">@cmd_str</span>,<span class="ruby-value">:out</span> =<span class="ruby-operator">&gt;</span> [<span class="ruby-identifier">stdout_file</span>,<span class="ruby-string">&quot;w&quot;</span>],<span class="ruby-value">:err</span> =<span class="ruby-operator">&gt;</span> [<span class="ruby-identifier">stderr_file</span>,<span class="ruby-string">&quot;w&quot;</span>])
286
+ <span class="ruby-identifier">status</span> = <span class="ruby-constant">Process</span>.<span class="ruby-identifier">waitpid2</span>(<span class="ruby-identifier">pid</span>)[<span class="ruby-value">1</span>] <span class="ruby-operator">&gt;&gt;</span> <span class="ruby-value">8</span>
287
+ <span class="ruby-identifier">result</span> = <span class="ruby-constant">RBatch</span><span class="ruby-operator">::</span><span class="ruby-constant">CmdResult</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">stdout_file</span>,<span class="ruby-identifier">stderr_file</span>,<span class="ruby-identifier">status</span>,<span class="ruby-ivar">@cmd_str</span>)
288
+ <span class="ruby-keyword">if</span> <span class="ruby-ivar">@opt</span>[<span class="ruby-value">:raise</span>] <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">status</span> <span class="ruby-operator">!=</span> <span class="ruby-value">0</span>
289
+ <span class="ruby-identifier">raise</span>(<span class="ruby-constant">CmdException</span>,<span class="ruby-string">&quot;Command exit status is not 0. result: &quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">result</span>.<span class="ruby-identifier">to_s</span>)
290
+ <span class="ruby-keyword">end</span>
291
+ <span class="ruby-keyword">return</span> <span class="ruby-identifier">result</span>
292
+ <span class="ruby-keyword">end</span></pre>
293
+ </div><!-- run-source -->
294
+
295
+ </div>
296
+
297
+
298
+
299
+
300
+ </div><!-- run-method -->
301
+
302
+
303
+ </div><!-- public-instance-method-details -->
304
+
305
+ </div><!-- 5Buntitled-5D -->
306
+
307
+
308
+ </div><!-- documentation -->
309
+
310
+ <div id="validator-badges">
311
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
312
+ <p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
313
+ Rdoc Generator</a> 2</small>.</p>
314
+ </div>
330
315
 
331
316
  </body>
332
317
  </html>