rbatch 1.4.3 → 1.5.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 +5 -5
- data/README.md +6 -6
- data/Rakefile +1 -1
- data/lib/rbatch/config.rb +1 -1
- data/lib/rbatch.rb +1 -1
- metadata +2 -2
data/README.ja.md
CHANGED
@@ -52,11 +52,11 @@ test.rb:3:in `<main>'
|
|
52
52
|
### 自動設定ファイル読み込み
|
53
53
|
|
54
54
|
RBatchは簡単にデフォルトの位置の設定ファイルを読み込めます。
|
55
|
-
デフォルトの位置は"
|
55
|
+
デフォルトの位置は"(スクリプトのパス)/../conf/${PROG_NAME}.yaml"です。
|
56
56
|
|
57
57
|
サンプル
|
58
58
|
|
59
|
-
設定ファイル : ./
|
59
|
+
設定ファイル : ./conf/sample2.yaml
|
60
60
|
```
|
61
61
|
key: value
|
62
62
|
array:
|
@@ -103,7 +103,7 @@ RBatchでは、「設定より規約」(convention over configuration)という
|
|
103
103
|
|-bin
|
104
104
|
| |- hoge.rb
|
105
105
|
| |- bar.rb
|
106
|
-
|-
|
106
|
+
|-conf
|
107
107
|
| |- hoge.yaml
|
108
108
|
| |- bar.yaml
|
109
109
|
|-log
|
@@ -126,7 +126,7 @@ RBatchの共通設定ファイルに"forbid_double_run: true"の設定を書け
|
|
126
126
|
### ステップ2: ディレクトリ作成
|
127
127
|
|
128
128
|
```
|
129
|
-
$ mkdir bin log
|
129
|
+
$ mkdir bin log conf
|
130
130
|
```
|
131
131
|
|
132
132
|
### ステップ3: バッチスクリプト作成
|
@@ -171,7 +171,7 @@ E, [2012-10-20T00:19:23.424882 #2357] ERROR -- : backup failed
|
|
171
171
|
以下の場所にRBatch全体設定ファイルを配置すると、全てのスクリプトにてオプションが適用される。
|
172
172
|
|
173
173
|
```
|
174
|
-
(スクリプトのパス)/../
|
174
|
+
(スクリプトのパス)/../conf/rbatch.yaml
|
175
175
|
```
|
176
176
|
|
177
177
|
設定ファイルのサンプルは以下の通り
|
data/README.md
CHANGED
@@ -19,7 +19,7 @@ This work on only Ruby 1.9.x or more later.
|
|
19
19
|
|
20
20
|
### Auto Logging
|
21
21
|
Use Auto Logging block, RBatch automatically write to logfile.
|
22
|
-
Log file default location is "
|
22
|
+
Log file default location is "(script file path)/../log/YYYYMMDD_HHMMSS_${PROG_NAME}.log" .
|
23
23
|
If exception occuerd, then RBatch write stack trace to logfile.
|
24
24
|
|
25
25
|
sample
|
@@ -50,11 +50,11 @@ test.rb:3:in `<main>'
|
|
50
50
|
|
51
51
|
### Auto Config Reading
|
52
52
|
|
53
|
-
RBatch easy to read config file (located on "
|
53
|
+
RBatch easy to read config file (located on "(script file path)/../conf/${PROG_NAME}.yaml")
|
54
54
|
|
55
55
|
sample
|
56
56
|
|
57
|
-
config : ./
|
57
|
+
config : ./conf/sample2.yaml
|
58
58
|
```
|
59
59
|
key: value
|
60
60
|
array:
|
@@ -100,7 +100,7 @@ In this way, maintainability and readability of batch script get higher.
|
|
100
100
|
|-bin
|
101
101
|
| |- hoge.rb
|
102
102
|
| |- bar.rb
|
103
|
-
|-
|
103
|
+
|-conf
|
104
104
|
| |- hoge.yaml
|
105
105
|
| |- bar.yaml
|
106
106
|
|-log
|
@@ -123,7 +123,7 @@ Quick Start
|
|
123
123
|
### Step2: Make directories
|
124
124
|
|
125
125
|
```
|
126
|
-
$ mkdir bin log
|
126
|
+
$ mkdir bin log conf
|
127
127
|
```
|
128
128
|
|
129
129
|
### Step3: Write batch script
|
@@ -168,7 +168,7 @@ Manual
|
|
168
168
|
If you make follow config file, option value effect to all scripts.
|
169
169
|
|
170
170
|
```
|
171
|
-
(script file path)/../
|
171
|
+
(script file path)/../conf/rbatch.yaml
|
172
172
|
```
|
173
173
|
|
174
174
|
Config Sample
|
data/Rakefile
CHANGED
data/lib/rbatch/config.rb
CHANGED
@@ -21,7 +21,7 @@ module RBatch
|
|
21
21
|
# => {"key" => "value", "array" => ["item1", "item2", "item3"]}
|
22
22
|
def config
|
23
23
|
file = Pathname(File.basename(RBatch.program_name)).sub_ext(".yaml").to_s
|
24
|
-
dir = File.join(File.join(File.dirname(RBatch.program_name),".."),"
|
24
|
+
dir = File.join(File.join(File.dirname(RBatch.program_name),".."),"conf")
|
25
25
|
return YAML::load_file(File.join(dir,file))
|
26
26
|
end
|
27
27
|
|
data/lib/rbatch.rb
CHANGED
@@ -16,7 +16,7 @@ module RBatch
|
|
16
16
|
end
|
17
17
|
end
|
18
18
|
def common_config_path
|
19
|
-
File.join(File.dirname(RBatch.program_name),"..","
|
19
|
+
File.join(File.dirname(RBatch.program_name),"..","conf","rbatch.yaml")
|
20
20
|
end
|
21
21
|
def common_config
|
22
22
|
if File.exist?(RBatch.common_config_path)
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: rbatch
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 1.
|
5
|
+
version: 1.5.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-01-
|
13
|
+
date: 2013-01-11 00:00:00 Z
|
14
14
|
dependencies: []
|
15
15
|
|
16
16
|
description: ""
|