batchy 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/batchy.rb +7 -0
- data/lib/batchy/batch.rb +0 -3
- data/lib/batchy/version.rb +1 -1
- metadata +3 -3
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
|
data/lib/batchy/version.rb
CHANGED
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: batchy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.0.
|
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:
|
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:
|
178
|
+
hash: 2320758883941426910
|
179
179
|
segments:
|
180
180
|
- 0
|
181
181
|
version: "0"
|