batchy 0.0.6 → 0.0.7

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/lib/batchy.rb CHANGED
@@ -95,11 +95,18 @@ module Batchy
95
95
  batch.save!
96
96
 
97
97
  yield batch
98
+
99
+ batch.run_success_callbacks
98
100
  rescue Exception => e
99
101
  batch.error = "{#{e.message}\n#{e.backtrace.join('\n')}"
102
+
103
+ batch.run_failure_callbacks
100
104
  ensure
105
+ batch.finished_at = DateTime.now
101
106
  batch.finish!
102
107
 
108
+ batch.run_ensure_callbacks
109
+
103
110
  # Set current batch to parent (or nil if no parent)
104
111
  @current = batch.parent
105
112
 
data/lib/batchy/batch.rb CHANGED
@@ -42,9 +42,6 @@ module Batchy
42
42
  batch.finished_at = DateTime.now
43
43
  batch.save!
44
44
  end
45
- after_transition :running => :success, :do => :run_success_callbacks
46
- after_transition :running => :errored, :do => :run_failure_callbacks
47
- after_transition :running => [:success, :errored], :do => :run_ensure_callbacks
48
45
  end
49
46
 
50
47
  class << self
@@ -1,3 +1,3 @@
1
1
  module Batchy
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: batchy
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.6
5
+ version: 0.0.7
6
6
  platform: ruby
7
7
  authors:
8
8
  - Bob Briski
@@ -166,7 +166,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
166
166
  requirements:
167
167
  - - ">="
168
168
  - !ruby/object:Gem::Version
169
- hash: 2438709295008039253
169
+ hash: 2320758883941426910
170
170
  segments:
171
171
  - 0
172
172
  version: "0"
@@ -175,7 +175,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
175
175
  requirements:
176
176
  - - ">="
177
177
  - !ruby/object:Gem::Version
178
- hash: 2438709295008039253
178
+ hash: 2320758883941426910
179
179
  segments:
180
180
  - 0
181
181
  version: "0"