rbatch 2.1.6 → 2.1.7
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/.gitignore +1 -0
- data/README.ja.md +5 -2
- data/README.md +12 -8
- data/lib/rbatch/cmd.rb +51 -10
- data/lib/rbatch/config.rb +47 -10
- data/lib/rbatch/controller.rb +1 -0
- data/lib/rbatch/double_run_checker.rb +2 -0
- data/lib/rbatch/journal.rb +1 -0
- data/lib/rbatch/log.rb +111 -41
- data/lib/rbatch/run_conf.rb +1 -0
- data/lib/rbatch/variables.rb +2 -0
- data/lib/rbatch/version.rb +1 -1
- data/lib/rbatch.rb +46 -0
- data/spec/rbatch/config_spec.rb +26 -0
- metadata +3 -61
- data/doc/RBatch/Cmd.html +0 -321
- data/doc/RBatch/CmdException.html +0 -164
- data/doc/RBatch/CmdResult.html +0 -494
- data/doc/RBatch/CommonConfig/Exception.html +0 -159
- data/doc/RBatch/CommonConfig.html +0 -456
- data/doc/RBatch/Config/Exception.html +0 -159
- data/doc/RBatch/Config.html +0 -416
- data/doc/RBatch/Controller.html +0 -374
- data/doc/RBatch/DoubleRunCheckException.html +0 -164
- data/doc/RBatch/DoubleRunChecker.html +0 -279
- data/doc/RBatch/Journal.html +0 -332
- data/doc/RBatch/Log.html +0 -667
- data/doc/RBatch/LogException.html +0 -164
- data/doc/RBatch/RBatch/RBatch/ConfigException.html +0 -164
- data/doc/RBatch/RBatch/RBatch.html +0 -163
- data/doc/RBatch/RBatch/VariablesException.html +0 -164
- data/doc/RBatch/RBatch.html +0 -165
- data/doc/RBatch/RunConf/Exception.html +0 -164
- data/doc/RBatch/RunConf.html +0 -503
- data/doc/RBatch/Variables.html +0 -437
- data/doc/RBatch.html +0 -411
- data/doc/created.rid +0 -11
- data/doc/images/brick.png +0 -0
- data/doc/images/brick_link.png +0 -0
- data/doc/images/bug.png +0 -0
- data/doc/images/bullet_black.png +0 -0
- data/doc/images/bullet_toggle_minus.png +0 -0
- data/doc/images/bullet_toggle_plus.png +0 -0
- data/doc/images/date.png +0 -0
- data/doc/images/find.png +0 -0
- data/doc/images/loadingAnimation.gif +0 -0
- data/doc/images/macFFBgHack.png +0 -0
- data/doc/images/package.png +0 -0
- data/doc/images/page_green.png +0 -0
- data/doc/images/page_white_text.png +0 -0
- data/doc/images/page_white_width.png +0 -0
- data/doc/images/plugin.png +0 -0
- data/doc/images/ruby.png +0 -0
- data/doc/images/tag_green.png +0 -0
- data/doc/images/wrench.png +0 -0
- data/doc/images/wrench_orange.png +0 -0
- data/doc/images/zoom.png +0 -0
- data/doc/index.html +0 -197
- data/doc/js/darkfish.js +0 -118
- data/doc/js/jquery.js +0 -32
- data/doc/js/quicksearch.js +0 -114
- data/doc/js/thickbox-compressed.js +0 -10
- data/doc/lib/rbatch/cmd_rb.html +0 -60
- data/doc/lib/rbatch/common_config_rb.html +0 -56
- data/doc/lib/rbatch/config_rb.html +0 -56
- data/doc/lib/rbatch/controller_rb.html +0 -66
- data/doc/lib/rbatch/double_run_checker_rb.html +0 -56
- data/doc/lib/rbatch/journal_rb.html +0 -52
- data/doc/lib/rbatch/log_rb.html +0 -60
- data/doc/lib/rbatch/run_conf_rb.html +0 -56
- data/doc/lib/rbatch/variables_rb.html +0 -54
- data/doc/lib/rbatch/version_rb.html +0 -52
- data/doc/lib/rbatch_rb.html +0 -54
- data/doc/rdoc.css +0 -763
metadata
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: rbatch
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
4
|
prerelease:
|
|
5
|
-
version: 2.1.
|
|
5
|
+
version: 2.1.7
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
8
8
|
- fetaro
|
|
@@ -10,7 +10,7 @@ autorequire:
|
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
12
|
|
|
13
|
-
date: 2014-
|
|
13
|
+
date: 2014-02-13 00:00:00 Z
|
|
14
14
|
dependencies: []
|
|
15
15
|
|
|
16
16
|
description: Simple Framework of Batch Script
|
|
@@ -31,65 +31,6 @@ files:
|
|
|
31
31
|
- README.md
|
|
32
32
|
- Rakefile
|
|
33
33
|
- bin/rbatch-init
|
|
34
|
-
- doc/RBatch.html
|
|
35
|
-
- doc/RBatch/Cmd.html
|
|
36
|
-
- doc/RBatch/CmdException.html
|
|
37
|
-
- doc/RBatch/CmdResult.html
|
|
38
|
-
- doc/RBatch/CommonConfig.html
|
|
39
|
-
- doc/RBatch/CommonConfig/Exception.html
|
|
40
|
-
- doc/RBatch/Config.html
|
|
41
|
-
- doc/RBatch/Config/Exception.html
|
|
42
|
-
- doc/RBatch/Controller.html
|
|
43
|
-
- doc/RBatch/DoubleRunCheckException.html
|
|
44
|
-
- doc/RBatch/DoubleRunChecker.html
|
|
45
|
-
- doc/RBatch/Journal.html
|
|
46
|
-
- doc/RBatch/Log.html
|
|
47
|
-
- doc/RBatch/LogException.html
|
|
48
|
-
- doc/RBatch/RBatch.html
|
|
49
|
-
- doc/RBatch/RBatch/RBatch.html
|
|
50
|
-
- doc/RBatch/RBatch/RBatch/ConfigException.html
|
|
51
|
-
- doc/RBatch/RBatch/VariablesException.html
|
|
52
|
-
- doc/RBatch/RunConf.html
|
|
53
|
-
- doc/RBatch/RunConf/Exception.html
|
|
54
|
-
- doc/RBatch/Variables.html
|
|
55
|
-
- doc/created.rid
|
|
56
|
-
- doc/images/brick.png
|
|
57
|
-
- doc/images/brick_link.png
|
|
58
|
-
- doc/images/bug.png
|
|
59
|
-
- doc/images/bullet_black.png
|
|
60
|
-
- doc/images/bullet_toggle_minus.png
|
|
61
|
-
- doc/images/bullet_toggle_plus.png
|
|
62
|
-
- doc/images/date.png
|
|
63
|
-
- doc/images/find.png
|
|
64
|
-
- doc/images/loadingAnimation.gif
|
|
65
|
-
- doc/images/macFFBgHack.png
|
|
66
|
-
- doc/images/package.png
|
|
67
|
-
- doc/images/page_green.png
|
|
68
|
-
- doc/images/page_white_text.png
|
|
69
|
-
- doc/images/page_white_width.png
|
|
70
|
-
- doc/images/plugin.png
|
|
71
|
-
- doc/images/ruby.png
|
|
72
|
-
- doc/images/tag_green.png
|
|
73
|
-
- doc/images/wrench.png
|
|
74
|
-
- doc/images/wrench_orange.png
|
|
75
|
-
- doc/images/zoom.png
|
|
76
|
-
- doc/index.html
|
|
77
|
-
- doc/js/darkfish.js
|
|
78
|
-
- doc/js/jquery.js
|
|
79
|
-
- doc/js/quicksearch.js
|
|
80
|
-
- doc/js/thickbox-compressed.js
|
|
81
|
-
- doc/lib/rbatch/cmd_rb.html
|
|
82
|
-
- doc/lib/rbatch/common_config_rb.html
|
|
83
|
-
- doc/lib/rbatch/config_rb.html
|
|
84
|
-
- doc/lib/rbatch/controller_rb.html
|
|
85
|
-
- doc/lib/rbatch/double_run_checker_rb.html
|
|
86
|
-
- doc/lib/rbatch/journal_rb.html
|
|
87
|
-
- doc/lib/rbatch/log_rb.html
|
|
88
|
-
- doc/lib/rbatch/run_conf_rb.html
|
|
89
|
-
- doc/lib/rbatch/variables_rb.html
|
|
90
|
-
- doc/lib/rbatch/version_rb.html
|
|
91
|
-
- doc/lib/rbatch_rb.html
|
|
92
|
-
- doc/rdoc.css
|
|
93
34
|
- lib/rbatch.rb
|
|
94
35
|
- lib/rbatch/cmd.rb
|
|
95
36
|
- lib/rbatch/config.rb
|
|
@@ -164,3 +105,4 @@ test_files:
|
|
|
164
105
|
- spec/rbatch/run_conf_spec.rb
|
|
165
106
|
- spec/rbatch/variables_spec.rb
|
|
166
107
|
- spec/spec_helper.rb
|
|
108
|
+
has_rdoc:
|
data/doc/RBatch/Cmd.html
DELETED
|
@@ -1,321 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
|
3
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
|
4
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
5
|
-
<head>
|
|
6
|
-
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
|
|
7
|
-
|
|
8
|
-
<title>Class: RBatch::Cmd</title>
|
|
9
|
-
|
|
10
|
-
<link rel="stylesheet" href="../rdoc.css" type="text/css" media="screen" />
|
|
11
|
-
|
|
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>
|
|
16
|
-
|
|
17
|
-
</head>
|
|
18
|
-
<body id="top" class="class">
|
|
19
|
-
|
|
20
|
-
<div id="metadata">
|
|
21
|
-
<div id="home-metadata">
|
|
22
|
-
<div id="home-section" class="section">
|
|
23
|
-
<h3 class="section-header">
|
|
24
|
-
<a href="../index.html">Home</a>
|
|
25
|
-
<a href="../index.html#classes">Classes</a>
|
|
26
|
-
<a href="../index.html#methods">Methods</a>
|
|
27
|
-
</h3>
|
|
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&height=550&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-def_vars-3D">::def_vars=</a></li>
|
|
69
|
-
|
|
70
|
-
<li><a href="#method-c-new">::new</a></li>
|
|
71
|
-
|
|
72
|
-
<li><a href="#method-i-run">#run</a></li>
|
|
73
|
-
|
|
74
|
-
</ul>
|
|
75
|
-
</div>
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
</div>
|
|
80
|
-
|
|
81
|
-
<div id="project-metadata">
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
<div id="classindex-section" class="section project-section">
|
|
86
|
-
<h3 class="section-header">Class/Module Index
|
|
87
|
-
<span class="search-toggle"><img src="../images/find.png"
|
|
88
|
-
height="16" width="16" alt="[+]"
|
|
89
|
-
title="show/hide quicksearch" /></span></h3>
|
|
90
|
-
<form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
|
|
91
|
-
<fieldset>
|
|
92
|
-
<legend>Quicksearch</legend>
|
|
93
|
-
<input type="text" name="quicksearch" value=""
|
|
94
|
-
class="quicksearch-field" />
|
|
95
|
-
</fieldset>
|
|
96
|
-
</form>
|
|
97
|
-
|
|
98
|
-
<ul class="link-list">
|
|
99
|
-
|
|
100
|
-
<li><a href="../RBatch.html">RBatch</a></li>
|
|
101
|
-
|
|
102
|
-
<li><a href="../RBatch/Cmd.html">RBatch::Cmd</a></li>
|
|
103
|
-
|
|
104
|
-
<li><a href="../RBatch/CmdException.html">RBatch::CmdException</a></li>
|
|
105
|
-
|
|
106
|
-
<li><a href="../RBatch/CmdResult.html">RBatch::CmdResult</a></li>
|
|
107
|
-
|
|
108
|
-
<li><a href="../RBatch/Config.html">RBatch::Config</a></li>
|
|
109
|
-
|
|
110
|
-
<li><a href="../RBatch/Controller.html">RBatch::Controller</a></li>
|
|
111
|
-
|
|
112
|
-
<li><a href="../RBatch/DoubleRunCheckException.html">RBatch::DoubleRunCheckException</a></li>
|
|
113
|
-
|
|
114
|
-
<li><a href="../RBatch/DoubleRunChecker.html">RBatch::DoubleRunChecker</a></li>
|
|
115
|
-
|
|
116
|
-
<li><a href="../RBatch/Journal.html">RBatch::Journal</a></li>
|
|
117
|
-
|
|
118
|
-
<li><a href="../RBatch/Log.html">RBatch::Log</a></li>
|
|
119
|
-
|
|
120
|
-
<li><a href="../RBatch/LogException.html">RBatch::LogException</a></li>
|
|
121
|
-
|
|
122
|
-
<li><a href="../RBatch/RBatch.html">RBatch::RBatch</a></li>
|
|
123
|
-
|
|
124
|
-
<li><a href="../RBatch/RBatch/RBatch.html">RBatch::RBatch::RBatch</a></li>
|
|
125
|
-
|
|
126
|
-
<li><a href="../RBatch/RBatch/RBatch/ConfigException.html">RBatch::RBatch::RBatch::ConfigException</a></li>
|
|
127
|
-
|
|
128
|
-
<li><a href="../RBatch/RBatch/VariablesException.html">RBatch::RBatch::VariablesException</a></li>
|
|
129
|
-
|
|
130
|
-
<li><a href="../RBatch/RunConf.html">RBatch::RunConf</a></li>
|
|
131
|
-
|
|
132
|
-
<li><a href="../RBatch/RunConf/Exception.html">RBatch::RunConf::Exception</a></li>
|
|
133
|
-
|
|
134
|
-
<li><a href="../RBatch/Variables.html">RBatch::Variables</a></li>
|
|
135
|
-
|
|
136
|
-
</ul>
|
|
137
|
-
<div id="no-class-search-results" style="display: none;">No matching classes.</div>
|
|
138
|
-
</div>
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
</div>
|
|
142
|
-
</div>
|
|
143
|
-
|
|
144
|
-
<div id="documentation">
|
|
145
|
-
<h1 class="class">RBatch::Cmd</h1>
|
|
146
|
-
|
|
147
|
-
<div id="description" class="description">
|
|
148
|
-
|
|
149
|
-
</div><!-- description -->
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
<div id="5Buntitled-5D" class="documentation-section">
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
<!-- Methods -->
|
|
164
|
-
|
|
165
|
-
<div id="public-class-method-details" class="method-section section">
|
|
166
|
-
<h3 class="section-header">Public Class Methods</h3>
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
<div id="def_vars-3D-method" class="method-detail ">
|
|
170
|
-
<a name="method-c-def_vars-3D"></a>
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
<div class="method-heading">
|
|
174
|
-
<span class="method-name">def_vars=</span><span
|
|
175
|
-
class="method-args">(a)</span>
|
|
176
|
-
<span class="method-click-advice">click to toggle source</span>
|
|
177
|
-
</div>
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
<div class="method-description">
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
<div class="method-source-code" id="def_vars-3D-source">
|
|
187
|
-
<pre>
|
|
188
|
-
<span class="ruby-comment"># File lib/rbatch/cmd.rb, line 9</span>
|
|
189
|
-
<span class="ruby-keyword">def</span> <span class="ruby-constant">Cmd</span>.<span class="ruby-identifier">def_vars=</span>(<span class="ruby-identifier">a</span>) ; <span class="ruby-identifier">@@def_vars</span>=<span class="ruby-identifier">a</span> ; <span class="ruby-keyword">end</span></pre>
|
|
190
|
-
</div><!-- def_vars-3D-source -->
|
|
191
|
-
|
|
192
|
-
</div>
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
</div><!-- def_vars-3D-method -->
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
<div id="new-method" class="method-detail ">
|
|
201
|
-
<a name="method-c-new"></a>
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
<div class="method-heading">
|
|
205
|
-
<span class="method-name">new</span><span
|
|
206
|
-
class="method-args">(cmd_str,opt = nil)</span>
|
|
207
|
-
<span class="method-click-advice">click to toggle source</span>
|
|
208
|
-
</div>
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
<div class="method-description">
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
<div class="method-source-code" id="new-source">
|
|
218
|
-
<pre>
|
|
219
|
-
<span class="ruby-comment"># File lib/rbatch/cmd.rb, line 13</span>
|
|
220
|
-
<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>)
|
|
221
|
-
<span class="ruby-identifier">raise</span>(<span class="ruby-constant">CmdException</span>,<span class="ruby-string">"Command string is nil"</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">cmd_str</span>.<span class="ruby-identifier">nil?</span>
|
|
222
|
-
<span class="ruby-ivar">@cmd_str</span> = <span class="ruby-identifier">cmd_str</span>
|
|
223
|
-
<span class="ruby-ivar">@vars</span> = <span class="ruby-identifier">@@def_vars</span>.<span class="ruby-identifier">clone</span>
|
|
224
|
-
<span class="ruby-keyword">if</span> <span class="ruby-operator">!</span> <span class="ruby-identifier">opt</span>.<span class="ruby-identifier">nil?</span>
|
|
225
|
-
<span class="ruby-comment"># change opt key from "hoge" to "log_hoge"</span>
|
|
226
|
-
<span class="ruby-identifier">tmp</span> = {}
|
|
227
|
-
<span class="ruby-identifier">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>
|
|
228
|
-
<span class="ruby-identifier">tmp</span>[(<span class="ruby-string">"cmd_"</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">key</span>.<span class="ruby-identifier">to_s</span>).<span class="ruby-identifier">to_sym</span>] = <span class="ruby-identifier">opt</span>[<span class="ruby-identifier">key</span>]
|
|
229
|
-
<span class="ruby-keyword">end</span>
|
|
230
|
-
<span class="ruby-ivar">@vars</span>.<span class="ruby-identifier">merge!</span>(<span class="ruby-identifier">tmp</span>)
|
|
231
|
-
<span class="ruby-keyword">end</span>
|
|
232
|
-
<span class="ruby-keyword">end</span></pre>
|
|
233
|
-
</div><!-- new-source -->
|
|
234
|
-
|
|
235
|
-
</div>
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
</div><!-- new-method -->
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
</div><!-- public-class-method-details -->
|
|
244
|
-
|
|
245
|
-
<div id="public-instance-method-details" class="method-section section">
|
|
246
|
-
<h3 class="section-header">Public Instance Methods</h3>
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
<div id="run-method" class="method-detail ">
|
|
250
|
-
<a name="method-i-run"></a>
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
<div class="method-heading">
|
|
254
|
-
<span class="method-name">run</span><span
|
|
255
|
-
class="method-args">()</span>
|
|
256
|
-
<span class="method-click-advice">click to toggle source</span>
|
|
257
|
-
</div>
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
<div class="method-description">
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
<div class="method-source-code" id="run-source">
|
|
267
|
-
<pre>
|
|
268
|
-
<span class="ruby-comment"># File lib/rbatch/cmd.rb, line 27</span>
|
|
269
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">run</span>()
|
|
270
|
-
<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">"rbatch_tmpout"</span>,<span class="ruby-constant">Dir</span>.<span class="ruby-identifier">tmpdir</span>)
|
|
271
|
-
<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">"rbatch_tmperr"</span>,<span class="ruby-constant">Dir</span>.<span class="ruby-identifier">tmpdir</span>)
|
|
272
|
-
<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">></span> [<span class="ruby-identifier">stdout_file</span>,<span class="ruby-string">"w"</span>],<span class="ruby-value">:err</span> =<span class="ruby-operator">></span> [<span class="ruby-identifier">stderr_file</span>,<span class="ruby-string">"w"</span>])
|
|
273
|
-
<span class="ruby-identifier">status</span> = <span class="ruby-keyword">nil</span>
|
|
274
|
-
<span class="ruby-keyword">if</span> <span class="ruby-ivar">@vars</span>[<span class="ruby-value">:cmd_timeout</span>] <span class="ruby-operator">!=</span> <span class="ruby-value">0</span>
|
|
275
|
-
<span class="ruby-keyword">begin</span>
|
|
276
|
-
<span class="ruby-identifier">timeout</span>(<span class="ruby-ivar">@vars</span>[<span class="ruby-value">:cmd_timeout</span>]) <span class="ruby-keyword">do</span>
|
|
277
|
-
<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">>></span> <span class="ruby-value">8</span>
|
|
278
|
-
<span class="ruby-keyword">end</span>
|
|
279
|
-
<span class="ruby-keyword">rescue</span> <span class="ruby-constant">Timeout</span><span class="ruby-operator">::</span><span class="ruby-constant">Error</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">e</span>
|
|
280
|
-
<span class="ruby-keyword">begin</span>
|
|
281
|
-
<span class="ruby-constant">Process</span>.<span class="ruby-identifier">kill</span>(<span class="ruby-string">'SIGINT'</span>, <span class="ruby-identifier">pid</span>)
|
|
282
|
-
<span class="ruby-identifier">raise</span>(<span class="ruby-constant">CmdException</span>,<span class="ruby-node">"Run time of command \"#{@cmd_str}\" is over #{@vars[:cmd_timeout].to_s} sec. Success to kill process : PID=#{pid}"</span> )
|
|
283
|
-
<span class="ruby-keyword">rescue</span>
|
|
284
|
-
<span class="ruby-identifier">raise</span>(<span class="ruby-constant">CmdException</span>,<span class="ruby-node">"Run time of command \"#{@cmd_str}\" is over #{@vars[:cmd_timeout].to_s} sec. Fail to kill process : PID=#{pid}"</span> )
|
|
285
|
-
<span class="ruby-keyword">end</span>
|
|
286
|
-
<span class="ruby-keyword">end</span>
|
|
287
|
-
<span class="ruby-keyword">else</span>
|
|
288
|
-
<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">>></span> <span class="ruby-value">8</span>
|
|
289
|
-
<span class="ruby-keyword">end</span>
|
|
290
|
-
<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>)
|
|
291
|
-
<span class="ruby-keyword">if</span> <span class="ruby-ivar">@vars</span>[<span class="ruby-value">:cmd_raise</span>] <span class="ruby-operator">&&</span> <span class="ruby-identifier">status</span> <span class="ruby-operator">!=</span> <span class="ruby-value">0</span>
|
|
292
|
-
<span class="ruby-identifier">raise</span>(<span class="ruby-constant">CmdException</span>,<span class="ruby-string">"Command exit status is not 0. result: "</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">result</span>.<span class="ruby-identifier">to_s</span>)
|
|
293
|
-
<span class="ruby-keyword">end</span>
|
|
294
|
-
<span class="ruby-keyword">return</span> <span class="ruby-identifier">result</span>
|
|
295
|
-
<span class="ruby-keyword">end</span></pre>
|
|
296
|
-
</div><!-- run-source -->
|
|
297
|
-
|
|
298
|
-
</div>
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
</div><!-- run-method -->
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
</div><!-- public-instance-method-details -->
|
|
307
|
-
|
|
308
|
-
</div><!-- 5Buntitled-5D -->
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
</div><!-- documentation -->
|
|
312
|
-
|
|
313
|
-
<div id="validator-badges">
|
|
314
|
-
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
|
315
|
-
<p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
|
|
316
|
-
Rdoc Generator</a> 2</small>.</p>
|
|
317
|
-
</div>
|
|
318
|
-
|
|
319
|
-
</body>
|
|
320
|
-
</html>
|
|
321
|
-
|
|
@@ -1,164 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
|
3
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
|
4
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
5
|
-
<head>
|
|
6
|
-
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
|
|
7
|
-
|
|
8
|
-
<title>Class: RBatch::CmdException</title>
|
|
9
|
-
|
|
10
|
-
<link rel="stylesheet" href="../rdoc.css" type="text/css" media="screen" />
|
|
11
|
-
|
|
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>
|
|
16
|
-
|
|
17
|
-
</head>
|
|
18
|
-
<body id="top" class="class">
|
|
19
|
-
|
|
20
|
-
<div id="metadata">
|
|
21
|
-
<div id="home-metadata">
|
|
22
|
-
<div id="home-section" class="section">
|
|
23
|
-
<h3 class="section-header">
|
|
24
|
-
<a href="../index.html">Home</a>
|
|
25
|
-
<a href="../index.html#classes">Classes</a>
|
|
26
|
-
<a href="../index.html#methods">Methods</a>
|
|
27
|
-
</h3>
|
|
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&height=550&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">StandardError</p>
|
|
54
|
-
|
|
55
|
-
</div>
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
</div>
|
|
66
|
-
|
|
67
|
-
<div id="project-metadata">
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
<div id="classindex-section" class="section project-section">
|
|
72
|
-
<h3 class="section-header">Class/Module Index
|
|
73
|
-
<span class="search-toggle"><img src="../images/find.png"
|
|
74
|
-
height="16" width="16" alt="[+]"
|
|
75
|
-
title="show/hide quicksearch" /></span></h3>
|
|
76
|
-
<form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
|
|
77
|
-
<fieldset>
|
|
78
|
-
<legend>Quicksearch</legend>
|
|
79
|
-
<input type="text" name="quicksearch" value=""
|
|
80
|
-
class="quicksearch-field" />
|
|
81
|
-
</fieldset>
|
|
82
|
-
</form>
|
|
83
|
-
|
|
84
|
-
<ul class="link-list">
|
|
85
|
-
|
|
86
|
-
<li><a href="../RBatch.html">RBatch</a></li>
|
|
87
|
-
|
|
88
|
-
<li><a href="../RBatch/Cmd.html">RBatch::Cmd</a></li>
|
|
89
|
-
|
|
90
|
-
<li><a href="../RBatch/CmdException.html">RBatch::CmdException</a></li>
|
|
91
|
-
|
|
92
|
-
<li><a href="../RBatch/CmdResult.html">RBatch::CmdResult</a></li>
|
|
93
|
-
|
|
94
|
-
<li><a href="../RBatch/Config.html">RBatch::Config</a></li>
|
|
95
|
-
|
|
96
|
-
<li><a href="../RBatch/Controller.html">RBatch::Controller</a></li>
|
|
97
|
-
|
|
98
|
-
<li><a href="../RBatch/DoubleRunCheckException.html">RBatch::DoubleRunCheckException</a></li>
|
|
99
|
-
|
|
100
|
-
<li><a href="../RBatch/DoubleRunChecker.html">RBatch::DoubleRunChecker</a></li>
|
|
101
|
-
|
|
102
|
-
<li><a href="../RBatch/Journal.html">RBatch::Journal</a></li>
|
|
103
|
-
|
|
104
|
-
<li><a href="../RBatch/Log.html">RBatch::Log</a></li>
|
|
105
|
-
|
|
106
|
-
<li><a href="../RBatch/LogException.html">RBatch::LogException</a></li>
|
|
107
|
-
|
|
108
|
-
<li><a href="../RBatch/RBatch.html">RBatch::RBatch</a></li>
|
|
109
|
-
|
|
110
|
-
<li><a href="../RBatch/RBatch/RBatch.html">RBatch::RBatch::RBatch</a></li>
|
|
111
|
-
|
|
112
|
-
<li><a href="../RBatch/RBatch/RBatch/ConfigException.html">RBatch::RBatch::RBatch::ConfigException</a></li>
|
|
113
|
-
|
|
114
|
-
<li><a href="../RBatch/RBatch/VariablesException.html">RBatch::RBatch::VariablesException</a></li>
|
|
115
|
-
|
|
116
|
-
<li><a href="../RBatch/RunConf.html">RBatch::RunConf</a></li>
|
|
117
|
-
|
|
118
|
-
<li><a href="../RBatch/RunConf/Exception.html">RBatch::RunConf::Exception</a></li>
|
|
119
|
-
|
|
120
|
-
<li><a href="../RBatch/Variables.html">RBatch::Variables</a></li>
|
|
121
|
-
|
|
122
|
-
</ul>
|
|
123
|
-
<div id="no-class-search-results" style="display: none;">No matching classes.</div>
|
|
124
|
-
</div>
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
</div>
|
|
128
|
-
</div>
|
|
129
|
-
|
|
130
|
-
<div id="documentation">
|
|
131
|
-
<h1 class="class">RBatch::CmdException</h1>
|
|
132
|
-
|
|
133
|
-
<div id="description" class="description">
|
|
134
|
-
|
|
135
|
-
</div><!-- description -->
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
<div id="5Buntitled-5D" class="documentation-section">
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
<!-- Methods -->
|
|
150
|
-
|
|
151
|
-
</div><!-- 5Buntitled-5D -->
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
</div><!-- documentation -->
|
|
155
|
-
|
|
156
|
-
<div id="validator-badges">
|
|
157
|
-
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
|
158
|
-
<p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
|
|
159
|
-
Rdoc Generator</a> 2</small>.</p>
|
|
160
|
-
</div>
|
|
161
|
-
|
|
162
|
-
</body>
|
|
163
|
-
</html>
|
|
164
|
-
|