batch_manager 0.3.5 → 0.3.6

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [![Build Status](https://travis-ci.org/cctiger36/batch_manager.png?branch=master)](https://travis-ci.org/cctiger36/batch_manager) [![Gem Version](https://badge.fury.io/rb/batch_manager.png)](http://badge.fury.io/rb/batch_manager) [![Coverage Status](https://coveralls.io/repos/cctiger36/batch_manager/badge.png?branch=master)](https://coveralls.io/r/cctiger36/batch_manager?branch=master) [![Code Climate](https://codeclimate.com/github/cctiger36/batch_manager.png)](https://codeclimate.com/github/cctiger36/batch_manager)
4
4
 
5
- A rails plugin to manage batch scripts similar to migrations.
5
+ A rails plugin to manage batch scripts. Provide web interface to create, edit and execute batch scripts simply. Automatically save the log to file.
6
6
 
7
7
  ## Installation
8
8
 
@@ -35,7 +35,9 @@ You can change the default configuration in config/application.rb
35
35
 
36
36
  This will generate the file 'test.rb' in the configured batch_dir with default template.
37
37
 
38
- You can find the template in lib/generators/batch/templates, and modify it for yourself.
38
+ ### Custom Template
39
+
40
+ You can simply override the default template by making a template file with the name 'batch.rb' inside lib/templates/rails/batch.
39
41
 
40
42
  ## Batch Header
41
43
 
@@ -44,7 +46,6 @@ The generated batch files will have the header like:
44
46
  # =Batch Manager=
45
47
  # =created_at: 2013-05-24 13:10:25
46
48
  # =times_limit: 1
47
- # =group_name: GroupName
48
49
 
49
50
  Add the "=Batch Manager=" to tell BatchManager to manage this batch file.
50
51
 
@@ -82,7 +83,7 @@ You can also use web interface to execute batches.
82
83
 
83
84
  If [resque](https://github.com/resque/resque) installed in you application and the resque worker started, the batch script can be executed asynchronous through the worker. And the log can be checked on real time in the brower. Otherwise the batch script will be executed synchronous.
84
85
 
85
- The QUEUE's name will be **"batch_manager".**
86
+ The QUEUE's name will be *"batch_manager".*
86
87
 
87
88
  ### Screenshot
88
89
 
data/bin/bm_exec CHANGED
@@ -8,7 +8,7 @@ require 'batch_manager'
8
8
  options = {}
9
9
  batch_file = nil
10
10
  ARGV.clone.options do |opts|
11
- opts.banner = "Usage: batch [options] file_name"
11
+ opts.banner = "Usage: batch [options] BATCH_FILE"
12
12
  opts.on("-f", "--force", "Force to run") { options[:force] = true }
13
13
  opts.on("-w", "--wet", "Wet run") { options[:wet] = true }
14
14
  opts.order! { |o| batch_file ||= o } rescue retry
@@ -1,3 +1,3 @@
1
1
  module BatchManager
2
- VERSION = "0.3.5"
2
+ VERSION = "0.3.6"
3
3
  end
@@ -12,7 +12,7 @@ module Rails
12
12
  end
13
13
 
14
14
  def self.source_root
15
- File.join(File.dirname(__FILE__), 'templates', (orm.to_s unless orm.class.eql?(String)) )
15
+ File.join(File.dirname(__FILE__), 'templates', (orm.to_s unless orm.class.eql?(String)))
16
16
  end
17
17
 
18
18
  def create_batch_file
@@ -5,16 +5,14 @@
5
5
 
6
6
  wet_run = (ARGV[0] == "wet" || @wet)
7
7
 
8
- ActiveRecord::Base.connection.with_standby do
8
+ ActiveRecord::Base.transaction do
9
9
 
10
- ActiveRecord::Base.transaction do
10
+ # Code at here will rollback when dry run.
11
11
 
12
- if wet_run
13
- BatchManager.logger.info "Wet run completed!"
14
- else
15
- BatchManager.logger.warn "Rolling back."
16
- raise ActiveRecord::Rollback
17
- end
12
+ if wet_run
13
+ BatchManager.logger.info "Wet run completed!"
14
+ else
15
+ BatchManager.logger.warn "Rolling back."
16
+ raise ActiveRecord::Rollback
18
17
  end
19
-
20
18
  end
metadata CHANGED
@@ -1,18 +1,20 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: batch_manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.5
4
+ version: 0.3.6
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - Weihu Chen
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2013-06-20 00:00:00.000000000 Z
12
+ date: 2013-06-22 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: rails
15
16
  requirement: !ruby/object:Gem::Requirement
17
+ none: false
16
18
  requirements:
17
19
  - - ! '>='
18
20
  - !ruby/object:Gem::Version
@@ -20,6 +22,7 @@ dependencies:
20
22
  type: :runtime
21
23
  prerelease: false
22
24
  version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
23
26
  requirements:
24
27
  - - ! '>='
25
28
  - !ruby/object:Gem::Version
@@ -27,6 +30,7 @@ dependencies:
27
30
  - !ruby/object:Gem::Dependency
28
31
  name: log4r
29
32
  requirement: !ruby/object:Gem::Requirement
33
+ none: false
30
34
  requirements:
31
35
  - - ! '>='
32
36
  - !ruby/object:Gem::Version
@@ -34,6 +38,7 @@ dependencies:
34
38
  type: :runtime
35
39
  prerelease: false
36
40
  version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
37
42
  requirements:
38
43
  - - ! '>='
39
44
  - !ruby/object:Gem::Version
@@ -41,6 +46,7 @@ dependencies:
41
46
  - !ruby/object:Gem::Dependency
42
47
  name: sqlite3
43
48
  requirement: !ruby/object:Gem::Requirement
49
+ none: false
44
50
  requirements:
45
51
  - - ! '>='
46
52
  - !ruby/object:Gem::Version
@@ -48,6 +54,7 @@ dependencies:
48
54
  type: :development
49
55
  prerelease: false
50
56
  version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
51
58
  requirements:
52
59
  - - ! '>='
53
60
  - !ruby/object:Gem::Version
@@ -55,6 +62,7 @@ dependencies:
55
62
  - !ruby/object:Gem::Dependency
56
63
  name: rspec-rails
57
64
  requirement: !ruby/object:Gem::Requirement
65
+ none: false
58
66
  requirements:
59
67
  - - ! '>='
60
68
  - !ruby/object:Gem::Version
@@ -62,6 +70,7 @@ dependencies:
62
70
  type: :development
63
71
  prerelease: false
64
72
  version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
65
74
  requirements:
66
75
  - - ! '>='
67
76
  - !ruby/object:Gem::Version
@@ -69,6 +78,7 @@ dependencies:
69
78
  - !ruby/object:Gem::Dependency
70
79
  name: factory_girl_rails
71
80
  requirement: !ruby/object:Gem::Requirement
81
+ none: false
72
82
  requirements:
73
83
  - - ! '>='
74
84
  - !ruby/object:Gem::Version
@@ -76,6 +86,7 @@ dependencies:
76
86
  type: :development
77
87
  prerelease: false
78
88
  version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
79
90
  requirements:
80
91
  - - ! '>='
81
92
  - !ruby/object:Gem::Version
@@ -83,6 +94,7 @@ dependencies:
83
94
  - !ruby/object:Gem::Dependency
84
95
  name: ammeter
85
96
  requirement: !ruby/object:Gem::Requirement
97
+ none: false
86
98
  requirements:
87
99
  - - ! '>='
88
100
  - !ruby/object:Gem::Version
@@ -90,6 +102,7 @@ dependencies:
90
102
  type: :development
91
103
  prerelease: false
92
104
  version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
93
106
  requirements:
94
107
  - - ! '>='
95
108
  - !ruby/object:Gem::Version
@@ -97,6 +110,7 @@ dependencies:
97
110
  - !ruby/object:Gem::Dependency
98
111
  name: resque
99
112
  requirement: !ruby/object:Gem::Requirement
113
+ none: false
100
114
  requirements:
101
115
  - - ! '>='
102
116
  - !ruby/object:Gem::Version
@@ -104,12 +118,13 @@ dependencies:
104
118
  type: :development
105
119
  prerelease: false
106
120
  version_requirements: !ruby/object:Gem::Requirement
121
+ none: false
107
122
  requirements:
108
123
  - - ! '>='
109
124
  - !ruby/object:Gem::Version
110
125
  version: '0'
111
- description: Manage batches status. Support execute batches from web interface. Automatically
112
- save the log to file.
126
+ description: A rails plugin to manage batch scripts. Provide web interface to create,
127
+ edit and execute batch scripts simply. Automatically save the log to file.
113
128
  email:
114
129
  - cctiger36@gmail.com
115
130
  executables:
@@ -159,25 +174,26 @@ files:
159
174
  homepage: https://github.com/cctiger36/batch_manager
160
175
  licenses:
161
176
  - MIT
162
- metadata: {}
163
177
  post_install_message:
164
178
  rdoc_options: []
165
179
  require_paths:
166
180
  - lib
167
181
  required_ruby_version: !ruby/object:Gem::Requirement
182
+ none: false
168
183
  requirements:
169
184
  - - ! '>='
170
185
  - !ruby/object:Gem::Version
171
186
  version: '0'
172
187
  required_rubygems_version: !ruby/object:Gem::Requirement
188
+ none: false
173
189
  requirements:
174
190
  - - ! '>='
175
191
  - !ruby/object:Gem::Version
176
192
  version: '0'
177
193
  requirements: []
178
194
  rubyforge_project:
179
- rubygems_version: 2.0.3
195
+ rubygems_version: 1.8.24
180
196
  signing_key:
181
- specification_version: 4
182
- summary: A rails plugin to manage batch scripts similar to migrations.
197
+ specification_version: 3
198
+ summary: A rails plugin to manage batch scripts.
183
199
  test_files: []
checksums.yaml DELETED
@@ -1,15 +0,0 @@
1
- ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- MTI3MjI5YjViOWRmNzA2YjZlMDU5MWZiMjNiYzE1ZWE3NzQ3MDFiZg==
5
- data.tar.gz: !binary |-
6
- MTE5MGUwOGYxZTAyNmI2YjhjZjNmZGVmYWE4MGY0Njg4NDgzNDBiYw==
7
- !binary "U0hBNTEy":
8
- metadata.gz: !binary |-
9
- NDQ1YzFkYjdjMTgzNzY5NDIzNjZkYmEyYTA4M2I5MDg3MWY4ZjA2Y2VlNTA5
10
- YjkwYTQ3NWY4MTg0NmYwOTA4ZDY4MDAxN2FkYjc4ZDBjNTUxYjU0M2I0MDNk
11
- NmEwMzFkNjY4MGI2NTQxNzM3M2NhOTMzN2NiNWVmOTYyN2U3NGY=
12
- data.tar.gz: !binary |-
13
- NDJjMjI5NmE3NzE3MGYxODVhMjk5ODFiMzg2OTFkNTZlMzgwODEyYTMwZDE3
14
- M2M4YzU3NDNlMmVkYWU1ZDExODc0ZWNlODJhYjM5YzVlOTU0ZTE4OTQ4ZmNj
15
- MGJiODM1N2FlMTBiY2U2NzBlZDYzM2YzYjljZTg0MTk2ZmRiMjA=