batch_manager 0.3.8 → 0.3.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: eaa0eb636c2efd29269478afe59182015eebb35f
4
- data.tar.gz: 381f7f985c89c37bf5dab2dcf10ceca8ca644753
3
+ metadata.gz: 1f126c36d799f8c8ecf3e7f5d6d2f516039a6ef9
4
+ data.tar.gz: 24ec977d830ca47e3ba5b742dfd7d03c1110f1b3
5
5
  SHA512:
6
- metadata.gz: 25a0bda7f4b85ab6e670b9439a11ed2f273502322c77746d1a4e5764e97807b31c09ec697b63fe73b634d3baf9e8f40f9be5245e27a9cabcb131a468a0219388
7
- data.tar.gz: a0abd5c4a17c90283a582d4a927319e8ae307df3081a2b5928f50b862b24180fb710ab3ef2f06e51c0f0bfc67c2c6cc47f776d5a88537379b3c07a70066dd9a9
6
+ metadata.gz: d6ed61ecfe20421b6c14dc831fc55cdc9c9c812336afc89e2ef301f573fe34406a1c241209fe0c5c55f1da0d4b49533e4fc8553f4b920dddbfc0d72258046c92
7
+ data.tar.gz: 2b1e126e9575b5965bc713b635cfded66c6f03dfdf2c0cbce067f1726fda35a52ad91b50cdf9c2acbde3f183f7c5e8fa32448ce1aa4dc4c89cff84ca55f6ef48
@@ -9,7 +9,7 @@ module BatchManager
9
9
  @batch_status = BatchManager::BatchStatus.new(@batch_file_path)
10
10
  @wet = options[:wet]
11
11
  if options[:force] || !@wet || @batch_status.can_run?
12
- record_run_duration { exec_batch_script }
12
+ logging_run_duration { exec_batch_script }
13
13
  else
14
14
  raise "Cannot run this batch."
15
15
  end
@@ -20,7 +20,7 @@ module BatchManager
20
20
 
21
21
  protected
22
22
 
23
- def record_run_duration
23
+ def logging_run_duration
24
24
  @logger = BatchManager::Logger.new(@batch_status.name, @wet)
25
25
  start_at = Time.now
26
26
  yield
@@ -34,6 +34,8 @@ module BatchManager
34
34
  eval(File.read(@batch_file_path), nil, @batch_file_path)
35
35
  @logger.info "Succeeded."
36
36
  @batch_status.update_schema if @wet
37
+ rescue => e
38
+ @logger.error e
37
39
  ensure
38
40
  puts "Log saved at: #{@logger.log_file}" if @logger.log_file
39
41
  end
@@ -1,3 +1,3 @@
1
1
  module BatchManager
2
- VERSION = "0.3.8"
2
+ VERSION = "0.3.9"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: batch_manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.8
4
+ version: 0.3.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Weihu Chen