lib/neco/container.rb in neco-0.1.0 vs lib/neco/container.rb in neco-0.2.0
- old
+ new
@@ -12,14 +12,16 @@
end
def call(*args, **params)
@environment.merge!(params)
@commands.each do |command|
- command.call(*args, **@environment)
- @called << command
- rescue StandardError
- @called.reverse_each(&:revert)
- break
+ result = command.call(*args, **@environment)
+ if result.success?
+ @called << command
+ else
+ @called.reverse_each(&:revert)
+ break
+ end
end
end
def set(key, value)
@environment[key] = value