rbatch 1.13.1 → 2.0.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.
- data/CHANGELOG +15 -0
- data/README.ja.md +81 -49
- data/README.md +88 -63
- data/Rakefile +2 -31
- data/bin/rbatch-init +57 -32
- data/{rdocs → doc}/RBatch/Cmd.html +66 -59
- data/{rdocs → doc}/RBatch/CmdException.html +9 -3
- data/{rdocs → doc}/RBatch/CmdResult.html +40 -34
- data/{rdocs → doc}/RBatch/CommonConfig/Exception.html +9 -3
- data/{rdocs → doc}/RBatch/CommonConfig.html +22 -17
- data/{rdocs → doc}/RBatch/Config/Exception.html +9 -3
- data/{rdocs → doc}/RBatch/Config.html +21 -16
- data/{rdocs/RBatchException.html → doc/RBatch/DoubleRunCheckException.html} +33 -30
- data/doc/RBatch/DoubleRunChecker.html +277 -0
- data/{rdocs → doc}/RBatch/Log.html +134 -138
- data/doc/RBatch/RunConf/Exception.html +159 -0
- data/doc/RBatch/RunConf.html +557 -0
- data/doc/RBatch.html +655 -0
- data/doc/created.rid +9 -0
- data/{rdocs → doc}/index.html +46 -20
- data/{rdocs → doc}/lib/rbatch/cmd_rb.html +4 -2
- data/{rdocs → doc}/lib/rbatch/common_config_rb.html +2 -2
- data/{rdocs → doc}/lib/rbatch/config_rb.html +2 -2
- data/doc/lib/rbatch/double_run_checker_rb.html +56 -0
- data/{rdocs → doc}/lib/rbatch/log_rb.html +2 -2
- data/doc/lib/rbatch/run_conf_rb.html +56 -0
- data/{rdocs → doc}/lib/rbatch/version_rb.html +2 -2
- data/{rdocs → doc}/lib/rbatch_rb.html +7 -3
- data/lib/rbatch/cmd.rb +20 -23
- data/lib/rbatch/common_config.rb +2 -3
- data/lib/rbatch/config.rb +1 -2
- data/lib/rbatch/double_run_checker.rb +24 -0
- data/lib/rbatch/log.rb +37 -59
- data/lib/rbatch/run_conf.rb +109 -0
- data/lib/rbatch/version.rb +1 -1
- data/lib/rbatch.rb +37 -56
- data/spec/{cmd_test.spec → cmd_spec.rb} +6 -6
- data/spec/common_config_spec.rb +54 -0
- data/spec/{config_test.spec → config_spec.rb} +2 -1
- data/spec/double_run_checker_spec.rb +10 -0
- data/spec/{log_test.spec → log_spec.rb} +22 -22
- data/spec/rbatch_spec.rb +24 -0
- data/spec/run_conf_spec.rb +85 -0
- metadata +66 -65
- data/rdocs/RBatch.html +0 -713
- data/rdocs/created.rid +0 -7
- data/spec/rbatch_test.spec +0 -25
- data/test/cases/test_cmd.rb +0 -134
- data/test/cases/test_common_config.rb +0 -41
- data/test/cases/test_config.rb +0 -41
- data/test/cases/test_log.rb +0 -613
- data/test/mocks/PrintArgs.exe +0 -0
- data/test/mocks/win_cmd.exe +0 -0
- /data/{rdocs → doc}/images/brick.png +0 -0
- /data/{rdocs → doc}/images/brick_link.png +0 -0
- /data/{rdocs → doc}/images/bug.png +0 -0
- /data/{rdocs → doc}/images/bullet_black.png +0 -0
- /data/{rdocs → doc}/images/bullet_toggle_minus.png +0 -0
- /data/{rdocs → doc}/images/bullet_toggle_plus.png +0 -0
- /data/{rdocs → doc}/images/date.png +0 -0
- /data/{rdocs → doc}/images/find.png +0 -0
- /data/{rdocs → doc}/images/loadingAnimation.gif +0 -0
- /data/{rdocs → doc}/images/macFFBgHack.png +0 -0
- /data/{rdocs → doc}/images/package.png +0 -0
- /data/{rdocs → doc}/images/page_green.png +0 -0
- /data/{rdocs → doc}/images/page_white_text.png +0 -0
- /data/{rdocs → doc}/images/page_white_width.png +0 -0
- /data/{rdocs → doc}/images/plugin.png +0 -0
- /data/{rdocs → doc}/images/ruby.png +0 -0
- /data/{rdocs → doc}/images/tag_green.png +0 -0
- /data/{rdocs → doc}/images/wrench.png +0 -0
- /data/{rdocs → doc}/images/wrench_orange.png +0 -0
- /data/{rdocs → doc}/images/zoom.png +0 -0
- /data/{rdocs → doc}/js/darkfish.js +0 -0
- /data/{rdocs → doc}/js/jquery.js +0 -0
- /data/{rdocs → doc}/js/quicksearch.js +0 -0
- /data/{rdocs → doc}/js/thickbox-compressed.js +0 -0
- /data/{rdocs → doc}/rdoc.css +0 -0
data/bin/rbatch-init
CHANGED
@@ -1,36 +1,36 @@
|
|
1
1
|
#!/usr/local/bin/ruby
|
2
2
|
|
3
3
|
contents = {}
|
4
|
-
contents["bin/hello_world.rb"] = <<EOF
|
5
|
-
require 'rbatch'
|
6
|
-
|
7
|
-
RBatch::Log.new{|log|
|
8
|
-
log.info("hello world")
|
9
|
-
log.info("config value: " + RBatch::config["key1"])
|
10
|
-
result = RBatch.cmd("ls")
|
11
|
-
log.info(result)
|
12
|
-
}
|
13
|
-
|
14
|
-
EOF
|
15
|
-
|
16
|
-
contents["conf/hello_world.yaml"] = <<EOF
|
17
|
-
key1 : value1
|
18
|
-
EOF
|
19
4
|
|
20
|
-
contents["
|
21
|
-
# RBatch
|
5
|
+
contents[".rbatchrc"] = <<EOF
|
6
|
+
# RBatch Run-Conf (.rbatchrc)
|
22
7
|
#
|
23
|
-
# This
|
8
|
+
# This format is YAML.
|
24
9
|
#
|
25
10
|
|
26
11
|
# -------------------
|
27
12
|
# Global setting
|
28
13
|
# -------------------
|
29
14
|
|
15
|
+
# Conf Directory
|
16
|
+
#
|
17
|
+
# Default is "<home>/conf"
|
18
|
+
#
|
19
|
+
# <home> is replaced to ${RB_HOME}
|
20
|
+
#
|
21
|
+
#conf_dir: <home>/config
|
22
|
+
#conf_dir: /etc/rbatch/
|
23
|
+
|
24
|
+
# Common config file name
|
25
|
+
#
|
26
|
+
# Default is "common.yaml"
|
27
|
+
#
|
28
|
+
#common_conf_name: share.yaml
|
29
|
+
|
30
30
|
# Forbit Script Double Run
|
31
31
|
#
|
32
32
|
# Default is false.
|
33
|
-
# If this option is true, two same
|
33
|
+
# If this option is true, two same name scripts cannot run at the same time.
|
34
34
|
#
|
35
35
|
#forbid_double_run: true
|
36
36
|
#forbid_double_run: false
|
@@ -47,29 +47,37 @@ contents["conf/rbatch.yaml"] = <<EOF
|
|
47
47
|
#cmd_raise : true
|
48
48
|
#cmd_raise : false
|
49
49
|
|
50
|
+
# Command Timeout
|
51
|
+
#
|
52
|
+
# Default is 0 [sec].
|
53
|
+
#
|
54
|
+
#cmd_timeout: 5
|
50
55
|
|
51
56
|
# -------------------
|
52
57
|
# Log setting
|
53
58
|
# -------------------
|
54
59
|
|
60
|
+
# Log Directory
|
61
|
+
#
|
62
|
+
# Default is "<home>/log"
|
63
|
+
#
|
64
|
+
# <home> is replaced to ${RB_HOME}
|
65
|
+
#
|
66
|
+
#log_dir: <home>/rb_log
|
67
|
+
#log_dir: /var/log/rbatch/
|
68
|
+
|
55
69
|
# Log File Name
|
56
70
|
#
|
57
71
|
# Default is "<date>_<time>_<prog>.log".
|
58
72
|
# Reservation words are follows.
|
59
|
-
# <data>
|
60
|
-
# <time>
|
61
|
-
# <prog>
|
62
|
-
# <host>
|
73
|
+
# <data> is replaced to YYYYMMDD date string
|
74
|
+
# <time> is replaced to HHMMSS time string
|
75
|
+
# <prog> is replaced to Program file base name (except extention).
|
76
|
+
# <host> is replaced to Hostname.
|
63
77
|
#
|
64
78
|
#log_name : "<date>_<time>_<prog>.log"
|
65
79
|
#log_name : "<date>_<prog>.log"
|
66
80
|
|
67
|
-
# Log Output Directory
|
68
|
-
#
|
69
|
-
# Default is "(Script path)/../log".
|
70
|
-
#
|
71
|
-
#log_dir : "/tmp/log"
|
72
|
-
|
73
81
|
# Append log or not
|
74
82
|
#
|
75
83
|
# Default is ture.
|
@@ -88,7 +96,7 @@ contents["conf/rbatch.yaml"] = <<EOF
|
|
88
96
|
#log_level : "error"
|
89
97
|
#log_level : "fatal"
|
90
98
|
|
91
|
-
# Print log
|
99
|
+
# Print log string both file and STDOUT
|
92
100
|
#
|
93
101
|
# Default is false.
|
94
102
|
#
|
@@ -118,7 +126,7 @@ contents["conf/rbatch.yaml"] = <<EOF
|
|
118
126
|
#
|
119
127
|
#log_send_mail : true
|
120
128
|
|
121
|
-
#
|
129
|
+
# Mail parameters
|
122
130
|
#
|
123
131
|
#log_mail_to : "xxx@sample.com"
|
124
132
|
#log_mail_from : "xxx@sample.com"
|
@@ -127,6 +135,23 @@ contents["conf/rbatch.yaml"] = <<EOF
|
|
127
135
|
|
128
136
|
EOF
|
129
137
|
|
138
|
+
contents["bin/hello_world.rb"] = <<EOF
|
139
|
+
require 'rbatch'
|
140
|
+
|
141
|
+
RBatch::Log.new{|log|
|
142
|
+
log.info("hello world")
|
143
|
+
log.info("config value: " + RBatch::config["key1"])
|
144
|
+
result = RBatch.cmd("ls")
|
145
|
+
log.info(result)
|
146
|
+
}
|
147
|
+
|
148
|
+
EOF
|
149
|
+
|
150
|
+
contents["conf/hello_world.yaml"] = <<EOF
|
151
|
+
key1 : value1
|
152
|
+
EOF
|
153
|
+
|
154
|
+
|
130
155
|
require 'fileutils'
|
131
156
|
["bin","conf","log"].each do | dir |
|
132
157
|
if ! Dir.exists?(dir)
|
@@ -136,7 +161,7 @@ require 'fileutils'
|
|
136
161
|
puts "exist ./" + dir + " (not create)"
|
137
162
|
end
|
138
163
|
end
|
139
|
-
["bin/hello_world.rb","conf/hello_world.yaml","
|
164
|
+
["bin/hello_world.rb","conf/hello_world.yaml",".rbatchrc"].each do | file |
|
140
165
|
if ! File.exists?(file)
|
141
166
|
File.open(file, "w") { |f| f.puts contents[file] }
|
142
167
|
puts "create ./" + file
|
@@ -1,9 +1,9 @@
|
|
1
|
-
<?xml version="1.0" encoding="
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
2
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
3
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=
|
6
|
+
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
|
7
7
|
|
8
8
|
<title>Class: RBatch::Cmd</title>
|
9
9
|
|
@@ -116,9 +116,15 @@
|
|
116
116
|
|
117
117
|
<li><a href="../RBatch/Config/Exception.html">RBatch::Config::Exception</a></li>
|
118
118
|
|
119
|
+
<li><a href="../RBatch/DoubleRunCheckException.html">RBatch::DoubleRunCheckException</a></li>
|
120
|
+
|
121
|
+
<li><a href="../RBatch/DoubleRunChecker.html">RBatch::DoubleRunChecker</a></li>
|
122
|
+
|
119
123
|
<li><a href="../RBatch/Log.html">RBatch::Log</a></li>
|
120
124
|
|
121
|
-
<li><a href="../
|
125
|
+
<li><a href="../RBatch/RunConf.html">RBatch::RunConf</a></li>
|
126
|
+
|
127
|
+
<li><a href="../RBatch/RunConf/Exception.html">RBatch::RunConf::Exception</a></li>
|
122
128
|
|
123
129
|
</ul>
|
124
130
|
<div id="no-class-search-results" style="display: none;">No matching classes.</div>
|
@@ -140,26 +146,25 @@ This module is a wrapper of Kernel#spawn.
|
|
140
146
|
</p>
|
141
147
|
<pre>
|
142
148
|
* Arguments(cmd_params) are inputed to Kernel#spawn directly and run command.
|
143
|
-
* Command's stdout and stderr is written to tmp file.
|
144
|
-
* If Platform is "mswin" or "mingw" , then temp directory is ENV["TEMP"]
|
145
|
-
* If Platform is "linux" or "cygwin" , then temp directory is "/tmp/"
|
146
149
|
* Return an object of RBatch::CmdResult which includes stdout, stderr, and exit status.
|
147
150
|
|
148
151
|
==== Sample 1
|
149
152
|
require 'rbatch'
|
150
|
-
|
151
|
-
|
152
|
-
p r.stdout
|
153
|
+
result = RBatch::cmd("ls")
|
154
|
+
p result.stdout
|
153
155
|
=> "fileA\nfileB\n"
|
154
156
|
|
155
|
-
==== Sample 2 (
|
156
|
-
|
157
|
-
|
157
|
+
==== Sample 2 (use option)
|
158
|
+
require 'rbatch'
|
159
|
+
result = RBatch::cmd("ls",{:timeout => 1})
|
160
|
+
p result.stdout
|
161
|
+
=> "fileA\nfileB\n"
|
158
162
|
|
159
|
-
==== Sample 3 (
|
163
|
+
==== Sample 3 (use instance)
|
160
164
|
require 'rbatch'
|
161
|
-
|
162
|
-
|
165
|
+
cmd = RBatch::Cmd.new("ls")
|
166
|
+
result = cmd.run
|
167
|
+
p result.stdout
|
163
168
|
=> "fileA\nfileB\n"</pre>
|
164
169
|
|
165
170
|
</div>
|
@@ -194,8 +199,8 @@ This module is a wrapper of Kernel#spawn.
|
|
194
199
|
</p>
|
195
200
|
<h4>Params</h4>
|
196
201
|
<p>
|
197
|
-
<tt>cmd_str</tt> = Command string
|
198
|
-
= Option hash object.
|
202
|
+
<tt>cmd_str</tt> = Command string such as “ls -l” <tt>opt</tt>
|
203
|
+
= Option hash object.
|
199
204
|
</p>
|
200
205
|
<ul>
|
201
206
|
<li><p>
|
@@ -204,8 +209,8 @@ exception. Default is false.
|
|
204
209
|
</p>
|
205
210
|
</li>
|
206
211
|
<li><p>
|
207
|
-
<tt>:timeout</tt> (Integer) = If command timeout , raise exception
|
208
|
-
is 0 sec ( 0 means disable) .
|
212
|
+
<tt>:timeout</tt> (Integer) = If command timeout , raise exception and kill
|
213
|
+
process. Default is 0 sec ( 0 means disable) .
|
209
214
|
</p>
|
210
215
|
</li>
|
211
216
|
</ul>
|
@@ -215,24 +220,20 @@ is 0 sec ( 0 means disable) .
|
|
215
220
|
<div class="method-source-code"
|
216
221
|
id="new-source">
|
217
222
|
<pre>
|
218
|
-
<span class="ruby-comment cmt"># File lib/rbatch/cmd.rb, line
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
61: <span class="ruby-comment cmt"># use default</span>
|
233
|
-
62: <span class="ruby-keyword kw">end</span>
|
234
|
-
63: <span class="ruby-keyword kw">end</span>
|
235
|
-
64: <span class="ruby-keyword kw">end</span></pre>
|
223
|
+
<span class="ruby-comment cmt"># File lib/rbatch/cmd.rb, line 44</span>
|
224
|
+
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>)
|
225
|
+
45: <span class="ruby-identifier">raise</span>(<span class="ruby-constant">CmdException</span>,<span class="ruby-value str">"Command string is nil"</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">cmd_str</span>.<span class="ruby-identifier">nil?</span>
|
226
|
+
46: <span class="ruby-ivar">@cmd_str</span> = <span class="ruby-identifier">cmd_str</span>
|
227
|
+
47: <span class="ruby-identifier">tmp</span> = {}
|
228
|
+
48: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">opt</span>.<span class="ruby-identifier">nil?</span>
|
229
|
+
49: <span class="ruby-ivar">@opt</span>=<span class="ruby-constant">RBatch</span>.<span class="ruby-identifier">run_conf</span>.<span class="ruby-identifier">clone</span>
|
230
|
+
50: <span class="ruby-keyword kw">else</span>
|
231
|
+
51: <span class="ruby-identifier">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>
|
232
|
+
52: <span class="ruby-identifier">tmp</span>[(<span class="ruby-value str">"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>]
|
233
|
+
53: <span class="ruby-keyword kw">end</span>
|
234
|
+
54: <span class="ruby-ivar">@opt</span>=<span class="ruby-constant">RBatch</span>.<span class="ruby-identifier">run_conf</span>.<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">tmp</span>)
|
235
|
+
55: <span class="ruby-keyword kw">end</span>
|
236
|
+
56: <span class="ruby-keyword kw">end</span></pre>
|
236
237
|
</div>
|
237
238
|
|
238
239
|
</div>
|
@@ -275,28 +276,34 @@ instance of <a href="CmdResult.html">RBatch::CmdResult</a>
|
|
275
276
|
<div class="method-source-code"
|
276
277
|
id="run-source">
|
277
278
|
<pre>
|
278
|
-
<span class="ruby-comment cmt"># File lib/rbatch/cmd.rb, line
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
279
|
+
<span class="ruby-comment cmt"># File lib/rbatch/cmd.rb, line 62</span>
|
280
|
+
62: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">run</span>()
|
281
|
+
63: <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">"rbatch_tmpout"</span>,<span class="ruby-constant">Dir</span>.<span class="ruby-identifier">tmpdir</span>)
|
282
|
+
64: <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">"rbatch_tmperr"</span>,<span class="ruby-constant">Dir</span>.<span class="ruby-identifier">tmpdir</span>)
|
283
|
+
65: <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-value str">"w"</span>],<span class="ruby-value">:err</span> =<span class="ruby-operator">></span> [<span class="ruby-identifier">stderr_file</span>,<span class="ruby-value str">"w"</span>])
|
284
|
+
66: <span class="ruby-identifier">status</span> = <span class="ruby-keyword kw">nil</span>
|
285
|
+
67: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@opt</span>[<span class="ruby-value">:cmd_timeout</span>] <span class="ruby-operator">!=</span> <span class="ruby-value">0</span>
|
286
|
+
68: <span class="ruby-keyword kw">begin</span>
|
287
|
+
69: <span class="ruby-identifier">timeout</span>(<span class="ruby-ivar">@opt</span>[<span class="ruby-value">:cmd_timeout</span>]) <span class="ruby-keyword kw">do</span>
|
288
|
+
70: <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
|
+
71: <span class="ruby-keyword kw">end</span>
|
290
|
+
72: <span class="ruby-keyword kw">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>
|
291
|
+
73: <span class="ruby-keyword kw">begin</span>
|
292
|
+
74: <span class="ruby-constant">Process</span>.<span class="ruby-identifier">kill</span>(<span class="ruby-value str">'SIGINT'</span>, <span class="ruby-identifier">pid</span>)
|
293
|
+
75: <span class="ruby-identifier">raise</span>(<span class="ruby-constant">CmdException</span>,<span class="ruby-node">"Run time of command \"#{@cmd_str}\" is over #{@opt[:cmd_timeout].to_s} sec. Success to kill process : PID=#{pid}"</span> )
|
294
|
+
76: <span class="ruby-keyword kw">rescue</span>
|
295
|
+
77: <span class="ruby-identifier">raise</span>(<span class="ruby-constant">CmdException</span>,<span class="ruby-node">"Run time of command \"#{@cmd_str}\" is over #{@opt[:cmd_timeout].to_s} sec. Fail to kill process : PID=#{pid}"</span> )
|
296
|
+
78: <span class="ruby-keyword kw">end</span>
|
297
|
+
79: <span class="ruby-keyword kw">end</span>
|
298
|
+
80: <span class="ruby-keyword kw">else</span>
|
299
|
+
81: <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>
|
300
|
+
82: <span class="ruby-keyword kw">end</span>
|
301
|
+
83: <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>)
|
302
|
+
84: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@opt</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>
|
303
|
+
85: <span class="ruby-identifier">raise</span>(<span class="ruby-constant">CmdException</span>,<span class="ruby-value str">"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>)
|
304
|
+
86: <span class="ruby-keyword kw">end</span>
|
305
|
+
87: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">result</span>
|
306
|
+
88: <span class="ruby-keyword kw">end</span></pre>
|
300
307
|
</div>
|
301
308
|
|
302
309
|
</div>
|
@@ -1,9 +1,9 @@
|
|
1
|
-
<?xml version="1.0" encoding="
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
2
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
3
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=
|
6
|
+
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
|
7
7
|
|
8
8
|
<title>Class: RBatch::CmdException</title>
|
9
9
|
|
@@ -105,9 +105,15 @@
|
|
105
105
|
|
106
106
|
<li><a href="../RBatch/Config/Exception.html">RBatch::Config::Exception</a></li>
|
107
107
|
|
108
|
+
<li><a href="../RBatch/DoubleRunCheckException.html">RBatch::DoubleRunCheckException</a></li>
|
109
|
+
|
110
|
+
<li><a href="../RBatch/DoubleRunChecker.html">RBatch::DoubleRunChecker</a></li>
|
111
|
+
|
108
112
|
<li><a href="../RBatch/Log.html">RBatch::Log</a></li>
|
109
113
|
|
110
|
-
<li><a href="../
|
114
|
+
<li><a href="../RBatch/RunConf.html">RBatch::RunConf</a></li>
|
115
|
+
|
116
|
+
<li><a href="../RBatch/RunConf/Exception.html">RBatch::RunConf::Exception</a></li>
|
111
117
|
|
112
118
|
</ul>
|
113
119
|
<div id="no-class-search-results" style="display: none;">No matching classes.</div>
|
@@ -1,9 +1,9 @@
|
|
1
|
-
<?xml version="1.0" encoding="
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
2
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
3
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=
|
6
|
+
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
|
7
7
|
|
8
8
|
<title>Class: RBatch::CmdResult</title>
|
9
9
|
|
@@ -130,9 +130,15 @@
|
|
130
130
|
|
131
131
|
<li><a href="../RBatch/Config/Exception.html">RBatch::Config::Exception</a></li>
|
132
132
|
|
133
|
+
<li><a href="../RBatch/DoubleRunCheckException.html">RBatch::DoubleRunCheckException</a></li>
|
134
|
+
|
135
|
+
<li><a href="../RBatch/DoubleRunChecker.html">RBatch::DoubleRunChecker</a></li>
|
136
|
+
|
133
137
|
<li><a href="../RBatch/Log.html">RBatch::Log</a></li>
|
134
138
|
|
135
|
-
<li><a href="../
|
139
|
+
<li><a href="../RBatch/RunConf.html">RBatch::RunConf</a></li>
|
140
|
+
|
141
|
+
<li><a href="../RBatch/RunConf/Exception.html">RBatch::RunConf::Exception</a></li>
|
136
142
|
|
137
143
|
</ul>
|
138
144
|
<div id="no-class-search-results" style="display: none;">No matching classes.</div>
|
@@ -181,13 +187,13 @@
|
|
181
187
|
<div class="method-source-code"
|
182
188
|
id="new-source">
|
183
189
|
<pre>
|
184
|
-
<span class="ruby-comment cmt"># File lib/rbatch/cmd.rb, line
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
190
|
+
<span class="ruby-comment cmt"># File lib/rbatch/cmd.rb, line 96</span>
|
191
|
+
96: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">stdout_file</span>, <span class="ruby-identifier">stderr_file</span>, <span class="ruby-identifier">status</span>, <span class="ruby-identifier">cmd_str</span>)
|
192
|
+
97: <span class="ruby-ivar">@stdout_file</span> = <span class="ruby-identifier">stdout_file</span>
|
193
|
+
98: <span class="ruby-ivar">@stderr_file</span> = <span class="ruby-identifier">stderr_file</span>
|
194
|
+
99: <span class="ruby-ivar">@status</span> = <span class="ruby-identifier">status</span>
|
195
|
+
100: <span class="ruby-ivar">@cmd_str</span> = <span class="ruby-identifier">cmd_str</span>
|
196
|
+
101: <span class="ruby-keyword kw">end</span></pre>
|
191
197
|
</div>
|
192
198
|
|
193
199
|
</div>
|
@@ -224,8 +230,8 @@
|
|
224
230
|
<div class="method-source-code"
|
225
231
|
id="cmd-str-source">
|
226
232
|
<pre>
|
227
|
-
<span class="ruby-comment cmt"># File lib/rbatch/cmd.rb, line
|
228
|
-
|
233
|
+
<span class="ruby-comment cmt"># File lib/rbatch/cmd.rb, line 105</span>
|
234
|
+
105: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cmd_str</span> ; <span class="ruby-ivar">@cmd_str</span> ; <span class="ruby-keyword kw">end</span></pre>
|
229
235
|
</div>
|
230
236
|
|
231
237
|
</div>
|
@@ -256,8 +262,8 @@
|
|
256
262
|
<div class="method-source-code"
|
257
263
|
id="status-source">
|
258
264
|
<pre>
|
259
|
-
<span class="ruby-comment cmt"># File lib/rbatch/cmd.rb, line
|
260
|
-
|
265
|
+
<span class="ruby-comment cmt"># File lib/rbatch/cmd.rb, line 104</span>
|
266
|
+
104: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">status</span> ; <span class="ruby-ivar">@status</span> ; <span class="ruby-keyword kw">end</span></pre>
|
261
267
|
</div>
|
262
268
|
|
263
269
|
</div>
|
@@ -288,10 +294,10 @@
|
|
288
294
|
<div class="method-source-code"
|
289
295
|
id="stderr-source">
|
290
296
|
<pre>
|
291
|
-
<span class="ruby-comment cmt"># File lib/rbatch/cmd.rb, line
|
292
|
-
|
293
|
-
|
294
|
-
|
297
|
+
<span class="ruby-comment cmt"># File lib/rbatch/cmd.rb, line 109</span>
|
298
|
+
109: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">stderr</span>
|
299
|
+
110: <span class="ruby-constant">File</span>.<span class="ruby-identifier">read</span>(<span class="ruby-ivar">@stderr_file</span>)
|
300
|
+
111: <span class="ruby-keyword kw">end</span></pre>
|
295
301
|
</div>
|
296
302
|
|
297
303
|
</div>
|
@@ -322,8 +328,8 @@
|
|
322
328
|
<div class="method-source-code"
|
323
329
|
id="stderr-file-source">
|
324
330
|
<pre>
|
325
|
-
<span class="ruby-comment cmt"># File lib/rbatch/cmd.rb, line
|
326
|
-
|
331
|
+
<span class="ruby-comment cmt"># File lib/rbatch/cmd.rb, line 103</span>
|
332
|
+
103: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">stderr_file</span> ; <span class="ruby-ivar">@stderr_file</span> ; <span class="ruby-keyword kw">end</span></pre>
|
327
333
|
</div>
|
328
334
|
|
329
335
|
</div>
|
@@ -354,10 +360,10 @@
|
|
354
360
|
<div class="method-source-code"
|
355
361
|
id="stdout-source">
|
356
362
|
<pre>
|
357
|
-
<span class="ruby-comment cmt"># File lib/rbatch/cmd.rb, line
|
358
|
-
|
359
|
-
|
360
|
-
|
363
|
+
<span class="ruby-comment cmt"># File lib/rbatch/cmd.rb, line 106</span>
|
364
|
+
106: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">stdout</span>
|
365
|
+
107: <span class="ruby-constant">File</span>.<span class="ruby-identifier">read</span>(<span class="ruby-ivar">@stdout_file</span>)
|
366
|
+
108: <span class="ruby-keyword kw">end</span></pre>
|
361
367
|
</div>
|
362
368
|
|
363
369
|
</div>
|
@@ -388,8 +394,8 @@
|
|
388
394
|
<div class="method-source-code"
|
389
395
|
id="stdout-file-source">
|
390
396
|
<pre>
|
391
|
-
<span class="ruby-comment cmt"># File lib/rbatch/cmd.rb, line
|
392
|
-
|
397
|
+
<span class="ruby-comment cmt"># File lib/rbatch/cmd.rb, line 102</span>
|
398
|
+
102: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">stdout_file</span> ; <span class="ruby-ivar">@stdout_file</span> ; <span class="ruby-keyword kw">end</span></pre>
|
393
399
|
</div>
|
394
400
|
|
395
401
|
</div>
|
@@ -420,10 +426,10 @@
|
|
420
426
|
<div class="method-source-code"
|
421
427
|
id="to-h-source">
|
422
428
|
<pre>
|
423
|
-
<span class="ruby-comment cmt"># File lib/rbatch/cmd.rb, line
|
424
|
-
|
425
|
-
|
426
|
-
|
429
|
+
<span class="ruby-comment cmt"># File lib/rbatch/cmd.rb, line 112</span>
|
430
|
+
112: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_h</span>
|
431
|
+
113: {<span class="ruby-value">:cmd_str</span> =<span class="ruby-operator">></span> <span class="ruby-ivar">@cmd_str</span>,<span class="ruby-value">:stdout</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">stdout</span>, <span class="ruby-value">:stderr</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">stderr</span>, <span class="ruby-value">:status</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">status</span>}
|
432
|
+
114: <span class="ruby-keyword kw">end</span></pre>
|
427
433
|
</div>
|
428
434
|
|
429
435
|
</div>
|
@@ -454,10 +460,10 @@
|
|
454
460
|
<div class="method-source-code"
|
455
461
|
id="to-s-source">
|
456
462
|
<pre>
|
457
|
-
<span class="ruby-comment cmt"># File lib/rbatch/cmd.rb, line
|
458
|
-
|
459
|
-
|
460
|
-
|
463
|
+
<span class="ruby-comment cmt"># File lib/rbatch/cmd.rb, line 115</span>
|
464
|
+
115: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_s</span>
|
465
|
+
116: <span class="ruby-identifier">to_h</span>.<span class="ruby-identifier">to_s</span>
|
466
|
+
117: <span class="ruby-keyword kw">end</span></pre>
|
461
467
|
</div>
|
462
468
|
|
463
469
|
</div>
|
@@ -1,9 +1,9 @@
|
|
1
|
-
<?xml version="1.0" encoding="
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
2
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
3
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=
|
6
|
+
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
|
7
7
|
|
8
8
|
<title>Class: RBatch::CommonConfig::Exception</title>
|
9
9
|
|
@@ -105,9 +105,15 @@
|
|
105
105
|
|
106
106
|
<li><a href="../../RBatch/Config/Exception.html">RBatch::Config::Exception</a></li>
|
107
107
|
|
108
|
+
<li><a href="../../RBatch/DoubleRunCheckException.html">RBatch::DoubleRunCheckException</a></li>
|
109
|
+
|
110
|
+
<li><a href="../../RBatch/DoubleRunChecker.html">RBatch::DoubleRunChecker</a></li>
|
111
|
+
|
108
112
|
<li><a href="../../RBatch/Log.html">RBatch::Log</a></li>
|
109
113
|
|
110
|
-
<li><a href="../../
|
114
|
+
<li><a href="../../RBatch/RunConf.html">RBatch::RunConf</a></li>
|
115
|
+
|
116
|
+
<li><a href="../../RBatch/RunConf/Exception.html">RBatch::RunConf::Exception</a></li>
|
111
117
|
|
112
118
|
</ul>
|
113
119
|
<div id="no-class-search-results" style="display: none;">No matching classes.</div>
|