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 +4 -4
- data/lib/adama/command.rb +2 -4
- data/lib/adama/invoker.rb +3 -7
- data/lib/adama/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 123efa8bc95432a3fe1a7082cc8e792242ea9a2b
|
|
4
|
+
data.tar.gz: 1500b122b021effefa95c72460f277ce7957b53e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
|
38
|
-
|
|
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,
|
|
102
|
-
#
|
|
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
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.
|
|
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-
|
|
11
|
+
date: 2017-08-08 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|