rbatch 1.7.0 → 1.8.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/README.ja.md CHANGED
@@ -5,7 +5,7 @@ RBatch:Ruby-base バッチスクリプトフレームワーク
5
5
 
6
6
  RBatchについて
7
7
  --------------
8
- これはRubyで書かれたバッチスクリプトのフレームワークです。
8
+ これはRubyで書かれたシンプルなバッチスクリプトのフレームワークです。
9
9
  バッチスクリプト(バックアップやプロセスリロード等)を書く際に便利な機能をフレームワークとして提供しています。
10
10
 
11
11
  主な機能は以下のとおり。
@@ -184,7 +184,7 @@ $ cat log/YYYYMMDD_HHMMSS_backup.log
184
184
  ```
185
185
  # RBatch 全体設定
186
186
  #
187
- # 設定ファイルの形式はYAML形式です
187
+ # 設定ファイルの形式はYAML形式です
188
188
  #
189
189
 
190
190
  # -------------------
@@ -193,11 +193,11 @@ $ cat log/YYYYMMDD_HHMMSS_backup.log
193
193
 
194
194
  # スクリプトの二重起動を可能にするかどうか
195
195
  #
196
- # trueにすると、requireしたタイミングで例外を投げます。
197
- #
198
- # Default : false
196
+ # デフォルト値はfalse。
197
+ # trueにすると、同じスクリプトは二つ同時に起動できなくなります。
199
198
  #
200
199
  #forbid_double_run: true
200
+ #forbid_double_run: false
201
201
 
202
202
  # -------------------
203
203
  # 外部コマンド実行関連
@@ -205,11 +205,11 @@ $ cat log/YYYYMMDD_HHMMSS_backup.log
205
205
 
206
206
  # 例外発生機能を有効にするかどうか
207
207
  #
208
- # Default : false
209
- #
210
- # trueの場合、コマンドの終了ステータスが0でない場合に例外を発生する。
208
+ # デフォルト値はfalse
209
+ # trueの場合、コマンドの終了ステータスが0でない場合に例外を発生する。
211
210
  #
212
211
  #cmd_raise: true
212
+ #cmd_raise: false
213
213
 
214
214
  # -------------------
215
215
  # ログ関連
@@ -217,9 +217,8 @@ $ cat log/YYYYMMDD_HHMMSS_backup.log
217
217
 
218
218
  # ログファイル名
219
219
  #
220
- # Default : "<date>_<time>_<prog>.log"
221
- #
222
- # 予約語
220
+ # デフォルト値は"<date>_<time>_<prog>.log"
221
+ # 以下の文字列は予約語
223
222
  # <data> --> YYYYMMDDの日付形式に置換されます
224
223
  # <time> --> hhmmssの時刻形式に置換されます
225
224
  # <prog> --> 拡張子を除いたファイル名に置換されます
@@ -229,46 +228,66 @@ $ cat log/YYYYMMDD_HHMMSS_backup.log
229
228
 
230
229
  # ログ出力ディレクトリ
231
230
  #
232
- # Default : "(スクリプトの配置パス)/../log"
231
+ # デフォルト値は"(スクリプトの配置パス)/../log"
233
232
  #
234
233
  #log_dir : "/tmp/log"
235
234
 
236
235
  # ログを追記するかどうか
237
236
  #
238
- # Default : ture
237
+ # デフォルト値はture
239
238
  #
239
+ #log_append : true
240
240
  #log_append : false
241
241
 
242
242
  # ログレベル
243
243
  #
244
- # Default : "info"
245
- # Value : "debug","info","wran","error","fatal"
244
+ # デフォルト値は"info"
245
+ # 設定できる値は"debug","info","wran","error","fatal"
246
246
  #
247
247
  #log_level : "debug"
248
+ #log_level : "info"
249
+ #log_level : "warn"
250
+ #log_level : "error"
251
+ #log_level : "fatal"
248
252
 
249
253
  # 標準出力とログの両方に文字列を出力するかどうか
250
254
  #
251
- # Default : false
255
+ # デフォルト値はfalse
252
256
  #
253
257
  #log_stdout : true
258
+ #log_stdout : false
254
259
 
255
260
  # 古いログを削除するかどうか
256
261
  #
257
- # trueの場合、RBatch::Log.newを呼んだタイミングで、古いログを削除する。
258
- # 削除対象のログは、そのRBatch::Logのインスタンスが出力するログファイルと
259
- # 同じファイル名フォーマットであり、かつログファイル名のフォーマットに<date>が
260
- # 含まれるもの。
261
- # 例えば、RBatch::Logで出力するログファイルが「20120105_hoge.log」だった場合、
262
- # 削除対象のログは「YYYYMMDD_hoge.log」のログとなる。
263
- #
264
- # Default : false
262
+ # デフォルト値はfalse。
263
+ # trueの場合、RBatch::Log.newを呼んだタイミングで、古いログを削除する。
264
+ # 削除対象のログは、そのRBatch::Logのインスタンスが出力するログファイルと
265
+ # 同じファイル名フォーマットであり、かつログファイル名のフォーマットに<date>が
266
+ # 含まれるもの。
267
+ # 例えば、RBatch::Logで出力するログファイルが「20120105_hoge.log」だった場合、
268
+ # 削除対象のログは「YYYYMMDD_hoge.log」のログとなる。
265
269
  #
266
270
  #log_delete_old_log: true
271
+ #log_delete_old_log: false
267
272
 
268
273
  # 古いログの残す日数
269
274
  #
270
- # Default : 7
275
+ # デフォルト値は 7
271
276
  #
272
277
  #log_delete_old_log_date: 14
273
278
 
279
+ # メール送信するかどうか
280
+ #
281
+ # デフォルト値は false。
282
+ # log.error(msg)かlog.fatal(msg) を呼び出したときに,"msg"の内容をメールで送信する。
283
+ #
284
+ #send_mail : true
285
+
286
+ # メール送信のパラメータ
287
+ #
288
+ #mail_to : "xxx@sample.com"
289
+ #mail_from : "xxx@sample.com"
290
+ #mail_server_host : "localhost"
291
+ #mail_server_port : 25
292
+
274
293
  ```
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  [[English]](https://github.com/fetaro/rbatch/blob/master/README.md "english") [[Japanese]](https://github.com/fetaro/rbatch/blob/master/README.ja.md "japanese")
2
2
 
3
- RBatch:Ruby-base Simple Batch Script Framework
3
+ RBatch:Ruby-base Simple Batch Framework
4
4
  =============
5
5
 
6
6
  About RBatch
@@ -181,18 +181,20 @@ Config Sample
181
181
  ```
182
182
  # RBatch Common Config
183
183
  #
184
- # This file format is YAML
184
+ # This file format is YAML.
185
185
  #
186
186
 
187
187
  # -------------------
188
188
  # Global setting
189
189
  # -------------------
190
190
 
191
- # Forbit Double Run
191
+ # Forbit Script Double Run
192
192
  #
193
- # Default : false
193
+ # Default is false.
194
+ # If this option is true, two same script cannot start at the same time.
194
195
  #
195
196
  #forbid_double_run: true
197
+ #forbid_double_run: false
196
198
 
197
199
  # -------------------
198
200
  # Cmd setting
@@ -200,11 +202,11 @@ Config Sample
200
202
 
201
203
  # Raise Exception
202
204
  #
203
- # Default : false
204
- #
205
- # If command exit status is not 0, raise exception.
205
+ # Default is false.
206
+ # If command exit status is not 0, raise exception.
206
207
  #
207
208
  #cmd_raise : true
209
+ #cmd_raise : false
208
210
 
209
211
 
210
212
  # -------------------
@@ -213,9 +215,8 @@ Config Sample
213
215
 
214
216
  # Log File Name
215
217
  #
216
- # Default : "<date>_<time>_<prog>.log"
217
- #
218
- # Reservation words
218
+ # Default is "<date>_<time>_<prog>.log".
219
+ # Reservation words are follows.
219
220
  # <data> --> replace to YYYYMMDD date string
220
221
  # <time> --> replace to hhmmss time string
221
222
  # <prog> --> Program file base name (except extention)
@@ -225,51 +226,64 @@ Config Sample
225
226
 
226
227
  # Log Output Directory
227
228
  #
228
- # Default : "(Script path)/../log"
229
+ # Default is "(Script path)/../log".
229
230
  #
230
231
  #log_dir : "/tmp/log"
231
232
 
232
233
  # Append log or not
233
234
  #
234
- # Default : ture
235
+ # Default is ture.
235
236
  #
237
+ #log_append : true
236
238
  #log_append : false
237
239
 
238
240
  # Log Level
239
241
  #
240
- # Default : "info"
241
- # Value : "debug","info","wran","error","fatal"
242
+ # Default is "info".
243
+ # Effective values are "debug","info","wran","error",and "fatal".
242
244
  #
243
245
  #log_level : "debug"
246
+ #log_level : "info"
247
+ #log_level : "warn"
248
+ #log_level : "error"
249
+ #log_level : "fatal"
244
250
 
245
251
  # Print log-string both file and STDOUT
246
252
  #
247
- # Default : false
248
- #
249
- #log_stdout : true
250
-
251
- # 標準出力とログの両方に文字列を出力するかどうか
252
- #
253
- # Default : false
253
+ # Default is false.
254
254
  #
255
255
  #log_stdout : true
256
+ #log_stdout : false
256
257
 
257
258
  # Delete old log files
258
259
  #
259
- # If this is true, delete old log file when RBatch::Log.new is called.
260
- # A log file to delete is a log file which was made by the RBatch::Log instance,
261
- # and log filename format include "<date>".
262
- #
263
- # Default : false
260
+ # Default is false.
261
+ # If this is true, delete old log file when RBatch::Log.new is called.
262
+ # A log file to delete is a log file which was made by the RBatch::Log instance,
263
+ # and log filename format include "<date>".
264
264
  #
265
265
  #log_delete_old_log: true
266
+ #log_delete_old_log: false
266
267
 
267
268
  # The day of leaving log files
268
269
  #
269
- # Default : 7
270
+ # Default is 7.
270
271
  #
271
272
  #log_delete_old_log_date: 14
272
273
 
274
+ # Send mail or not
275
+ #
276
+ # Default is false.
277
+ # When log.error(msg) or log.fatal(msg) called , send e-mail including "msg".
278
+ #
279
+ #send_mail : true
280
+
281
+ # Send mail parameters
282
+ #
283
+ #mail_to : "xxx@sample.com"
284
+ #mail_from : "xxx@sample.com"
285
+ #mail_server_host : "localhost"
286
+ #mail_server_port : 25
273
287
 
274
288
  ```
275
289
 
data/Rakefile CHANGED
@@ -7,7 +7,7 @@ require 'rake/testtask'
7
7
 
8
8
  spec = Gem::Specification.new do |s|
9
9
  s.name = 'rbatch'
10
- s.version = '1.7.0'
10
+ s.version = '1.8.0'
11
11
  s.extra_rdoc_files = ['README.md', 'LICENSE']
12
12
  s.summary = 'simple batch framework'
13
13
  s.description = ''
@@ -1,163 +1,207 @@
1
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
 
5
5
  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
6
6
  <head>
7
- <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
7
+ <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
8
8
 
9
- <title>File: CHANGELOG [RBatch Docs]</title>
9
+ <title>File: CHANGELOG [RBatch Docs]</title>
10
10
 
11
- <link type="text/css" media="screen" href="./rdoc.css" rel="stylesheet" />
11
+ <link type="text/css" media="screen" href="./rdoc.css" rel="stylesheet" />
12
12
 
13
- <script src="./js/jquery.js" type="text/javascript"
14
- charset="utf-8"></script>
15
- <script src="./js/thickbox-compressed.js" type="text/javascript"
16
- charset="utf-8"></script>
17
- <script src="./js/quicksearch.js" type="text/javascript"
18
- charset="utf-8"></script>
19
- <script src="./js/darkfish.js" type="text/javascript"
20
- charset="utf-8"></script>
13
+ <script src="./js/jquery.js" type="text/javascript"
14
+ charset="utf-8"></script>
15
+ <script src="./js/thickbox-compressed.js" type="text/javascript"
16
+ charset="utf-8"></script>
17
+ <script src="./js/quicksearch.js" type="text/javascript"
18
+ charset="utf-8"></script>
19
+ <script src="./js/darkfish.js" type="text/javascript"
20
+ charset="utf-8"></script>
21
21
  </head>
22
22
 
23
23
  <body class="file">
24
- <div id="metadata">
25
- <div id="home-metadata">
26
- <div id="home-section" class="section">
24
+ <div id="metadata">
25
+ <div id="home-metadata">
26
+ <div id="home-section" class="section">
27
27
  <h3 class="section-header">
28
28
  <a href="./index.html">Home</a>
29
29
  <a href="./index.html#classes">Classes</a>
30
30
  <a href="./index.html#methods">Methods</a>
31
31
  </h3>
32
- </div>
33
- </div>
34
-
35
- <div id="project-metadata">
36
-
37
-
38
- <div id="fileindex-section" class="section project-section">
39
- <h3 class="section-header">Files</h3>
40
- <ul>
41
-
42
- <li class="file"><a href="./CHANGELOG.html">CHANGELOG</a></li>
43
-
44
- <li class="file"><a href="./LICENSE.html">LICENSE</a></li>
45
-
46
- </ul>
47
- </div>
48
-
49
-
50
- <div id="classindex-section" class="section project-section">
51
- <h3 class="section-header">Class Index
52
- <span class="search-toggle"><img src="./images/find.png"
53
- height="16" width="16" alt="[+]"
54
- title="show/hide quicksearch" /></span></h3>
55
- <form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
56
- <fieldset>
57
- <legend>Quicksearch</legend>
58
- <input type="text" name="quicksearch" value=""
59
- class="quicksearch-field" />
60
- </fieldset>
61
- </form>
62
-
63
- <ul class="link-list">
64
-
65
- <li><a href="./RBatch.html">RBatch</a></li>
66
-
67
- <li><a href="./RBatch/Cmd.html">RBatch::Cmd</a></li>
68
-
69
- <li><a href="./RBatch/CmdException.html">RBatch::CmdException</a></li>
70
-
71
- <li><a href="./RBatch/CmdResult.html">RBatch::CmdResult</a></li>
72
-
73
- <li><a href="./RBatch/Config.html">RBatch::Config</a></li>
74
-
75
- <li><a href="./RBatch/Log.html">RBatch::Log</a></li>
76
-
77
- <li><a href="./RBatch/RBatch.html">RBatch::RBatch</a></li>
78
-
79
- <li><a href="./RBatch/RBatch/RBatch.html">RBatch::RBatch::RBatch</a></li>
80
-
81
- <li><a href="./RBatch/RBatch/RBatch/Config.html">RBatch::RBatch::RBatch::Config</a></li>
82
-
83
- <li><a href="./RBatch/RBatch/RBatch/Config/Exception.html">RBatch::RBatch::RBatch::Config::Exception</a></li>
84
-
85
- </ul>
86
- <div id="no-class-search-results" style="display: none;">No matching classes.</div>
87
- </div>
88
-
89
-
90
- </div>
91
- </div>
92
-
93
- <div id="documentation">
94
- <hr style="height: 3px">
95
-
96
- <p>initial</p>
97
-
98
- <p>1.1.0(2012/11/9)</p>
99
- <hr style="height: 3px">
100
- <ul><li>
101
- <p>make common config file</p>
102
- </li><li>
103
- <p>change log option</p>
104
- </li></ul>
105
-
106
- <p>1.2.0(2012/11/13)</p>
107
- <hr style="height: 3px">
108
- <ul><li>
109
- <p>change log level option format</p>
110
- </li><li>
111
- <p>make log append option</p>
112
- </li></ul>
113
-
114
- <p>1.3.0(2012/12/30)</p>
115
- <hr style="height: 3px">
116
- <ul><li>
117
- <p>add <a href="RBatch/Log.html">RBatch::Log</a> to instance interface</p>
118
- </li><li>
119
- <p>add double run check option</p>
120
- </li></ul>
121
-
122
- <p>1.4.0(2013/1/5)</p>
123
- <hr style="height: 2px">
124
- <ul><li>
125
- <p>add log_stdout option</p>
126
- </li><li>
127
- <p>add sample code</p>
128
- </li><li>
129
- <p>add cmd_raise option</p>
130
- </li><li>
131
- <p>add log_delete_old_log option</p>
132
- </li></ul>
133
-
134
- <p>1.5.0(2013/1/11)</p>
135
- <hr style="height: 2px">
136
- <ul><li>
137
- <p>change default config dir “../config” -&gt; “../conf”</p>
138
- </li></ul>
139
-
140
- <p>1.6.0(2013/1/14)</p>
141
- <hr style="height: 2px">
142
- <ul><li>
143
- <p>add config key check</p>
144
- </li></ul>
145
-
146
- <p>1.7.0(2013/01/30)</p>
147
- <hr style="height: 2px">
148
- <ul><li>
149
- <p>change log format</p>
150
- </li><li>
151
- <p>delete change log format option</p>
152
- </li></ul>
153
-
154
- </div>
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>
32
+ </div>
33
+ </div>
34
+
35
+ <div id="project-metadata">
36
+
37
+
38
+ <div id="fileindex-section" class="section project-section">
39
+ <h3 class="section-header">Files</h3>
40
+ <ul>
41
+
42
+ <li class="file"><a href="./CHANGELOG.html">CHANGELOG</a></li>
43
+
44
+ <li class="file"><a href="./LICENSE.html">LICENSE</a></li>
45
+
46
+ </ul>
47
+ </div>
48
+
49
+
50
+ <div id="classindex-section" class="section project-section">
51
+ <h3 class="section-header">Class Index
52
+ <span class="search-toggle"><img src="./images/find.png"
53
+ height="16" width="16" alt="[+]"
54
+ title="show/hide quicksearch" /></span></h3>
55
+ <form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
56
+ <fieldset>
57
+ <legend>Quicksearch</legend>
58
+ <input type="text" name="quicksearch" value=""
59
+ class="quicksearch-field" />
60
+ </fieldset>
61
+ </form>
62
+
63
+ <ul class="link-list">
64
+
65
+ <li><a href="./RBatch.html">RBatch</a></li>
66
+
67
+ <li><a href="./RBatch/Cmd.html">RBatch::Cmd</a></li>
68
+
69
+ <li><a href="./RBatch/CmdException.html">RBatch::CmdException</a></li>
70
+
71
+ <li><a href="./RBatch/CmdResult.html">RBatch::CmdResult</a></li>
72
+
73
+ <li><a href="./RBatch/Config.html">RBatch::Config</a></li>
74
+
75
+ <li><a href="./RBatch/Config/Exception.html">RBatch::Config::Exception</a></li>
76
+
77
+ <li><a href="./RBatch/Log.html">RBatch::Log</a></li>
78
+
79
+ <li><a href="./RBatchException.html">RBatchException</a></li>
80
+
81
+ </ul>
82
+ <div id="no-class-search-results" style="display: none;">No matching classes.</div>
83
+ </div>
84
+
85
+
86
+ </div>
87
+ </div>
88
+
89
+ <div id="documentation">
90
+ <hr style="height: 3px"></hr><p>
91
+ initial
92
+ </p>
93
+ <p>
94
+ 1.1.0(2012/11/9)
95
+ </p>
96
+ <hr style="height: 3px"></hr><ul>
97
+ <li><p>
98
+ make common config file
99
+ </p>
100
+ </li>
101
+ <li><p>
102
+ change log option
103
+ </p>
104
+ </li>
105
+ </ul>
106
+ <p>
107
+ 1.2.0(2012/11/13)
108
+ </p>
109
+ <hr style="height: 3px"></hr><ul>
110
+ <li><p>
111
+ change log level option format
112
+ </p>
113
+ </li>
114
+ <li><p>
115
+ make log append option
116
+ </p>
117
+ </li>
118
+ </ul>
119
+ <p>
120
+ 1.3.0(2012/12/30)
121
+ </p>
122
+ <hr style="height: 3px"></hr><ul>
123
+ <li><p>
124
+ add <a href="RBatch/Log.html">RBatch::Log</a> to instance interface
125
+ </p>
126
+ </li>
127
+ <li><p>
128
+ add double run check option
129
+ </p>
130
+ </li>
131
+ </ul>
132
+ <p>
133
+ 1.4.0(2013/1/5)
134
+ </p>
135
+ <hr style="height: 2px"></hr><ul>
136
+ <li><p>
137
+ add log_stdout option
138
+ </p>
139
+ </li>
140
+ <li><p>
141
+ add sample code
142
+ </p>
143
+ </li>
144
+ <li><p>
145
+ add cmd_raise option
146
+ </p>
147
+ </li>
148
+ <li><p>
149
+ add log_delete_old_log option
150
+ </p>
151
+ </li>
152
+ </ul>
153
+ <p>
154
+ 1.5.0(2013/1/11)
155
+ </p>
156
+ <hr style="height: 2px"></hr><ul>
157
+ <li><p>
158
+ change default config dir &#8220;../config&#8221; -> &#8220;../conf&#8220;
159
+ </p>
160
+ </li>
161
+ </ul>
162
+ <p>
163
+ 1.6.0(2013/1/14)
164
+ </p>
165
+ <hr style="height: 2px"></hr><ul>
166
+ <li><p>
167
+ add config key check
168
+ </p>
169
+ </li>
170
+ </ul>
171
+ <p>
172
+ 1.7.0(2013/01/30)
173
+ </p>
174
+ <hr style="height: 2px"></hr><ul>
175
+ <li><p>
176
+ change log format
177
+ </p>
178
+ </li>
179
+ <li><p>
180
+ delete change log format option
181
+ </p>
182
+ </li>
183
+ </ul>
184
+ <p>
185
+ 1.8.0(2013/02/10)
186
+ </p>
187
+ <hr style="height: 2px"></hr><ul>
188
+ <li><p>
189
+ add log_send_mail option
190
+ </p>
191
+ </li>
192
+ <li><p>
193
+ add cmd_timeout option
194
+ </p>
195
+ </li>
196
+ </ul>
197
+
198
+ </div>
199
+
200
+ <div id="validator-badges">
201
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
202
+ <p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
203
+ Rdoc Generator</a> 1.1.6</small>.</p>
204
+ </div>
161
205
  </body>
162
206
  </html>
163
207