adama 0.1.2 → 0.1.3

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 19227b10769f03a3533cccd1a9b06a1776136cc6
4
- data.tar.gz: cdbf056ff0ec642e58004f8d2aedb4804c2c0666
3
+ metadata.gz: 123efa8bc95432a3fe1a7082cc8e792242ea9a2b
4
+ data.tar.gz: 1500b122b021effefa95c72460f277ce7957b53e
5
5
  SHA512:
6
- metadata.gz: 8065276ad87c3208a01797b5d8e1428770bbfa40adadf1e4afe2ab1a28c6c7e1e47d1c255858d31dea6fa452cbe9f927335c60053fd4b3759279168da027b7b6
7
- data.tar.gz: 7ade457fe9931aee31428628707de655dd09a1a5102ffaf9b5dfeaa42ef9d287afb0face4c5ec027a14a4637ef245db439c16a240a3053ff2cc905eb982a3f5f
6
+ metadata.gz: 4cb8c72a3968d394e9476d92b3cba1732ce5e11978cc1274cc33e29084242f690650457b56ab6f80d82d7fb52ffb28c9cf944c3aa187e67e8cff2a51edffaf0a
7
+ data.tar.gz: 47af6ddfd95c7ce0cc5d013f845be70176d3b4bdccbae388e2c03b65c9995e7d6224ad64f620f61756a3e4e283a49f2f63fcb7c0564351056282bf0de006c4b1
data/lib/adama/command.rb CHANGED
@@ -34,12 +34,10 @@ module Adama
34
34
  end
35
35
 
36
36
  # Internal instance method. Called by both the call class method, and by
37
- # the call method in the invoker. If it fails it rolls back the command
38
- # and raises a CommandError.
39
- def run(enable_rollback: true)
37
+ # the call method in the invoker. If it fails it raises a CommandError.
38
+ def run
40
39
  call
41
40
  rescue => error
42
- rollback if enable_rollback
43
41
  raise Errors::CommandError.new error: error, command: self
44
42
  end
45
43
 
data/lib/adama/invoker.rb CHANGED
@@ -98,17 +98,13 @@ module Adama
98
98
  end
99
99
  end
100
100
 
101
- # Iterate over the commands array, instantiate each command, add it to
102
- # the called list and then run it. We don't want the command to call
103
- # rollback itself as that will be handled by the rollback method above.
104
- # To ensure this doesn't happen we pass in enable_rollback: false.
105
- # Please ensure the command is placed on the array _prior_ to calling
106
- # run, or else we'll miss rolling back the command that failed.
101
+ # Iterate over the commands array, instantiate each command, run it,
102
+ # and add it to the called list.
107
103
  def call
108
104
  self.class.commands.each do |command_klass|
109
105
  command = command_klass.new(kwargs)
106
+ command.run
110
107
  _called << command
111
- command.run(enable_rollback: false)
112
108
  end
113
109
  end
114
110
  end
data/lib/adama/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Adama
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: adama
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - dradford
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-07-12 00:00:00.000000000 Z
11
+ date: 2017-08-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler