rbatch 1.12.3 → 1.13.0

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -64,3 +64,7 @@ About bugfix, see commit log of https://github.com/fetaro/rbatch .
64
64
  ----
65
65
  * add Common Config Function
66
66
 
67
+ 1.13 (2013/12/19)
68
+ ----
69
+ * add customize point that can change RBatch home directory by using the environment variables, ${RB_HOME}.
70
+
data/README.ja.md CHANGED
@@ -25,13 +25,12 @@ RBatchについて
25
25
  RBatchでは、実行スクリプト、設定ファイルおよびログファイルについて、
26
26
  配置場所および命名規則が規約で決まっています。
27
27
 
28
- 具体的には、"bin/hoge.rb"というバッチスクリプトでは、"conf/hoge.yaml"という設定ファイルを読み、
29
- "log/YYYYMMDD_HHMMSS_hoge.rb"というログを出力するという規則です。
28
+ 具体的には、"${RB_HOME}/bin/hoge.rb"というスクリプトでは、"${RB_HOME}/conf/hoge.yaml"という設定ファイルを読み、"${RB_HOME}/log/YYYYMMDD_HHMMSS_hoge.rb"というログを出力するという規則です。
30
29
 
31
30
  例を示すと以下の通りです。
32
31
 
33
32
  ```
34
- $RB_HOME
33
+ ${RB_HOME}
35
34
  |-bin ←実行スクリプト配置場所
36
35
  | |- A.rb
37
36
  | |- B.rb
@@ -46,17 +45,23 @@ $RB_HOME
46
45
  |- YYYYMMDD_HHMMSS_B.log
47
46
  ```
48
47
 
49
- 注意:$RB_HOMEは環境変数として定義する必要はありません。$RB_HOMEは"(実行するスクリプトのパス)/../"として定義されています
48
+ ### RBatchホームディレクトリ
49
+
50
+ 環境変数${RB_HOME}を定義する事で、その場所をRBatchのホームディレクトリに固定することができます。
51
+
52
+ 環境変数${RB_HOME}を定義していない場合は、「実行するスクリプトが配置されているディレクトリの親ディレクトリ」が${RB_HOME}になります。言い換えると${RB_HOME}のデフォルト値は"(実行するスクリプトのパス)/../"です。
53
+
54
+ となります。
50
55
 
51
56
  ### 自動ログ出力
52
57
 
53
58
  Logging blockを使うことで、自動的にログファイルに出力することができます。
54
- ログファイルはデフォルトで"$RB_HOME/log/YYYYMMDD_HHMMSS_${PROG_NAME}.log"に出力されます。
59
+ ログファイルはデフォルトで"${RB_HOME}/log/YYYYMMDD_HHMMSS_${PROG_NAME}.log"に出力されます。
55
60
  例外が発生した場合でも、ログにスタックトレースを出力することができます。
56
61
 
57
62
  サンプル
58
63
 
59
- スクリプト : $RB_HOME/bin/sample1.rb
64
+ スクリプト : ${RB_HOME}/bin/sample1.rb
60
65
  ```
61
66
  require 'rbatch'
62
67
 
@@ -67,7 +72,7 @@ RBatch::Log.new(){ |log| # Logging block
67
72
  }
68
73
  ```
69
74
 
70
- ログファイル : $RB_HOME/log/20121020_005953_sample1.log
75
+ ログファイル : ${RB_HOME}/log/20121020_005953_sample1.log
71
76
  ```
72
77
  # Logfile created on 2012-10-20 00:59:53 +0900 by logger.rb/25413
73
78
  [2012-10-20 00:59:53 +900] [INFO ] info string
@@ -87,11 +92,11 @@ RBatch::Log.new(){ |log| # Logging block
87
92
  ### 自動設定ファイル読み込み
88
93
 
89
94
  RBatchは簡単にデフォルトの位置の設定ファイルを読み込めます。
90
- デフォルトの位置は"(スクリプトのパス)/../conf/${PROG_NAME}.yaml"です。
95
+ デフォルトの位置は"${RB_HOME}/conf/${PROG_NAME}.yaml"です。
91
96
 
92
97
  サンプル
93
98
 
94
- 設定ファイル : $RB_HOME/conf/sample2.yaml
99
+ 設定ファイル : ${RB_HOME}/conf/sample2.yaml
95
100
  ```
96
101
  key: value
97
102
  array:
@@ -100,7 +105,7 @@ array:
100
105
  - item3
101
106
  ```
102
107
 
103
- スクリプト : $RB_HOME/bin/sample2.rb
108
+ スクリプト : ${RB_HOME}/bin/sample2.rb
104
109
  ```
105
110
  require 'rbatch'
106
111
  p RBatch::config
@@ -148,7 +153,7 @@ RBatchの共通設定ファイルに"forbid_double_run: true"の設定を書け
148
153
 
149
154
  RBatchではオプションの指定の仕方は以下の二つがあります。
150
155
 
151
- 1. 全体設定ファイル($RB_HOME/conf/rbatch.yaml)に書く
156
+ 1. 全体設定ファイル(${RB_HOME}/conf/rbatch.yaml)に書く
152
157
  2. コンストラクタの引数に指定する
153
158
 
154
159
  全体設定ファイルにオプションを書くと、全てのスクリプトに効果がありますが、コンストラクタの引数に指定した場合はそのインスタンスのみ効果があります。
@@ -163,7 +168,7 @@ RBatchではオプションの指定の仕方は以下の二つがあります
163
168
  以下の場所にRBatch全体設定ファイルを配置すると、全てのスクリプトにてオプションが適用されます。
164
169
 
165
170
 
166
- $RB_HOME/conf/rbatch.yaml
171
+ ${RB_HOME}/conf/rbatch.yaml
167
172
 
168
173
 
169
174
  設定ファイルのサンプルは以下の通り
@@ -216,7 +221,7 @@ RBatchではオプションの指定の仕方は以下の二つがあります
216
221
 
217
222
  # ログ出力ディレクトリ
218
223
  #
219
- # デフォルト値は"(スクリプトの配置パス)/../log"。
224
+ # デフォルト値は"${RB_HOME}/log"。
220
225
  #
221
226
  #log_dir : "/tmp/log"
222
227
 
@@ -282,6 +287,8 @@ RBatchではオプションの指定の仕方は以下の二つがあります
282
287
 
283
288
  ### コンストラクタの引数によるオプション指定
284
289
 
290
+ スクリプト内で一時的にオプションを指定したい場合は、コンストラクタの引数にオプションのハッシュを指定します。
291
+
285
292
  #### RBatch::Logクラス
286
293
 
287
294
  RBatch::Log.new(opt = nil)
data/README.md CHANGED
@@ -24,11 +24,11 @@ Note: This software is released under the MIT License, see LICENSE.txt.
24
24
 
25
25
  RBach has convention of file naming and directorory structure.
26
26
 
27
- If you make "$RB_HOME/bin/hoge.rb", you should name config file to "$RB_HOME/conf/hoge.yaml". And the name of log file is decided on "$RB_HOME/log/YYYYMMDD_HHMMSS_hoge.rb"
27
+ If you make "${RB_HOME}/bin/hoge.rb", you should name config file to "${RB_HOME}/conf/hoge.yaml". And the name of log file is decided on "${RB_HOME}/log/YYYYMMDD_HHMMSS_hoge.rb"
28
28
 
29
29
  For example
30
30
  ```
31
- $RB_HOME/ <--- RBatch home
31
+ ${RB_HOME}/ <--- RBatch home
32
32
  |-bin <--- Scripts
33
33
  | |- A.rb
34
34
  | |- B.rb
@@ -43,18 +43,22 @@ $RB_HOME/ <--- RBatch home
43
43
  |- YYYYMMDD_HHMMSS_B.log
44
44
  ```
45
45
 
46
- Note: It is not necessary to define $RB_HOME as an environment variable. $RB_HOME is defined as "(running script path)/../"
46
+ ### RBatch home directory
47
+
48
+ When you set ${RB_HOME} environment variable, RBatch home directory is fix.
49
+
50
+ When you do NOT set ${RB_HOME}, ${RB_HOME} is the parent directory of the directory which script is located at. In other words, default of ${RB_HOME} is "(script path)/../" .
47
51
 
48
52
 
49
53
  ### Auto Logging
50
54
 
51
55
  Use "Auto Logging block", RBatch automatically writes to logfile.
52
- The default location of log file is $RB_HOME/log/YYYYMMDD_HHMMSS_${PROG_NAME}.log .
56
+ The default location of log file is ${RB_HOME}/log/YYYYMMDD_HHMMSS_${PROG_NAME}.log .
53
57
  If an exception occuerd, then RBatch write a stack trace to logfile.
54
58
 
55
59
  sample
56
60
 
57
- script : $RB_HOME/bin/sample1.rb
61
+ script : ${RB_HOME}/bin/sample1.rb
58
62
  ```
59
63
  require 'rbatch'
60
64
 
@@ -65,7 +69,7 @@ RBatch::Log.new(){ |log| # Logging block
65
69
  }
66
70
  ```
67
71
 
68
- logfile : $RB_HOME/log/20121020_005953_sample1.log
72
+ logfile : ${RB_HOME}/log/20121020_005953_sample1.log
69
73
  ```
70
74
  # Logfile created on 2012-10-20 00:59:53 +0900 by logger.rb/25413
71
75
  [2012-10-20 00:59:53 +900] [INFO ] info string
@@ -87,12 +91,12 @@ By using "log_send_mail" option, when an error occurs in script, RBatch sends an
87
91
 
88
92
  By using RBatch, your script read a configuration file easily.
89
93
  First you make configuration file which is named "(script base name).yaml" ,
90
- Then, put it to $RB_HOME/conf/ .
94
+ Then, put it to ${RB_HOME}/conf/ .
91
95
  So your script read it automatically.
92
96
 
93
97
  sample
94
98
 
95
- config : $RB_HOME/conf/sample2.yaml
99
+ config : ${RB_HOME}/conf/sample2.yaml
96
100
  ```
97
101
  key: value
98
102
  array:
@@ -101,7 +105,7 @@ array:
101
105
  - item3
102
106
  ```
103
107
 
104
- script : $RB_HOME/bin/sample2.rb
108
+ script : ${RB_HOME}/bin/sample2.rb
105
109
  ```
106
110
  require 'rbatch'
107
111
  p RBatch::config
@@ -115,7 +119,7 @@ p RBatch::config["not_exist"]
115
119
  ```
116
120
 
117
121
  If you can use common configuration file which is read from all scripts,
118
- you make "$RB_HOME/conf/common.yaml" .
122
+ you make "${RB_HOME}/conf/common.yaml" .
119
123
 
120
124
  ### External Command Wrapper
121
125
 
@@ -167,7 +171,7 @@ The name of the key to global configuration file and the name of the key to cons
167
171
  If you make follow config file, option value effect to all scripts.
168
172
 
169
173
  ```
170
- $RB_HOME/conf/rbatch.yaml
174
+ ${RB_HOME}/conf/rbatch.yaml
171
175
  ```
172
176
 
173
177
  Config Sample
@@ -220,7 +224,7 @@ Config Sample
220
224
 
221
225
  # Log Output Directory
222
226
  #
223
- # Default is "(Script path)/../log".
227
+ # Default is "${RB_HOME}/log".
224
228
  #
225
229
  #log_dir : "/tmp/log"
226
230
 
@@ -283,6 +287,8 @@ Config Sample
283
287
 
284
288
  ### Set by argument of the constracter
285
289
 
290
+ If you want to set options in a script, you hand an argument of options to a constructor.
291
+
286
292
  #### class RBatch::Log
287
293
 
288
294
  RBatch::Log.new(opt = nil)
data/lib/rbatch.rb CHANGED
@@ -2,9 +2,13 @@ $LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__)))
2
2
  require 'digest'
3
3
  module RBatch
4
4
  @@program_name = $PROGRAM_NAME
5
+ @@home_dir = ""
5
6
  module_function
6
7
  def program_name=(f) ; @@program_name = f ; end
7
8
  def program_name ; @@program_name ; end
9
+ def home_dir=(d) ; @@home_dir = d ; end
10
+ def home_dir ; @@home_dir ; end
11
+
8
12
  # Hostname
9
13
  def hostname
10
14
  case RUBY_PLATFORM
@@ -36,7 +40,7 @@ module RBatch
36
40
  end
37
41
  end
38
42
  def rbatch_config_path
39
- File.join(File.dirname(RBatch.program_name),"..","conf","rbatch.yaml")
43
+ File.join(@@home_dir,"conf","rbatch.yaml")
40
44
  end
41
45
  def rbatch_config
42
46
  if File.exist?(RBatch.rbatch_config_path)
@@ -74,6 +78,12 @@ end
74
78
  class RBatchException < Exception ; end
75
79
 
76
80
  # main
81
+ if ENV["RB_HOME"]
82
+ RBatch::home_dir = ENV["RB_HOME"]
83
+ else
84
+ RBatch::home_dir = File.join(File.dirname(RBatch.program_name) , "..")
85
+ end
86
+
77
87
  require 'rbatch/log'
78
88
  require 'rbatch/config'
79
89
  require 'rbatch/common_config'
@@ -12,15 +12,15 @@ module RBatch
12
12
  #
13
13
  # Read common config file and return hash opject. If the key does not exist in config file, raise RBatch::CommonConfig::Exception.
14
14
  #
15
- # Default common config file path is "../conf/common.yaml"
15
+ # Default common config file path is "${RB_HOME}/conf/common.yaml"
16
16
  # ==== Sample
17
- # config : ./conf/common.yaml
17
+ # config : ${RB_HOME}/conf/common.yaml
18
18
  # key: value
19
19
  # array:
20
20
  # - item1
21
21
  # - item2
22
22
  # - item3
23
- # script : ./bin/sample.rb
23
+ # script : ${RB_HOME}/bin/sample.rb
24
24
  # require 'rbatch'
25
25
  # p RBatch::common_config
26
26
  # => {"key" => "value", "array" => ["item1", "item2", "item3"]}
@@ -29,7 +29,7 @@ module RBatch
29
29
  @config
30
30
  def initialize
31
31
  file = "common.yaml"
32
- dir = File.join(File.join(File.dirname(RBatch.program_name),".."),"conf")
32
+ dir = File.join(RBatch::home_dir,"conf")
33
33
  @path = File.join(dir,file)
34
34
  @config = YAML::load_file(@path)
35
35
  end
data/lib/rbatch/config.rb CHANGED
@@ -12,15 +12,15 @@ module RBatch
12
12
  #
13
13
  # Read config file and return hash opject. If the key does not exist in config file, raise RBatch::Config::Exception.
14
14
  #
15
- # Default config file path is "../conf/(base-name of Program file).yaml"
15
+ # Default config file path is "${RB_HOME}/conf/(program base name).yaml"
16
16
  # ==== Sample
17
- # config : ./conf/sample2.yaml
17
+ # config : ${RB_HOME}/conf/sample2.yaml
18
18
  # key: value
19
19
  # array:
20
20
  # - item1
21
21
  # - item2
22
22
  # - item3
23
- # script : ./bin/sample2.rb
23
+ # script : ${RB_HOME}/bin/sample2.rb
24
24
  # require 'rbatch'
25
25
  # p RBatch::Config.new
26
26
  # # or p RBatch::config
@@ -30,7 +30,7 @@ module RBatch
30
30
  @config
31
31
  def initialize
32
32
  file = Pathname(File.basename(RBatch.program_name)).sub_ext(".yaml").to_s
33
- dir = File.join(File.join(File.dirname(RBatch.program_name),".."),"conf")
33
+ dir = File.join(RBatch::home_dir,"conf")
34
34
  @path = File.join(dir,file)
35
35
  @config = YAML::load_file(@path)
36
36
  end
data/lib/rbatch/log.rb CHANGED
@@ -8,13 +8,13 @@ module RBatch
8
8
  #
9
9
  #By using Logging block, RBatch writes to logfile automatically.
10
10
  #
11
- #The default location of log file is "../log/YYYYMMDD_HHMMSS_${PROG_NAME}.log" .
11
+ #The default location of log file is "${RB_HOME}/log/YYYYMMDD_HHMMSS_(program base name).log" .
12
12
  #
13
13
  #If an exception occuerd, then RBatch writes back trace to logfile.
14
14
  #
15
15
  #=== Sample
16
16
  #
17
- #script : ./bin/sample1.rb
17
+ #script : ${RB_HOME}/bin/sample1.rb
18
18
  #
19
19
  # require 'rbatch'
20
20
  #
@@ -25,7 +25,7 @@ module RBatch
25
25
  # }
26
26
  #
27
27
  #
28
- #logfile : ./log/20121020_005953_sample1.log
28
+ #logfile : ${RB_HOME}/log/20121020_005953_sample1.log
29
29
  #
30
30
  # [2012-10-20 00:59:53 +900] [INFO ] info string
31
31
  # [2012-10-20 00:59:53 +900] [ERROR] error string
@@ -40,7 +40,7 @@ module RBatch
40
40
  @@verbose = false
41
41
  @@def_opt = {
42
42
  :name => "<date>_<time>_<prog>.log",
43
- :dir => File.join(File.dirname(RBatch.program_name), ".." , "log"),
43
+ :dir => File.join(RBatch::home_dir , "log"),
44
44
  :append => true,
45
45
  :level => "info",
46
46
  :stdout => false,
@@ -81,7 +81,7 @@ module RBatch
81
81
  # ==== Params
82
82
  # +opt+ = Option hash object.
83
83
  # - +:name+ (String) = name of log file. Default is "<date>_<time>_<prog>.log". Reservation-words are "<date>","<time>","<prog>","<host>". "<date>" is replaced YYYYMMDD. "<time>" is replaced HHMMSS. "<prog>" is replaced a base-name of program file.
84
- # - +:dir+ (String) = log direcotry. Default is "../log"
84
+ # - +:dir+ (String) = log direcotry. Default is "${RB_HOME}/log"
85
85
  # - +:level+ (String) = log level. Default is "info". ["debug"|"info"|"warn"|"error"|"fatal"] .
86
86
  # - +:append+ (Boolean) = appned to log or not(=overwrite). Default is ture.
87
87
  # - +:stdout+ (Boolean) = output both the log file and STDOUT. Default is false.
@@ -1,3 +1,3 @@
1
1
  module RBatch
2
- VERSION = "1.12.3"
2
+ VERSION = "1.13.0"
3
3
  end
data/rdocs/RBatch.html CHANGED
@@ -106,6 +106,10 @@
106
106
 
107
107
  <li><a href="#method-i-double_run_lock_file">#double_run_lock_file</a></li>
108
108
 
109
+ <li><a href="#method-i-home_dir">#home_dir</a></li>
110
+
111
+ <li><a href="#method-i-home_dir%3D">#home_dir=</a></li>
112
+
109
113
  <li><a href="#method-i-hostname">#hostname</a></li>
110
114
 
111
115
  <li><a href="#method-i-program_name">#program_name</a></li>
@@ -328,22 +332,22 @@ Alias of RBatch::Config.new
328
332
  <div class="method-source-code"
329
333
  id="double-run-check-source">
330
334
  <pre>
331
- <span class="ruby-comment cmt"># File lib/rbatch.rb, line 54</span>
332
- 54: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">double_run_check</span>
333
- 55: <span class="ruby-comment cmt"># double run check</span>
334
- 56: <span class="ruby-keyword kw">if</span> ( <span class="ruby-constant">RBatch</span><span class="ruby-operator">::</span><span class="ruby-identifier">rbatch_config</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-constant">RBatch</span><span class="ruby-operator">::</span><span class="ruby-identifier">rbatch_config</span>[<span class="ruby-value str">&quot;forbid_double_run&quot;</span>] )
335
- 57: <span class="ruby-identifier">lock_file</span>=<span class="ruby-value str">&quot;rbatch_lock_&quot;</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>)
336
- 58: <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>
337
- 59: <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>
338
- 60: <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>)
339
- 61: <span class="ruby-identifier">raise</span> <span class="ruby-constant">RBatchException</span>, <span class="ruby-node">&quot;Script double run is forbid about \&quot;#{RBatch::program_name}\&quot;&quot;</span>
340
- 62: <span class="ruby-keyword kw">end</span>
341
- 63: <span class="ruby-keyword kw">end</span>
342
- 64: <span class="ruby-keyword kw">end</span>
343
- 65: <span class="ruby-comment cmt"># make lockfile</span>
344
- 66: <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>)
345
- 67: <span class="ruby-keyword kw">end</span>
346
- 68: <span class="ruby-keyword kw">end</span></pre>
335
+ <span class="ruby-comment cmt"># File lib/rbatch.rb, line 58</span>
336
+ 58: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">double_run_check</span>
337
+ 59: <span class="ruby-comment cmt"># double run check</span>
338
+ 60: <span class="ruby-keyword kw">if</span> ( <span class="ruby-constant">RBatch</span><span class="ruby-operator">::</span><span class="ruby-identifier">rbatch_config</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-constant">RBatch</span><span class="ruby-operator">::</span><span class="ruby-identifier">rbatch_config</span>[<span class="ruby-value str">&quot;forbid_double_run&quot;</span>] )
339
+ 61: <span class="ruby-identifier">lock_file</span>=<span class="ruby-value str">&quot;rbatch_lock_&quot;</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>)
340
+ 62: <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>
341
+ 63: <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>
342
+ 64: <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>)
343
+ 65: <span class="ruby-identifier">raise</span> <span class="ruby-constant">RBatchException</span>, <span class="ruby-node">&quot;Script double run is forbid about \&quot;#{RBatch::program_name}\&quot;&quot;</span>
344
+ 66: <span class="ruby-keyword kw">end</span>
345
+ 67: <span class="ruby-keyword kw">end</span>
346
+ 68: <span class="ruby-keyword kw">end</span>
347
+ 69: <span class="ruby-comment cmt"># make lockfile</span>
348
+ 70: <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>)
349
+ 71: <span class="ruby-keyword kw">end</span>
350
+ 72: <span class="ruby-keyword kw">end</span></pre>
347
351
  </div>
348
352
 
349
353
  </div>
@@ -374,8 +378,72 @@ Alias of RBatch::Config.new
374
378
  <div class="method-source-code"
375
379
  id="double-run-lock-file-source">
376
380
  <pre>
377
- <span class="ruby-comment cmt"># File lib/rbatch.rb, line 70</span>
378
- 70: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">double_run_lock_file</span> ; ; <span class="ruby-keyword kw">end</span></pre>
381
+ <span class="ruby-comment cmt"># File lib/rbatch.rb, line 74</span>
382
+ 74: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">double_run_lock_file</span> ; ; <span class="ruby-keyword kw">end</span></pre>
383
+ </div>
384
+
385
+ </div>
386
+
387
+
388
+
389
+
390
+ </div>
391
+
392
+
393
+ <div id="home-dir-method" class="method-detail ">
394
+ <a name="method-i-home_dir"></a>
395
+
396
+ <div class="method-heading">
397
+
398
+ <span class="method-name">home_dir</span><span
399
+ class="method-args">()</span>
400
+ <span class="method-click-advice">click to toggle source</span>
401
+
402
+ </div>
403
+
404
+ <div class="method-description">
405
+
406
+
407
+
408
+
409
+
410
+ <div class="method-source-code"
411
+ id="home-dir-source">
412
+ <pre>
413
+ <span class="ruby-comment cmt"># File lib/rbatch.rb, line 10</span>
414
+ 10: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">home_dir</span> ; <span class="ruby-identifier">@@home_dir</span> ; <span class="ruby-keyword kw">end</span></pre>
415
+ </div>
416
+
417
+ </div>
418
+
419
+
420
+
421
+
422
+ </div>
423
+
424
+
425
+ <div id="home-dir--method" class="method-detail ">
426
+ <a name="method-i-home_dir%3D"></a>
427
+
428
+ <div class="method-heading">
429
+
430
+ <span class="method-name">home_dir=</span><span
431
+ class="method-args">(d)</span>
432
+ <span class="method-click-advice">click to toggle source</span>
433
+
434
+ </div>
435
+
436
+ <div class="method-description">
437
+
438
+
439
+
440
+
441
+
442
+ <div class="method-source-code"
443
+ id="home-dir--source">
444
+ <pre>
445
+ <span class="ruby-comment cmt"># File lib/rbatch.rb, line 9</span>
446
+ 9: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">home_dir=</span>(<span class="ruby-identifier">d</span>) ; <span class="ruby-identifier">@@home_dir</span> = <span class="ruby-identifier">d</span> ; <span class="ruby-keyword kw">end</span></pre>
379
447
  </div>
380
448
 
381
449
  </div>
@@ -408,17 +476,17 @@ Hostname
408
476
  <div class="method-source-code"
409
477
  id="hostname-source">
410
478
  <pre>
411
- <span class="ruby-comment cmt"># File lib/rbatch.rb, line 9</span>
412
- 9: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">hostname</span>
413
- 10: <span class="ruby-keyword kw">case</span> <span class="ruby-constant">RUBY_PLATFORM</span>
414
- 11: <span class="ruby-keyword kw">when</span> <span class="ruby-regexp re">/mswin|mingw/</span>
415
- 12: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">ENV</span>[<span class="ruby-value str">&quot;COMPUTERNAME&quot;</span>] <span class="ruby-operator">?</span> <span class="ruby-constant">ENV</span>[<span class="ruby-value str">&quot;COMPUTERNAME&quot;</span>] <span class="ruby-operator">:</span> <span class="ruby-value str">&quot;unknownhost&quot;</span>
416
- 13: <span class="ruby-keyword kw">when</span> <span class="ruby-regexp re">/cygwin|linux/</span>
417
- 14: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">ENV</span>[<span class="ruby-value str">&quot;HOSTNAME&quot;</span>] <span class="ruby-operator">?</span> <span class="ruby-constant">ENV</span>[<span class="ruby-value str">&quot;HOSTNAME&quot;</span>] <span class="ruby-operator">:</span> <span class="ruby-value str">&quot;unknownhost&quot;</span>
418
- 15: <span class="ruby-keyword kw">else</span>
419
- 16: <span class="ruby-keyword kw">return</span> <span class="ruby-value str">&quot;unknownhost&quot;</span>
420
- 17: <span class="ruby-keyword kw">end</span>
421
- 18: <span class="ruby-keyword kw">end</span></pre>
479
+ <span class="ruby-comment cmt"># File lib/rbatch.rb, line 13</span>
480
+ 13: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">hostname</span>
481
+ 14: <span class="ruby-keyword kw">case</span> <span class="ruby-constant">RUBY_PLATFORM</span>
482
+ 15: <span class="ruby-keyword kw">when</span> <span class="ruby-regexp re">/mswin|mingw/</span>
483
+ 16: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">ENV</span>[<span class="ruby-value str">&quot;COMPUTERNAME&quot;</span>] <span class="ruby-operator">?</span> <span class="ruby-constant">ENV</span>[<span class="ruby-value str">&quot;COMPUTERNAME&quot;</span>] <span class="ruby-operator">:</span> <span class="ruby-value str">&quot;unknownhost&quot;</span>
484
+ 17: <span class="ruby-keyword kw">when</span> <span class="ruby-regexp re">/cygwin|linux/</span>
485
+ 18: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">ENV</span>[<span class="ruby-value str">&quot;HOSTNAME&quot;</span>] <span class="ruby-operator">?</span> <span class="ruby-constant">ENV</span>[<span class="ruby-value str">&quot;HOSTNAME&quot;</span>] <span class="ruby-operator">:</span> <span class="ruby-value str">&quot;unknownhost&quot;</span>
486
+ 19: <span class="ruby-keyword kw">else</span>
487
+ 20: <span class="ruby-keyword kw">return</span> <span class="ruby-value str">&quot;unknownhost&quot;</span>
488
+ 21: <span class="ruby-keyword kw">end</span>
489
+ 22: <span class="ruby-keyword kw">end</span></pre>
422
490
  </div>
423
491
 
424
492
  </div>
@@ -449,8 +517,8 @@ Hostname
449
517
  <div class="method-source-code"
450
518
  id="program-name-source">
451
519
  <pre>
452
- <span class="ruby-comment cmt"># File lib/rbatch.rb, line 7</span>
453
- 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>
520
+ <span class="ruby-comment cmt"># File lib/rbatch.rb, line 8</span>
521
+ 8: <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>
454
522
  </div>
455
523
 
456
524
  </div>
@@ -481,8 +549,8 @@ Hostname
481
549
  <div class="method-source-code"
482
550
  id="program-name--source">
483
551
  <pre>
484
- <span class="ruby-comment cmt"># File lib/rbatch.rb, line 6</span>
485
- 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>
552
+ <span class="ruby-comment cmt"># File lib/rbatch.rb, line 7</span>
553
+ 7: <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>
486
554
  </div>
487
555
 
488
556
  </div>
@@ -513,20 +581,20 @@ Hostname
513
581
  <div class="method-source-code"
514
582
  id="rbatch-config-source">
515
583
  <pre>
516
- <span class="ruby-comment cmt"># File lib/rbatch.rb, line 41</span>
517
- 41: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">rbatch_config</span>
518
- 42: <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">rbatch_config_path</span>)
519
- 43: <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">rbatch_config_path</span>)
520
- 44: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">yaml</span>
521
- 45: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">yaml</span>
522
- 46: <span class="ruby-keyword kw">else</span>
523
- 47: <span class="ruby-comment cmt"># If file is emply , YAML::load_file is false</span>
524
- 48: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
525
- 49: <span class="ruby-keyword kw">end</span>
526
- 50: <span class="ruby-keyword kw">else</span>
527
- 51: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
528
- 52: <span class="ruby-keyword kw">end</span>
529
- 53: <span class="ruby-keyword kw">end</span></pre>
584
+ <span class="ruby-comment cmt"># File lib/rbatch.rb, line 45</span>
585
+ 45: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">rbatch_config</span>
586
+ 46: <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">rbatch_config_path</span>)
587
+ 47: <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">rbatch_config_path</span>)
588
+ 48: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">yaml</span>
589
+ 49: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">yaml</span>
590
+ 50: <span class="ruby-keyword kw">else</span>
591
+ 51: <span class="ruby-comment cmt"># If file is emply , YAML::load_file is false</span>
592
+ 52: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
593
+ 53: <span class="ruby-keyword kw">end</span>
594
+ 54: <span class="ruby-keyword kw">else</span>
595
+ 55: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
596
+ 56: <span class="ruby-keyword kw">end</span>
597
+ 57: <span class="ruby-keyword kw">end</span></pre>
530
598
  </div>
531
599
 
532
600
  </div>
@@ -557,10 +625,10 @@ Hostname
557
625
  <div class="method-source-code"
558
626
  id="rbatch-config-path-source">
559
627
  <pre>
560
- <span class="ruby-comment cmt"># File lib/rbatch.rb, line 38</span>
561
- 38: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">rbatch_config_path</span>
562
- 39: <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">&quot;..&quot;</span>,<span class="ruby-value str">&quot;conf&quot;</span>,<span class="ruby-value str">&quot;rbatch.yaml&quot;</span>)
563
- 40: <span class="ruby-keyword kw">end</span></pre>
628
+ <span class="ruby-comment cmt"># File lib/rbatch.rb, line 42</span>
629
+ 42: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">rbatch_config_path</span>
630
+ 43: <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">@@home_dir</span>,<span class="ruby-value str">&quot;conf&quot;</span>,<span class="ruby-value str">&quot;rbatch.yaml&quot;</span>)
631
+ 44: <span class="ruby-keyword kw">end</span></pre>
564
632
  </div>
565
633
 
566
634
  </div>
@@ -593,25 +661,25 @@ tmp dir
593
661
  <div class="method-source-code"
594
662
  id="tmp-dir-source">
595
663
  <pre>
596
- <span class="ruby-comment cmt"># File lib/rbatch.rb, line 20</span>
597
- 20: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">tmp_dir</span>
598
- 21: <span class="ruby-keyword kw">case</span> <span class="ruby-constant">RUBY_PLATFORM</span>
599
- 22: <span class="ruby-keyword kw">when</span> <span class="ruby-regexp re">/mswin|mingw/</span>
600
- 23: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">ENV</span>[<span class="ruby-value str">&quot;TEMP&quot;</span>].<span class="ruby-identifier">nil?</span>
601
- 24: <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;Cannot use temporary directory, because ENV[\&quot;TEMP\&quot;] is not defined&quot;</span>
602
- 25: <span class="ruby-keyword kw">else</span>
603
- 26: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">ENV</span>[<span class="ruby-value str">&quot;TEMP&quot;</span>]
604
- 27: <span class="ruby-keyword kw">end</span>
605
- 28: <span class="ruby-keyword kw">when</span> <span class="ruby-regexp re">/cygwin|linux/</span>
606
- 29: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">ENV</span>[<span class="ruby-value str">&quot;TMPDIR&quot;</span>] <span class="ruby-operator">?</span> <span class="ruby-constant">ENV</span>[<span class="ruby-value str">&quot;TMPDIR&quot;</span>] <span class="ruby-operator">:</span> <span class="ruby-value str">&quot;/tmp&quot;</span>
607
- 30: <span class="ruby-keyword kw">else</span>
608
- 31: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">ENV</span>[<span class="ruby-value str">&quot;TMPDIR&quot;</span>].<span class="ruby-identifier">nil?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-constant">ENV</span>[<span class="ruby-value str">&quot;TEMP&quot;</span>].<span class="ruby-identifier">nil?</span>
609
- 32: <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;Unknown RUBY_PRATFORM : &quot;</span> <span class="ruby-operator">+</span> <span class="ruby-constant">RUBY_PLATFORM</span>
610
- 33: <span class="ruby-keyword kw">else</span>
611
- 34: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">ENV</span>[<span class="ruby-value str">&quot;TMPDIR&quot;</span>] <span class="ruby-operator">||</span> <span class="ruby-constant">ENV</span>[<span class="ruby-value str">&quot;TEMP&quot;</span>]
612
- 35: <span class="ruby-keyword kw">end</span>
613
- 36: <span class="ruby-keyword kw">end</span>
614
- 37: <span class="ruby-keyword kw">end</span></pre>
664
+ <span class="ruby-comment cmt"># File lib/rbatch.rb, line 24</span>
665
+ 24: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">tmp_dir</span>
666
+ 25: <span class="ruby-keyword kw">case</span> <span class="ruby-constant">RUBY_PLATFORM</span>
667
+ 26: <span class="ruby-keyword kw">when</span> <span class="ruby-regexp re">/mswin|mingw/</span>
668
+ 27: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">ENV</span>[<span class="ruby-value str">&quot;TEMP&quot;</span>].<span class="ruby-identifier">nil?</span>
669
+ 28: <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;Cannot use temporary directory, because ENV[\&quot;TEMP\&quot;] is not defined&quot;</span>
670
+ 29: <span class="ruby-keyword kw">else</span>
671
+ 30: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">ENV</span>[<span class="ruby-value str">&quot;TEMP&quot;</span>]
672
+ 31: <span class="ruby-keyword kw">end</span>
673
+ 32: <span class="ruby-keyword kw">when</span> <span class="ruby-regexp re">/cygwin|linux/</span>
674
+ 33: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">ENV</span>[<span class="ruby-value str">&quot;TMPDIR&quot;</span>] <span class="ruby-operator">?</span> <span class="ruby-constant">ENV</span>[<span class="ruby-value str">&quot;TMPDIR&quot;</span>] <span class="ruby-operator">:</span> <span class="ruby-value str">&quot;/tmp&quot;</span>
675
+ 34: <span class="ruby-keyword kw">else</span>
676
+ 35: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">ENV</span>[<span class="ruby-value str">&quot;TMPDIR&quot;</span>].<span class="ruby-identifier">nil?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-constant">ENV</span>[<span class="ruby-value str">&quot;TEMP&quot;</span>].<span class="ruby-identifier">nil?</span>
677
+ 36: <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;Unknown RUBY_PRATFORM : &quot;</span> <span class="ruby-operator">+</span> <span class="ruby-constant">RUBY_PLATFORM</span>
678
+ 37: <span class="ruby-keyword kw">else</span>
679
+ 38: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">ENV</span>[<span class="ruby-value str">&quot;TMPDIR&quot;</span>] <span class="ruby-operator">||</span> <span class="ruby-constant">ENV</span>[<span class="ruby-value str">&quot;TEMP&quot;</span>]
680
+ 39: <span class="ruby-keyword kw">end</span>
681
+ 40: <span class="ruby-keyword kw">end</span>
682
+ 41: <span class="ruby-keyword kw">end</span></pre>
615
683
  </div>
616
684
 
617
685
  </div>
@@ -154,11 +154,12 @@ in config file, raise <a
154
154
  href="CommonConfig/Exception.html">RBatch::CommonConfig::Exception</a>.
155
155
  </p>
156
156
  <p>
157
- Default common config file path is &#8220;../conf/common.yaml&#8220;
157
+ Default common config file path is
158
+ &#8220;${RB_HOME}/conf/common.yaml&#8220;
158
159
  </p>
159
160
  <h4>Sample</h4>
160
161
  <p>
161
- config : ./conf/common.yaml
162
+ config : ${RB_HOME}/conf/common.yaml
162
163
  </p>
163
164
  <pre>
164
165
  key: value
@@ -168,7 +169,7 @@ config : ./conf/common.yaml
168
169
  * item3
169
170
  </pre>
170
171
  <p>
171
- script : ./bin/sample.rb
172
+ script : ${RB_HOME}/bin/sample.rb
172
173
  </p>
173
174
  <pre>
174
175
  require 'rbatch'
@@ -212,7 +213,7 @@ script : ./bin/sample.rb
212
213
  <span class="ruby-comment cmt"># File lib/rbatch/common_config.rb, line 30</span>
213
214
  30: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>
214
215
  31: <span class="ruby-identifier">file</span> = <span class="ruby-value str">&quot;common.yaml&quot;</span>
215
- 32: <span class="ruby-identifier">dir</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<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">&quot;..&quot;</span>),<span class="ruby-value str">&quot;conf&quot;</span>)
216
+ 32: <span class="ruby-identifier">dir</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-constant">RBatch</span><span class="ruby-operator">::</span><span class="ruby-identifier">home_dir</span>,<span class="ruby-value str">&quot;conf&quot;</span>)
216
217
  33: <span class="ruby-ivar">@path</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">dir</span>,<span class="ruby-identifier">file</span>)
217
218
  34: <span class="ruby-ivar">@config</span> = <span class="ruby-constant">YAML</span><span class="ruby-operator">::</span><span class="ruby-identifier">load_file</span>(<span class="ruby-ivar">@path</span>)
218
219
  35: <span class="ruby-keyword kw">end</span></pre>
@@ -154,12 +154,12 @@ config file, raise <a
154
154
  href="Config/Exception.html">RBatch::Config::Exception</a>.
155
155
  </p>
156
156
  <p>
157
- Default config file path is &#8220;../conf/(base-name of Program
158
- file).yaml&#8220;
157
+ Default config file path is &#8220;${RB_HOME}/conf/(program base
158
+ name).yaml&#8220;
159
159
  </p>
160
160
  <h4>Sample</h4>
161
161
  <p>
162
- config : ./conf/sample2.yaml
162
+ config : ${RB_HOME}/conf/sample2.yaml
163
163
  </p>
164
164
  <pre>
165
165
  key: value
@@ -169,7 +169,7 @@ config : ./conf/sample2.yaml
169
169
  * item3
170
170
  </pre>
171
171
  <p>
172
- script : ./bin/sample2.rb
172
+ script : ${RB_HOME}/bin/sample2.rb
173
173
  </p>
174
174
  <pre>
175
175
  require 'rbatch'
@@ -214,7 +214,7 @@ script : ./bin/sample2.rb
214
214
  <span class="ruby-comment cmt"># File lib/rbatch/config.rb, line 31</span>
215
215
  31: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>
216
216
  32: <span class="ruby-identifier">file</span> = <span class="ruby-constant">Pathname</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">basename</span>(<span class="ruby-constant">RBatch</span>.<span class="ruby-identifier">program_name</span>)).<span class="ruby-identifier">sub_ext</span>(<span class="ruby-value str">&quot;.yaml&quot;</span>).<span class="ruby-identifier">to_s</span>
217
- 33: <span class="ruby-identifier">dir</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<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">&quot;..&quot;</span>),<span class="ruby-value str">&quot;conf&quot;</span>)
217
+ 33: <span class="ruby-identifier">dir</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-constant">RBatch</span><span class="ruby-operator">::</span><span class="ruby-identifier">home_dir</span>,<span class="ruby-value str">&quot;conf&quot;</span>)
218
218
  34: <span class="ruby-ivar">@path</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">dir</span>,<span class="ruby-identifier">file</span>)
219
219
  35: <span class="ruby-ivar">@config</span> = <span class="ruby-constant">YAML</span><span class="ruby-operator">::</span><span class="ruby-identifier">load_file</span>(<span class="ruby-ivar">@path</span>)
220
220
  36: <span class="ruby-keyword kw">end</span></pre>
@@ -159,7 +159,7 @@ logfile automatically.
159
159
  </p>
160
160
  <p>
161
161
  The default location of log file is
162
- &#8220;../log/YYYYMMDD_HHMMSS_${PROG_NAME}.log&#8221; .
162
+ &#8220;${RB_HOME}/log/YYYYMMDD_HHMMSS_(program base name).log&#8221; .
163
163
  </p>
164
164
  <p>
165
165
  If an exception occuerd, then <a href="../RBatch.html">RBatch</a> writes
@@ -167,7 +167,7 @@ back trace to logfile.
167
167
  </p>
168
168
  <h3>Sample</h3>
169
169
  <p>
170
- script : ./bin/sample1.rb
170
+ script : ${RB_HOME}/bin/sample1.rb
171
171
  </p>
172
172
  <pre>
173
173
  require 'rbatch'
@@ -179,7 +179,7 @@ script : ./bin/sample1.rb
179
179
  }
180
180
  </pre>
181
181
  <p>
182
- logfile : ./log/20121020_005953_sample1.log
182
+ logfile : ${RB_HOME}/log/20121020_005953_sample1.log
183
183
  </p>
184
184
  <pre>
185
185
  [2012-10-20 00:59:53 +900] [INFO ] info string
@@ -235,7 +235,8 @@ HHMMSS. &#8220;<prog>&#8221; is replaced a base-name of program file.
235
235
  </p>
236
236
  </li>
237
237
  <li><p>
238
- <tt>:dir</tt> (String) = log direcotry. Default is &#8220;../log&#8220;
238
+ <tt>:dir</tt> (String) = log direcotry. Default is
239
+ &#8220;${RB_HOME}/log&#8220;
239
240
  </p>
240
241
  </li>
241
242
  <li><p>
data/rdocs/created.rid CHANGED
@@ -1,7 +1,7 @@
1
- Sun, 01 Dec 2013 17:38:02 +0900
2
- lib/rbatch/config.rb Sun, 01 Dec 2013 17:31:01 +0900
3
- lib/rbatch/version.rb Sun, 01 Dec 2013 17:31:01 +0900
1
+ Thu, 19 Dec 2013 01:48:51 +0900
2
+ lib/rbatch/config.rb Thu, 19 Dec 2013 01:48:36 +0900
3
+ lib/rbatch/version.rb Thu, 19 Dec 2013 01:48:36 +0900
4
4
  lib/rbatch/cmd.rb Sun, 01 Dec 2013 17:31:01 +0900
5
- lib/rbatch/common_config.rb Sun, 01 Dec 2013 17:31:01 +0900
6
- lib/rbatch/log.rb Sun, 01 Dec 2013 17:31:01 +0900
7
- lib/rbatch.rb Fri, 15 Nov 2013 15:13:43 +0900
5
+ lib/rbatch/common_config.rb Thu, 19 Dec 2013 01:48:36 +0900
6
+ lib/rbatch/log.rb Thu, 19 Dec 2013 01:48:36 +0900
7
+ lib/rbatch.rb Thu, 19 Dec 2013 01:48:36 +0900
data/rdocs/index.html CHANGED
@@ -58,13 +58,13 @@
58
58
 
59
59
  <li><a href="RBatch/Config.html#method-c-new">::new &mdash; RBatch::Config</a></li>
60
60
 
61
- <li><a href="RBatch/Log.html#method-c-new">::new &mdash; RBatch::Log</a></li>
61
+ <li><a href="RBatch/Cmd.html#method-c-new">::new &mdash; RBatch::Cmd</a></li>
62
62
 
63
63
  <li><a href="RBatch/CommonConfig.html#method-c-new">::new &mdash; RBatch::CommonConfig</a></li>
64
64
 
65
65
  <li><a href="RBatch/CmdResult.html#method-c-new">::new &mdash; RBatch::CmdResult</a></li>
66
66
 
67
- <li><a href="RBatch/Cmd.html#method-c-new">::new &mdash; RBatch::Cmd</a></li>
67
+ <li><a href="RBatch/Log.html#method-c-new">::new &mdash; RBatch::Log</a></li>
68
68
 
69
69
  <li><a href="RBatch/Log.html#method-c-verbose">::verbose &mdash; RBatch::Log</a></li>
70
70
 
@@ -96,6 +96,10 @@
96
96
 
97
97
  <li><a href="RBatch/Log.html#method-i-fatal">#fatal &mdash; RBatch::Log</a></li>
98
98
 
99
+ <li><a href="RBatch.html#method-i-home_dir">#home_dir &mdash; RBatch</a></li>
100
+
101
+ <li><a href="RBatch.html#method-i-home_dir%3D">#home_dir= &mdash; RBatch</a></li>
102
+
99
103
  <li><a href="RBatch.html#method-i-hostname">#hostname &mdash; RBatch</a></li>
100
104
 
101
105
  <li><a href="RBatch/Log.html#method-i-info">#info &mdash; RBatch::Log</a></li>
@@ -132,12 +136,12 @@
132
136
 
133
137
  <li><a href="RBatch/CmdResult.html#method-i-to_h">#to_h &mdash; RBatch::CmdResult</a></li>
134
138
 
135
- <li><a href="RBatch/Config.html#method-i-to_s">#to_s &mdash; RBatch::Config</a></li>
136
-
137
139
  <li><a href="RBatch/CmdResult.html#method-i-to_s">#to_s &mdash; RBatch::CmdResult</a></li>
138
140
 
139
141
  <li><a href="RBatch/CommonConfig.html#method-i-to_s">#to_s &mdash; RBatch::CommonConfig</a></li>
140
142
 
143
+ <li><a href="RBatch/Config.html#method-i-to_s">#to_s &mdash; RBatch::Config</a></li>
144
+
141
145
  <li><a href="RBatch/Log.html#method-i-warn">#warn &mdash; RBatch::Log</a></li>
142
146
 
143
147
  </ul>
@@ -24,7 +24,7 @@
24
24
  <div id="metadata">
25
25
  <dl>
26
26
  <dt class="modified-date">Last Modified</dt>
27
- <dd class="modified-date">2013-12-01 17:31:01 +0900</dd>
27
+ <dd class="modified-date">2013-12-19 01:48:36 +0900</dd>
28
28
 
29
29
 
30
30
  <dt class="requires">Requires</dt>
@@ -24,7 +24,7 @@
24
24
  <div id="metadata">
25
25
  <dl>
26
26
  <dt class="modified-date">Last Modified</dt>
27
- <dd class="modified-date">2013-12-01 17:31:01 +0900</dd>
27
+ <dd class="modified-date">2013-12-19 01:48:36 +0900</dd>
28
28
 
29
29
 
30
30
  <dt class="requires">Requires</dt>
@@ -24,7 +24,7 @@
24
24
  <div id="metadata">
25
25
  <dl>
26
26
  <dt class="modified-date">Last Modified</dt>
27
- <dd class="modified-date">2013-12-01 17:31:01 +0900</dd>
27
+ <dd class="modified-date">2013-12-19 01:48:36 +0900</dd>
28
28
 
29
29
 
30
30
  <dt class="requires">Requires</dt>
@@ -24,7 +24,7 @@
24
24
  <div id="metadata">
25
25
  <dl>
26
26
  <dt class="modified-date">Last Modified</dt>
27
- <dd class="modified-date">2013-12-01 17:31:01 +0900</dd>
27
+ <dd class="modified-date">2013-12-19 01:48:36 +0900</dd>
28
28
 
29
29
 
30
30
  <dt class="requires">Requires</dt>
@@ -24,7 +24,7 @@
24
24
  <div id="metadata">
25
25
  <dl>
26
26
  <dt class="modified-date">Last Modified</dt>
27
- <dd class="modified-date">2013-11-15 15:13:43 +0900</dd>
27
+ <dd class="modified-date">2013-12-19 01:48:36 +0900</dd>
28
28
 
29
29
 
30
30
  <dt class="requires">Requires</dt>
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: rbatch
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.12.3
5
+ version: 1.13.0
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: 2013-12-01 00:00:00 Z
13
+ date: 2013-12-18 00:00:00 Z
14
14
  dependencies: []
15
15
 
16
16
  description: RBatch has many fanctions to help with your making a batch script such as "data backup script" or "proccess starting script".