rbatch 1.13.1 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (78) hide show
  1. data/CHANGELOG +15 -0
  2. data/README.ja.md +81 -49
  3. data/README.md +88 -63
  4. data/Rakefile +2 -31
  5. data/bin/rbatch-init +57 -32
  6. data/{rdocs → doc}/RBatch/Cmd.html +66 -59
  7. data/{rdocs → doc}/RBatch/CmdException.html +9 -3
  8. data/{rdocs → doc}/RBatch/CmdResult.html +40 -34
  9. data/{rdocs → doc}/RBatch/CommonConfig/Exception.html +9 -3
  10. data/{rdocs → doc}/RBatch/CommonConfig.html +22 -17
  11. data/{rdocs → doc}/RBatch/Config/Exception.html +9 -3
  12. data/{rdocs → doc}/RBatch/Config.html +21 -16
  13. data/{rdocs/RBatchException.html → doc/RBatch/DoubleRunCheckException.html} +33 -30
  14. data/doc/RBatch/DoubleRunChecker.html +277 -0
  15. data/{rdocs → doc}/RBatch/Log.html +134 -138
  16. data/doc/RBatch/RunConf/Exception.html +159 -0
  17. data/doc/RBatch/RunConf.html +557 -0
  18. data/doc/RBatch.html +655 -0
  19. data/doc/created.rid +9 -0
  20. data/{rdocs → doc}/index.html +46 -20
  21. data/{rdocs → doc}/lib/rbatch/cmd_rb.html +4 -2
  22. data/{rdocs → doc}/lib/rbatch/common_config_rb.html +2 -2
  23. data/{rdocs → doc}/lib/rbatch/config_rb.html +2 -2
  24. data/doc/lib/rbatch/double_run_checker_rb.html +56 -0
  25. data/{rdocs → doc}/lib/rbatch/log_rb.html +2 -2
  26. data/doc/lib/rbatch/run_conf_rb.html +56 -0
  27. data/{rdocs → doc}/lib/rbatch/version_rb.html +2 -2
  28. data/{rdocs → doc}/lib/rbatch_rb.html +7 -3
  29. data/lib/rbatch/cmd.rb +20 -23
  30. data/lib/rbatch/common_config.rb +2 -3
  31. data/lib/rbatch/config.rb +1 -2
  32. data/lib/rbatch/double_run_checker.rb +24 -0
  33. data/lib/rbatch/log.rb +37 -59
  34. data/lib/rbatch/run_conf.rb +109 -0
  35. data/lib/rbatch/version.rb +1 -1
  36. data/lib/rbatch.rb +37 -56
  37. data/spec/{cmd_test.spec → cmd_spec.rb} +6 -6
  38. data/spec/common_config_spec.rb +54 -0
  39. data/spec/{config_test.spec → config_spec.rb} +2 -1
  40. data/spec/double_run_checker_spec.rb +10 -0
  41. data/spec/{log_test.spec → log_spec.rb} +22 -22
  42. data/spec/rbatch_spec.rb +24 -0
  43. data/spec/run_conf_spec.rb +85 -0
  44. metadata +66 -65
  45. data/rdocs/RBatch.html +0 -713
  46. data/rdocs/created.rid +0 -7
  47. data/spec/rbatch_test.spec +0 -25
  48. data/test/cases/test_cmd.rb +0 -134
  49. data/test/cases/test_common_config.rb +0 -41
  50. data/test/cases/test_config.rb +0 -41
  51. data/test/cases/test_log.rb +0 -613
  52. data/test/mocks/PrintArgs.exe +0 -0
  53. data/test/mocks/win_cmd.exe +0 -0
  54. /data/{rdocs → doc}/images/brick.png +0 -0
  55. /data/{rdocs → doc}/images/brick_link.png +0 -0
  56. /data/{rdocs → doc}/images/bug.png +0 -0
  57. /data/{rdocs → doc}/images/bullet_black.png +0 -0
  58. /data/{rdocs → doc}/images/bullet_toggle_minus.png +0 -0
  59. /data/{rdocs → doc}/images/bullet_toggle_plus.png +0 -0
  60. /data/{rdocs → doc}/images/date.png +0 -0
  61. /data/{rdocs → doc}/images/find.png +0 -0
  62. /data/{rdocs → doc}/images/loadingAnimation.gif +0 -0
  63. /data/{rdocs → doc}/images/macFFBgHack.png +0 -0
  64. /data/{rdocs → doc}/images/package.png +0 -0
  65. /data/{rdocs → doc}/images/page_green.png +0 -0
  66. /data/{rdocs → doc}/images/page_white_text.png +0 -0
  67. /data/{rdocs → doc}/images/page_white_width.png +0 -0
  68. /data/{rdocs → doc}/images/plugin.png +0 -0
  69. /data/{rdocs → doc}/images/ruby.png +0 -0
  70. /data/{rdocs → doc}/images/tag_green.png +0 -0
  71. /data/{rdocs → doc}/images/wrench.png +0 -0
  72. /data/{rdocs → doc}/images/wrench_orange.png +0 -0
  73. /data/{rdocs → doc}/images/zoom.png +0 -0
  74. /data/{rdocs → doc}/js/darkfish.js +0 -0
  75. /data/{rdocs → doc}/js/jquery.js +0 -0
  76. /data/{rdocs → doc}/js/quicksearch.js +0 -0
  77. /data/{rdocs → doc}/js/thickbox-compressed.js +0 -0
  78. /data/{rdocs → doc}/rdoc.css +0 -0
@@ -0,0 +1,24 @@
1
+ require 'tmpdir'
2
+
3
+ describe "RBatch" do
4
+ before :all do
5
+ end
6
+
7
+ before :each do
8
+ end
9
+
10
+ after :each do
11
+ end
12
+
13
+ after :all do
14
+ end
15
+
16
+ it "RB_HOME should be home_dir" do
17
+ @dir = Dir.tmpdir
18
+ ENV["RB_HOME"]=@dir
19
+ require 'rbatch'
20
+ expect(RBatch.home_dir).to eq @dir
21
+ end
22
+
23
+
24
+ end
@@ -0,0 +1,85 @@
1
+ require 'tmpdir'
2
+ require 'rbatch/run_conf'
3
+
4
+ describe RBatch::RunConf do
5
+ before :all do
6
+ @home = Dir.tmpdir
7
+ @config = File.join(@home,"run_conf_test.yaml")
8
+ end
9
+
10
+ before :each do
11
+ FileUtils.rm @config if File.exists? @config
12
+ open( @config , "w" ){|f| f.write("")}
13
+ @rc = RBatch::RunConf.new(@config,@home)
14
+ end
15
+
16
+ after :each do
17
+ end
18
+
19
+ after :all do
20
+ end
21
+
22
+ it "is default when run_conf is empty" do
23
+ expect(@rc[:log_level]).to eq "info"
24
+ end
25
+
26
+ it "is default when run_conf does not exist" do
27
+ FileUtils.rm @config
28
+ tmp = RBatch::RunConf.new(@config,@home)
29
+ expect(tmp[:log_level]).to eq "info"
30
+ end
31
+
32
+ it "raise when key does not exist" do
33
+ expect{@rc[:not_exist_key]}.to raise_error(RBatch::RunConf::Exception)
34
+ end
35
+
36
+ it "read run conf" do
37
+ open( @config , "w" ){|f| f.write("log_level: hoge")}
38
+ tmp = RBatch::RunConf.new(@config,@home)
39
+ expect(tmp[:log_level]).to eq "hoge"
40
+ end
41
+
42
+ it "raise when run_conf has unreserved key" do
43
+ open( @config , "w" ){|f| f.write("unreserved: hoge")}
44
+ expect{tmp = RBatch::RunConf.new(@config,@home)}.to raise_error(RBatch::RunConf::Exception)
45
+ end
46
+
47
+ describe "[]= method" do
48
+ it "success" do
49
+ expect(@rc[:log_level]).to eq "info"
50
+ @rc[:log_level] = "hoge"
51
+ expect(@rc[:log_level]).to eq "hoge"
52
+ end
53
+
54
+ it "raise when set unreserved key" do
55
+ expect{@rc[:unreservied] = "hoge"}.to raise_error(RBatch::RunConf::Exception)
56
+ end
57
+ end
58
+
59
+ describe "merge! method" do
60
+ it "success" do
61
+ opt={ :log_level => "error"}
62
+ @rc.merge!(opt)
63
+ expect(@rc[:log_level]).to eq "error"
64
+ end
65
+
66
+ it "raise when key does not exist" do
67
+ opt={ :unreserved => "error"}
68
+ expect{@rc.merge!(opt)}.to raise_error(RBatch::RunConf::Exception)
69
+ end
70
+ end
71
+
72
+ describe "merge method" do
73
+ it "success" do
74
+ opt={ :log_level => "error"}
75
+ tmp = @rc.merge(opt)
76
+ expect(@rc[:log_level]).to eq "info"
77
+ expect(tmp[:log_level]).to eq "error"
78
+ end
79
+
80
+ it "raise when key does not exist" do
81
+ opt={ :unreserved => "error"}
82
+ expect{@rc.merge(opt)}.to raise_error(RBatch::RunConf::Exception)
83
+ end
84
+ end
85
+ end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: rbatch
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.13.1
5
+ version: 2.0.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-20 00:00:00 Z
13
+ date: 2013-12-28 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".
@@ -31,56 +31,63 @@ files:
31
31
  - README.md
32
32
  - Rakefile
33
33
  - bin/rbatch-init
34
+ - doc/RBatch.html
35
+ - doc/RBatch/Cmd.html
36
+ - doc/RBatch/CmdException.html
37
+ - doc/RBatch/CmdResult.html
38
+ - doc/RBatch/CommonConfig.html
39
+ - doc/RBatch/CommonConfig/Exception.html
40
+ - doc/RBatch/Config.html
41
+ - doc/RBatch/Config/Exception.html
42
+ - doc/RBatch/DoubleRunCheckException.html
43
+ - doc/RBatch/DoubleRunChecker.html
44
+ - doc/RBatch/Log.html
45
+ - doc/RBatch/RunConf.html
46
+ - doc/RBatch/RunConf/Exception.html
47
+ - doc/created.rid
48
+ - doc/images/brick.png
49
+ - doc/images/brick_link.png
50
+ - doc/images/bug.png
51
+ - doc/images/bullet_black.png
52
+ - doc/images/bullet_toggle_minus.png
53
+ - doc/images/bullet_toggle_plus.png
54
+ - doc/images/date.png
55
+ - doc/images/find.png
56
+ - doc/images/loadingAnimation.gif
57
+ - doc/images/macFFBgHack.png
58
+ - doc/images/package.png
59
+ - doc/images/page_green.png
60
+ - doc/images/page_white_text.png
61
+ - doc/images/page_white_width.png
62
+ - doc/images/plugin.png
63
+ - doc/images/ruby.png
64
+ - doc/images/tag_green.png
65
+ - doc/images/wrench.png
66
+ - doc/images/wrench_orange.png
67
+ - doc/images/zoom.png
68
+ - doc/index.html
69
+ - doc/js/darkfish.js
70
+ - doc/js/jquery.js
71
+ - doc/js/quicksearch.js
72
+ - doc/js/thickbox-compressed.js
73
+ - doc/lib/rbatch/cmd_rb.html
74
+ - doc/lib/rbatch/common_config_rb.html
75
+ - doc/lib/rbatch/config_rb.html
76
+ - doc/lib/rbatch/double_run_checker_rb.html
77
+ - doc/lib/rbatch/log_rb.html
78
+ - doc/lib/rbatch/run_conf_rb.html
79
+ - doc/lib/rbatch/version_rb.html
80
+ - doc/lib/rbatch_rb.html
81
+ - doc/rdoc.css
34
82
  - lib/rbatch.rb
35
83
  - lib/rbatch/cmd.rb
36
84
  - lib/rbatch/common_config.rb
37
85
  - lib/rbatch/config.rb
86
+ - lib/rbatch/double_run_checker.rb
38
87
  - lib/rbatch/log.rb
88
+ - lib/rbatch/run_conf.rb
39
89
  - lib/rbatch/version.rb
40
90
  - rbatch.gemspec
41
- - rdocs/RBatch.html
42
- - rdocs/RBatch/Cmd.html
43
- - rdocs/RBatch/CmdException.html
44
- - rdocs/RBatch/CmdResult.html
45
- - rdocs/RBatch/CommonConfig.html
46
- - rdocs/RBatch/CommonConfig/Exception.html
47
- - rdocs/RBatch/Config.html
48
- - rdocs/RBatch/Config/Exception.html
49
- - rdocs/RBatch/Log.html
50
- - rdocs/RBatchException.html
51
- - rdocs/created.rid
52
- - rdocs/images/brick.png
53
- - rdocs/images/brick_link.png
54
- - rdocs/images/bug.png
55
- - rdocs/images/bullet_black.png
56
- - rdocs/images/bullet_toggle_minus.png
57
- - rdocs/images/bullet_toggle_plus.png
58
- - rdocs/images/date.png
59
- - rdocs/images/find.png
60
- - rdocs/images/loadingAnimation.gif
61
- - rdocs/images/macFFBgHack.png
62
- - rdocs/images/package.png
63
- - rdocs/images/page_green.png
64
- - rdocs/images/page_white_text.png
65
- - rdocs/images/page_white_width.png
66
- - rdocs/images/plugin.png
67
- - rdocs/images/ruby.png
68
- - rdocs/images/tag_green.png
69
- - rdocs/images/wrench.png
70
- - rdocs/images/wrench_orange.png
71
- - rdocs/images/zoom.png
72
- - rdocs/index.html
73
- - rdocs/js/darkfish.js
74
- - rdocs/js/jquery.js
75
- - rdocs/js/quicksearch.js
76
- - rdocs/js/thickbox-compressed.js
77
- - rdocs/lib/rbatch/cmd_rb.html
78
- - rdocs/lib/rbatch/common_config_rb.html
79
- - rdocs/lib/rbatch/config_rb.html
80
- - rdocs/lib/rbatch/log_rb.html
81
- - rdocs/lib/rbatch/version_rb.html
82
- - rdocs/lib/rbatch_rb.html
83
- - rdocs/rdoc.css
84
91
  - sample/bin/apache_log_insert.rb
85
92
  - sample/bin/file_batch_copy.rb
86
93
  - sample/bin/log_backup.rb
@@ -105,16 +112,13 @@ files:
105
112
  - sample/data/amAuthentication.error.1
106
113
  - sample/data/amAuthentication.error.2012-07-10
107
114
  - sample/log/empty
108
- - spec/cmd_test.spec
109
- - spec/config_test.spec
110
- - spec/log_test.spec
111
- - spec/rbatch_test.spec
112
- - test/cases/test_cmd.rb
113
- - test/cases/test_common_config.rb
114
- - test/cases/test_config.rb
115
- - test/cases/test_log.rb
116
- - test/mocks/PrintArgs.exe
117
- - test/mocks/win_cmd.exe
115
+ - spec/cmd_spec.rb
116
+ - spec/common_config_spec.rb
117
+ - spec/config_spec.rb
118
+ - spec/double_run_checker_spec.rb
119
+ - spec/log_spec.rb
120
+ - spec/rbatch_spec.rb
121
+ - spec/run_conf_spec.rb
118
122
  homepage: https://github.com/fetaro/rbatch
119
123
  licenses:
120
124
  - MIT
@@ -143,13 +147,10 @@ signing_key:
143
147
  specification_version: 3
144
148
  summary: Ruby-based simple batch framework
145
149
  test_files:
146
- - spec/cmd_test.spec
147
- - spec/config_test.spec
148
- - spec/log_test.spec
149
- - spec/rbatch_test.spec
150
- - test/cases/test_cmd.rb
151
- - test/cases/test_common_config.rb
152
- - test/cases/test_config.rb
153
- - test/cases/test_log.rb
154
- - test/mocks/PrintArgs.exe
155
- - test/mocks/win_cmd.exe
150
+ - spec/cmd_spec.rb
151
+ - spec/common_config_spec.rb
152
+ - spec/config_spec.rb
153
+ - spec/double_run_checker_spec.rb
154
+ - spec/log_spec.rb
155
+ - spec/rbatch_spec.rb
156
+ - spec/run_conf_spec.rb