rbatch 1.7.0 → 1.8.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.ja.md +44 -25
- data/README.md +41 -27
- data/Rakefile +1 -1
- data/doc/rdoc/CHANGELOG.html +188 -144
- data/doc/rdoc/LICENSE.html +75 -79
- data/doc/rdoc/RBatch/Cmd.html +325 -293
- data/doc/rdoc/RBatch/CmdException.html +142 -141
- data/doc/rdoc/RBatch/CmdResult.html +471 -462
- data/doc/rdoc/RBatch/Config/Exception.html +2 -0
- data/doc/rdoc/RBatch/Config.html +331 -314
- data/doc/rdoc/RBatch/Log.html +766 -677
- data/doc/rdoc/RBatch.html +516 -425
- data/doc/rdoc/RBatchException.html +163 -0
- data/doc/rdoc/created.rid +8 -8
- data/doc/rdoc/index.html +125 -123
- data/doc/rdoc/lib/rbatch/cmd_rb.html +42 -42
- data/doc/rdoc/lib/rbatch/config_rb.html +42 -42
- data/doc/rdoc/lib/rbatch/log_rb.html +46 -44
- data/doc/rdoc/lib/rbatch_rb.html +46 -44
- data/doc/rdoc/rdoc.css +308 -365
- data/lib/rbatch/cmd.rb +14 -2
- data/lib/rbatch/log.rb +37 -10
- data/lib/rbatch.rb +23 -13
- data/sample/bin/test.rb +6 -0
- data/sample/bin/test2.rb +3 -0
- data/sample/log/20130131_apache_log_insert.log +23 -0
- data/sample/log/20130209_test.log +128 -0
- data/sample/log/20130210_test.log +68 -0
- data/test/cases/test_cmd.rb +12 -0
- metadata +8 -2
data/doc/rdoc/RBatch.html
CHANGED
@@ -1,449 +1,540 @@
|
|
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
|
-
|
6
|
+
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
|
7
7
|
|
8
|
-
|
8
|
+
<title>Module: RBatch</title>
|
9
9
|
|
10
|
-
|
10
|
+
<link rel="stylesheet" href="./rdoc.css" type="text/css" media="screen" />
|
11
11
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
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>
|
16
20
|
|
17
21
|
</head>
|
18
|
-
<body
|
22
|
+
<body class="module">
|
19
23
|
|
20
|
-
|
21
|
-
|
22
|
-
|
24
|
+
<div id="metadata">
|
25
|
+
<div id="home-metadata">
|
26
|
+
<div id="home-section" class="section">
|
23
27
|
<h3 class="section-header">
|
24
28
|
<a href="./index.html">Home</a>
|
25
29
|
<a href="./index.html#classes">Classes</a>
|
26
30
|
<a href="./index.html#methods">Methods</a>
|
27
31
|
</h3>
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
<div class="method-source-code" id="cmd-source">
|
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/config_rb.html?TB_iframe=true&height=550&width=785"
|
42
|
+
class="thickbox" title="lib/rbatch/config.rb">lib/rbatch/config.rb</a></li>
|
43
|
+
|
44
|
+
<li><a href="./lib/rbatch/cmd_rb.html?TB_iframe=true&height=550&width=785"
|
45
|
+
class="thickbox" title="lib/rbatch/cmd.rb">lib/rbatch/cmd.rb</a></li>
|
46
|
+
|
47
|
+
<li><a href="./lib/rbatch/log_rb.html?TB_iframe=true&height=550&width=785"
|
48
|
+
class="thickbox" title="lib/rbatch/log.rb">lib/rbatch/log.rb</a></li>
|
49
|
+
|
50
|
+
<li><a href="./lib/rbatch_rb.html?TB_iframe=true&height=550&width=785"
|
51
|
+
class="thickbox" title="lib/rbatch.rb">lib/rbatch.rb</a></li>
|
52
|
+
|
53
|
+
</ul>
|
54
|
+
</div>
|
55
|
+
</div>
|
56
|
+
|
57
|
+
|
58
|
+
</div>
|
59
|
+
|
60
|
+
<div id="class-metadata">
|
61
|
+
|
62
|
+
<!-- Parent Class -->
|
63
|
+
|
64
|
+
|
65
|
+
<!-- Namespace Contents -->
|
66
|
+
|
67
|
+
<div id="namespace-list-section" class="section">
|
68
|
+
<h3 class="section-header">Namespace</h3>
|
69
|
+
<ul class="link-list">
|
70
|
+
|
71
|
+
<li><span class="type">CLASS</span> <a href="RBatch/Cmd.html">RBatch::Cmd</a></li>
|
72
|
+
|
73
|
+
<li><span class="type">CLASS</span> <a href="RBatch/CmdException.html">RBatch::CmdException</a></li>
|
74
|
+
|
75
|
+
<li><span class="type">CLASS</span> <a href="RBatch/CmdResult.html">RBatch::CmdResult</a></li>
|
76
|
+
|
77
|
+
<li><span class="type">CLASS</span> <a href="RBatch/Config.html">RBatch::Config</a></li>
|
78
|
+
|
79
|
+
<li><span class="type">CLASS</span> <a href="RBatch/Log.html">RBatch::Log</a></li>
|
80
|
+
|
81
|
+
</ul>
|
82
|
+
</div>
|
83
|
+
|
84
|
+
|
85
|
+
<!-- Method Quickref -->
|
86
|
+
|
87
|
+
<div id="method-list-section" class="section">
|
88
|
+
<h3 class="section-header">Methods</h3>
|
89
|
+
<ul class="link-list">
|
90
|
+
|
91
|
+
<li><a href="#method-i-cmd">#cmd</a></li>
|
92
|
+
|
93
|
+
<li><a href="#method-i-common_config">#common_config</a></li>
|
94
|
+
|
95
|
+
<li><a href="#method-i-common_config_path">#common_config_path</a></li>
|
96
|
+
|
97
|
+
<li><a href="#method-i-config">#config</a></li>
|
98
|
+
|
99
|
+
<li><a href="#method-i-double_run_check">#double_run_check</a></li>
|
100
|
+
|
101
|
+
<li><a href="#method-i-double_run_lock_file">#double_run_lock_file</a></li>
|
102
|
+
|
103
|
+
<li><a href="#method-i-program_name">#program_name</a></li>
|
104
|
+
|
105
|
+
<li><a href="#method-i-program_name%3D">#program_name=</a></li>
|
106
|
+
|
107
|
+
<li><a href="#method-i-tmp_dir">#tmp_dir</a></li>
|
108
|
+
|
109
|
+
</ul>
|
110
|
+
</div>
|
111
|
+
|
112
|
+
|
113
|
+
<!-- Included Modules -->
|
114
|
+
|
115
|
+
</div>
|
116
|
+
|
117
|
+
<div id="project-metadata">
|
118
|
+
|
119
|
+
|
120
|
+
<div id="fileindex-section" class="section project-section">
|
121
|
+
<h3 class="section-header">Files</h3>
|
122
|
+
<ul>
|
123
|
+
|
124
|
+
<li class="file"><a href="./CHANGELOG.html">CHANGELOG</a></li>
|
125
|
+
|
126
|
+
<li class="file"><a href="./LICENSE.html">LICENSE</a></li>
|
127
|
+
|
128
|
+
</ul>
|
129
|
+
</div>
|
130
|
+
|
131
|
+
|
132
|
+
<div id="classindex-section" class="section project-section">
|
133
|
+
<h3 class="section-header">Class Index
|
134
|
+
<span class="search-toggle"><img src="./images/find.png"
|
135
|
+
height="16" width="16" alt="[+]"
|
136
|
+
title="show/hide quicksearch" /></span></h3>
|
137
|
+
<form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
|
138
|
+
<fieldset>
|
139
|
+
<legend>Quicksearch</legend>
|
140
|
+
<input type="text" name="quicksearch" value=""
|
141
|
+
class="quicksearch-field" />
|
142
|
+
</fieldset>
|
143
|
+
</form>
|
144
|
+
|
145
|
+
<ul class="link-list">
|
146
|
+
|
147
|
+
<li><a href="./RBatch.html">RBatch</a></li>
|
148
|
+
|
149
|
+
<li><a href="./RBatch/Cmd.html">RBatch::Cmd</a></li>
|
150
|
+
|
151
|
+
<li><a href="./RBatch/CmdException.html">RBatch::CmdException</a></li>
|
152
|
+
|
153
|
+
<li><a href="./RBatch/CmdResult.html">RBatch::CmdResult</a></li>
|
154
|
+
|
155
|
+
<li><a href="./RBatch/Config.html">RBatch::Config</a></li>
|
156
|
+
|
157
|
+
<li><a href="./RBatch/Config/Exception.html">RBatch::Config::Exception</a></li>
|
158
|
+
|
159
|
+
<li><a href="./RBatch/Log.html">RBatch::Log</a></li>
|
160
|
+
|
161
|
+
<li><a href="./RBatchException.html">RBatchException</a></li>
|
162
|
+
|
163
|
+
</ul>
|
164
|
+
<div id="no-class-search-results" style="display: none;">No matching classes.</div>
|
165
|
+
</div>
|
166
|
+
|
167
|
+
|
168
|
+
</div>
|
169
|
+
</div>
|
170
|
+
|
171
|
+
<div id="documentation">
|
172
|
+
<h1 class="module">RBatch</h1>
|
173
|
+
|
174
|
+
<div id="description">
|
175
|
+
|
176
|
+
</div>
|
177
|
+
|
178
|
+
<!-- Constants -->
|
179
|
+
|
180
|
+
|
181
|
+
<!-- Attributes -->
|
182
|
+
|
183
|
+
|
184
|
+
<!-- Methods -->
|
185
|
+
|
186
|
+
<div id="public-instance-method-details" class="method-section section">
|
187
|
+
<h3 class="section-header">Public Instance Methods</h3>
|
188
|
+
|
189
|
+
|
190
|
+
<div id="cmd-method" class="method-detail ">
|
191
|
+
<a name="method-i-cmd"></a>
|
192
|
+
|
193
|
+
<div class="method-heading">
|
194
|
+
|
195
|
+
<span class="method-name">cmd</span><span
|
196
|
+
class="method-args">(cmd_str,opt = nil)</span>
|
197
|
+
<span class="method-click-advice">click to toggle source</span>
|
198
|
+
|
199
|
+
</div>
|
200
|
+
|
201
|
+
<div class="method-description">
|
202
|
+
|
203
|
+
<p>
|
204
|
+
shortcut of <a href="RBatch/Cmd.html">RBatch::Cmd</a>
|
205
|
+
</p>
|
206
|
+
|
207
|
+
|
208
|
+
|
209
|
+
<div class="method-source-code"
|
210
|
+
id="cmd-source">
|
211
211
|
<pre>
|
212
|
-
<span class="ruby-comment"># File lib/rbatch/cmd.rb, line
|
213
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">cmd</span>(<span class="ruby-identifier">cmd_str</span>,<span class="ruby-identifier">opt</span> = <span class="ruby-keyword">nil</span>)
|
214
|
-
|
215
|
-
<span class="ruby-keyword">end</span></pre>
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
212
|
+
<span class="ruby-comment cmt"># File lib/rbatch/cmd.rb, line 126</span>
|
213
|
+
126: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cmd</span>(<span class="ruby-identifier">cmd_str</span>,<span class="ruby-identifier">opt</span> = <span class="ruby-keyword kw">nil</span>)
|
214
|
+
127: <span class="ruby-constant">Cmd</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">cmd_str</span>,<span class="ruby-identifier">opt</span>).<span class="ruby-identifier">run</span>
|
215
|
+
128: <span class="ruby-keyword kw">end</span></pre>
|
216
|
+
</div>
|
217
|
+
|
218
|
+
</div>
|
219
|
+
|
220
|
+
|
221
|
+
|
222
|
+
|
223
|
+
</div>
|
224
|
+
|
225
|
+
|
226
|
+
<div id="common-config-method" class="method-detail ">
|
227
|
+
<a name="method-i-common_config"></a>
|
228
|
+
|
229
|
+
<div class="method-heading">
|
230
|
+
|
231
|
+
<span class="method-name">common_config</span><span
|
232
|
+
class="method-args">()</span>
|
233
|
+
<span class="method-click-advice">click to toggle source</span>
|
234
|
+
|
235
|
+
</div>
|
236
|
+
|
237
|
+
<div class="method-description">
|
238
|
+
|
239
|
+
|
240
|
+
|
241
|
+
|
242
|
+
|
243
|
+
<div class="method-source-code"
|
244
|
+
id="common-config-source">
|
244
245
|
<pre>
|
245
|
-
<span class="ruby-comment"># File lib/rbatch.rb, line 21</span>
|
246
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">common_config</span>
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
<span class="ruby-keyword">end</span></pre>
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
246
|
+
<span class="ruby-comment cmt"># File lib/rbatch.rb, line 21</span>
|
247
|
+
21: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">common_config</span>
|
248
|
+
22: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-constant">RBatch</span>.<span class="ruby-identifier">common_config_path</span>)
|
249
|
+
23: <span class="ruby-identifier">yaml</span> = <span class="ruby-constant">YAML</span><span class="ruby-operator">::</span><span class="ruby-identifier">load_file</span>(<span class="ruby-constant">RBatch</span>.<span class="ruby-identifier">common_config_path</span>)
|
250
|
+
24: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">yaml</span>
|
251
|
+
25: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">yaml</span>
|
252
|
+
26: <span class="ruby-keyword kw">else</span>
|
253
|
+
27: <span class="ruby-comment cmt"># If file is emply , YAML::load_file is false</span>
|
254
|
+
28: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
|
255
|
+
29: <span class="ruby-keyword kw">end</span>
|
256
|
+
30: <span class="ruby-keyword kw">else</span>
|
257
|
+
31: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
|
258
|
+
32: <span class="ruby-keyword kw">end</span>
|
259
|
+
33: <span class="ruby-keyword kw">end</span></pre>
|
260
|
+
</div>
|
261
|
+
|
262
|
+
</div>
|
263
|
+
|
264
|
+
|
265
|
+
|
266
|
+
|
267
|
+
</div>
|
268
|
+
|
269
|
+
|
270
|
+
<div id="common-config-path-method" class="method-detail ">
|
271
|
+
<a name="method-i-common_config_path"></a>
|
272
|
+
|
273
|
+
<div class="method-heading">
|
274
|
+
|
275
|
+
<span class="method-name">common_config_path</span><span
|
276
|
+
class="method-args">()</span>
|
277
|
+
<span class="method-click-advice">click to toggle source</span>
|
278
|
+
|
279
|
+
</div>
|
280
|
+
|
281
|
+
<div class="method-description">
|
282
|
+
|
283
|
+
|
284
|
+
|
285
|
+
|
286
|
+
|
287
|
+
<div class="method-source-code"
|
288
|
+
id="common-config-path-source">
|
287
289
|
<pre>
|
288
|
-
<span class="ruby-comment"># File lib/rbatch.rb, line 18</span>
|
289
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">common_config_path</span>
|
290
|
-
|
291
|
-
<span class="ruby-keyword">end</span></pre>
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
290
|
+
<span class="ruby-comment cmt"># File lib/rbatch.rb, line 18</span>
|
291
|
+
18: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">common_config_path</span>
|
292
|
+
19: <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">dirname</span>(<span class="ruby-constant">RBatch</span>.<span class="ruby-identifier">program_name</span>),<span class="ruby-value str">".."</span>,<span class="ruby-value str">"conf"</span>,<span class="ruby-value str">"rbatch.yaml"</span>)
|
293
|
+
20: <span class="ruby-keyword kw">end</span></pre>
|
294
|
+
</div>
|
295
|
+
|
296
|
+
</div>
|
297
|
+
|
298
|
+
|
299
|
+
|
300
|
+
|
301
|
+
</div>
|
302
|
+
|
303
|
+
|
304
|
+
<div id="config-method" class="method-detail ">
|
305
|
+
<a name="method-i-config"></a>
|
306
|
+
|
307
|
+
<div class="method-heading">
|
308
|
+
|
309
|
+
<span class="method-name">config</span><span
|
310
|
+
class="method-args">()</span>
|
311
|
+
<span class="method-click-advice">click to toggle source</span>
|
312
|
+
|
313
|
+
</div>
|
314
|
+
|
315
|
+
<div class="method-description">
|
316
|
+
|
317
|
+
<p>
|
318
|
+
Alias of RBatch::Config.new
|
319
|
+
</p>
|
320
|
+
|
321
|
+
|
322
|
+
|
323
|
+
<div class="method-source-code"
|
324
|
+
id="config-source">
|
320
325
|
<pre>
|
321
|
-
<span class="ruby-comment"># File lib/rbatch/config.rb, line 9</span>
|
322
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">config</span> ; <span class="ruby-constant">Config</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword">end</span></pre>
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
326
|
+
<span class="ruby-comment cmt"># File lib/rbatch/config.rb, line 9</span>
|
327
|
+
9: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">config</span> ; <span class="ruby-constant">Config</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword kw">end</span></pre>
|
328
|
+
</div>
|
329
|
+
|
330
|
+
</div>
|
331
|
+
|
332
|
+
|
333
|
+
|
334
|
+
|
335
|
+
</div>
|
336
|
+
|
337
|
+
|
338
|
+
<div id="double-run-check-method" class="method-detail ">
|
339
|
+
<a name="method-i-double_run_check"></a>
|
340
|
+
|
341
|
+
<div class="method-heading">
|
342
|
+
|
343
|
+
<span class="method-name">double_run_check</span><span
|
344
|
+
class="method-args">()</span>
|
345
|
+
<span class="method-click-advice">click to toggle source</span>
|
346
|
+
|
347
|
+
</div>
|
348
|
+
|
349
|
+
<div class="method-description">
|
350
|
+
|
351
|
+
|
352
|
+
|
353
|
+
|
354
|
+
|
355
|
+
<div class="method-source-code"
|
356
|
+
id="double-run-check-source">
|
351
357
|
<pre>
|
352
|
-
<span class="ruby-comment"># File lib/rbatch.rb, line
|
353
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
358
|
+
<span class="ruby-comment cmt"># File lib/rbatch.rb, line 34</span>
|
359
|
+
34: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">double_run_check</span>
|
360
|
+
35: <span class="ruby-comment cmt"># double run check</span>
|
361
|
+
36: <span class="ruby-keyword kw">if</span> ( <span class="ruby-constant">RBatch</span><span class="ruby-operator">::</span><span class="ruby-identifier">common_config</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-operator">&&</span> <span class="ruby-constant">RBatch</span><span class="ruby-operator">::</span><span class="ruby-identifier">common_config</span>[<span class="ruby-value str">"forbid_double_run"</span>] )
|
362
|
+
37: <span class="ruby-identifier">lock_file</span>=<span class="ruby-value str">"rbatch_lock_"</span> <span class="ruby-operator">+</span> <span class="ruby-constant">Digest</span><span class="ruby-operator">::</span><span class="ruby-constant">MD5</span>.<span class="ruby-identifier">hexdigest</span>(<span class="ruby-identifier">@@program_name</span>)
|
363
|
+
38: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">exists?</span> <span class="ruby-constant">RBatch</span><span class="ruby-operator">::</span><span class="ruby-identifier">tmp_dir</span>
|
364
|
+
39: <span class="ruby-constant">Dir</span><span class="ruby-operator">::</span><span class="ruby-identifier">foreach</span>(<span class="ruby-constant">RBatch</span><span class="ruby-operator">::</span><span class="ruby-identifier">tmp_dir</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span>
|
365
|
+
40: <span class="ruby-keyword kw">if</span> (<span class="ruby-constant">Regexp</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">lock_file</span>) <span class="ruby-operator">=~</span> <span class="ruby-identifier">f</span>)
|
366
|
+
41: <span class="ruby-identifier">raise</span> <span class="ruby-constant">RBatchException</span>, <span class="ruby-node">"Script double run is forbid about \"#{RBatch::program_name}\""</span>
|
367
|
+
42: <span class="ruby-keyword kw">end</span>
|
368
|
+
43: <span class="ruby-keyword kw">end</span>
|
369
|
+
44: <span class="ruby-keyword kw">end</span>
|
370
|
+
45: <span class="ruby-comment cmt"># make lockfile</span>
|
371
|
+
46: <span class="ruby-constant">Tempfile</span><span class="ruby-operator">::</span><span class="ruby-identifier">new</span>(<span class="ruby-identifier">lock_file</span>,<span class="ruby-constant">RBatch</span><span class="ruby-operator">::</span><span class="ruby-identifier">tmp_dir</span>)
|
372
|
+
47: <span class="ruby-keyword kw">end</span>
|
373
|
+
48: <span class="ruby-keyword kw">end</span></pre>
|
374
|
+
</div>
|
375
|
+
|
376
|
+
</div>
|
377
|
+
|
378
|
+
|
379
|
+
|
380
|
+
|
381
|
+
</div>
|
382
|
+
|
383
|
+
|
384
|
+
<div id="double-run-lock-file-method" class="method-detail ">
|
385
|
+
<a name="method-i-double_run_lock_file"></a>
|
386
|
+
|
387
|
+
<div class="method-heading">
|
388
|
+
|
389
|
+
<span class="method-name">double_run_lock_file</span><span
|
390
|
+
class="method-args">()</span>
|
391
|
+
<span class="method-click-advice">click to toggle source</span>
|
392
|
+
|
393
|
+
</div>
|
394
|
+
|
395
|
+
<div class="method-description">
|
396
|
+
|
397
|
+
|
398
|
+
|
399
|
+
|
400
|
+
|
401
|
+
<div class="method-source-code"
|
402
|
+
id="double-run-lock-file-source">
|
382
403
|
<pre>
|
383
|
-
<span class="ruby-comment"># File lib/rbatch.rb, line
|
384
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
404
|
+
<span class="ruby-comment cmt"># File lib/rbatch.rb, line 50</span>
|
405
|
+
50: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">double_run_lock_file</span> ; ; <span class="ruby-keyword kw">end</span></pre>
|
406
|
+
</div>
|
407
|
+
|
408
|
+
</div>
|
409
|
+
|
410
|
+
|
411
|
+
|
412
|
+
|
413
|
+
</div>
|
414
|
+
|
415
|
+
|
416
|
+
<div id="program-name-method" class="method-detail ">
|
417
|
+
<a name="method-i-program_name"></a>
|
418
|
+
|
419
|
+
<div class="method-heading">
|
420
|
+
|
421
|
+
<span class="method-name">program_name</span><span
|
422
|
+
class="method-args">()</span>
|
423
|
+
<span class="method-click-advice">click to toggle source</span>
|
424
|
+
|
425
|
+
</div>
|
426
|
+
|
427
|
+
<div class="method-description">
|
428
|
+
|
429
|
+
|
430
|
+
|
431
|
+
|
432
|
+
|
433
|
+
<div class="method-source-code"
|
434
|
+
id="program-name-source">
|
413
435
|
<pre>
|
414
|
-
<span class="ruby-comment"># File lib/rbatch.rb, line
|
415
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
436
|
+
<span class="ruby-comment cmt"># File lib/rbatch.rb, line 7</span>
|
437
|
+
7: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">program_name</span> ; <span class="ruby-identifier">@@program_name</span> ; <span class="ruby-keyword kw">end</span></pre>
|
438
|
+
</div>
|
439
|
+
|
440
|
+
</div>
|
441
|
+
|
442
|
+
|
443
|
+
|
444
|
+
|
445
|
+
</div>
|
446
|
+
|
447
|
+
|
448
|
+
<div id="program-name--method" class="method-detail ">
|
449
|
+
<a name="method-i-program_name%3D"></a>
|
450
|
+
|
451
|
+
<div class="method-heading">
|
452
|
+
|
453
|
+
<span class="method-name">program_name=</span><span
|
454
|
+
class="method-args">(f)</span>
|
455
|
+
<span class="method-click-advice">click to toggle source</span>
|
456
|
+
|
457
|
+
</div>
|
458
|
+
|
459
|
+
<div class="method-description">
|
460
|
+
|
461
|
+
|
462
|
+
|
463
|
+
|
464
|
+
|
465
|
+
<div class="method-source-code"
|
466
|
+
id="program-name--source">
|
467
|
+
<pre>
|
468
|
+
<span class="ruby-comment cmt"># File lib/rbatch.rb, line 6</span>
|
469
|
+
6: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">program_name=</span>(<span class="ruby-identifier">f</span>) ; <span class="ruby-identifier">@@program_name</span> = <span class="ruby-identifier">f</span> ; <span class="ruby-keyword kw">end</span></pre>
|
470
|
+
</div>
|
471
|
+
|
472
|
+
</div>
|
473
|
+
|
474
|
+
|
475
|
+
|
476
|
+
|
477
|
+
</div>
|
478
|
+
|
479
|
+
|
480
|
+
<div id="tmp-dir-method" class="method-detail ">
|
481
|
+
<a name="method-i-tmp_dir"></a>
|
482
|
+
|
483
|
+
<div class="method-heading">
|
484
|
+
|
485
|
+
<span class="method-name">tmp_dir</span><span
|
486
|
+
class="method-args">()</span>
|
487
|
+
<span class="method-click-advice">click to toggle source</span>
|
488
|
+
|
489
|
+
</div>
|
490
|
+
|
491
|
+
<div class="method-description">
|
492
|
+
|
493
|
+
|
494
|
+
|
495
|
+
|
496
|
+
|
497
|
+
<div class="method-source-code"
|
498
|
+
id="tmp-dir-source">
|
499
|
+
<pre>
|
500
|
+
<span class="ruby-comment cmt"># File lib/rbatch.rb, line 8</span>
|
501
|
+
8: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">tmp_dir</span>
|
502
|
+
9: <span class="ruby-keyword kw">case</span> <span class="ruby-constant">RUBY_PLATFORM</span>
|
503
|
+
10: <span class="ruby-keyword kw">when</span> <span class="ruby-regexp re">/mswin|mingw/</span>
|
504
|
+
11: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">ENV</span>[<span class="ruby-value str">"TEMP"</span>]
|
505
|
+
12: <span class="ruby-keyword kw">when</span> <span class="ruby-regexp re">/cygwin|linux/</span>
|
506
|
+
13: <span class="ruby-keyword kw">return</span> <span class="ruby-value str">"/tmp/"</span>
|
507
|
+
14: <span class="ruby-keyword kw">else</span>
|
508
|
+
15: <span class="ruby-identifier">raise</span> <span class="ruby-value str">"Unknown RUBY_PRATFORM : "</span> <span class="ruby-operator">+</span> <span class="ruby-constant">RUBY_PLATFORM</span>
|
509
|
+
16: <span class="ruby-keyword kw">end</span>
|
510
|
+
17: <span class="ruby-keyword kw">end</span></pre>
|
511
|
+
</div>
|
512
|
+
|
513
|
+
</div>
|
514
|
+
|
515
|
+
|
516
|
+
|
517
|
+
|
518
|
+
</div>
|
519
|
+
|
520
|
+
|
521
|
+
</div>
|
522
|
+
|
523
|
+
|
524
|
+
</div>
|
525
|
+
|
526
|
+
|
527
|
+
<div id="rdoc-debugging-section-dump" class="debugging-section">
|
528
|
+
|
529
|
+
<p>Disabled; run with --debug to generate this.</p>
|
530
|
+
|
531
|
+
</div>
|
532
|
+
|
533
|
+
<div id="validator-badges">
|
534
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
535
|
+
<p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
|
536
|
+
Rdoc Generator</a> 1.1.6</small>.</p>
|
537
|
+
</div>
|
447
538
|
|
448
539
|
</body>
|
449
540
|
</html>
|