activeinteractor 2.0.0.alpha.1.0.0 → 2.0.0.alpha.2.0.0
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/active_interactor/base.rb +19 -7
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2a13c3091acf37b48e249f912e5551da92b039e17920e53c1082ebcc4b34f4c2
|
4
|
+
data.tar.gz: 8e1e80f06675574384eeae45835f6372bf04d7378cdf64f7f21323d36857a7e4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6b006f6e815419f58a6b6f063d37db8beae1e1ad239d98635545bb267d2c09df9307ec80528c1785035013aeaf07f27a73fcd1668dac44115e466109da675910
|
7
|
+
data.tar.gz: 3f0d5b6fd50726ec6539b691257d00d85254e1ca74c06727d84da7763e8545d033650c6ec7482f307e622e77bff2bc8fcae25e54c2f6a15208377258dac1d814
|
@@ -7,8 +7,12 @@ module ActiveInteractor
|
|
7
7
|
attributes[:arguments][name.to_sym] = { name: name, type: type, description: description }.merge(options)
|
8
8
|
end
|
9
9
|
|
10
|
+
def perform!(input_context = {})
|
11
|
+
new(input_context).perform!
|
12
|
+
end
|
13
|
+
|
10
14
|
def perform(input_context = {})
|
11
|
-
|
15
|
+
perform!(input_context)
|
12
16
|
rescue Error => e
|
13
17
|
e.result
|
14
18
|
rescue StandardError => e
|
@@ -31,18 +35,26 @@ module ActiveInteractor
|
|
31
35
|
@context = parse_input!
|
32
36
|
end
|
33
37
|
|
34
|
-
def perform
|
38
|
+
def perform!
|
39
|
+
interact
|
40
|
+
Result.success(data: parse_output!)
|
41
|
+
end
|
42
|
+
|
43
|
+
def perform
|
44
|
+
perform!
|
45
|
+
rescue Error => e
|
46
|
+
e.result
|
47
|
+
rescue StandardError => e
|
48
|
+
Result.failure(errors: e.message)
|
49
|
+
end
|
50
|
+
|
51
|
+
def interact; end
|
35
52
|
def rollback; end
|
36
53
|
|
37
54
|
protected
|
38
55
|
|
39
56
|
attr_accessor :context
|
40
57
|
|
41
|
-
def exec_perform!
|
42
|
-
perform
|
43
|
-
Result.success(data: parse_output!)
|
44
|
-
end
|
45
|
-
|
46
58
|
def fail!(errors = {})
|
47
59
|
rollback
|
48
60
|
raise Error, Result.failure(data: context, errors: errors)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activeinteractor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.0.alpha.
|
4
|
+
version: 2.0.0.alpha.2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aaron Allen
|
@@ -72,9 +72,9 @@ licenses:
|
|
72
72
|
- MIT
|
73
73
|
metadata:
|
74
74
|
bug_tracker_uri: https://github.com/activeinteractor/activeinteractor/issues
|
75
|
-
changelog_uri: https://github.com/activeinteractor/activeinteractor/blob/v2.0.0-alpha.
|
75
|
+
changelog_uri: https://github.com/activeinteractor/activeinteractor/blob/v2.0.0-alpha.2.0.0/CHANGELOG.md
|
76
76
|
homepage_uri: https://github.com/activeinteractor/activeinteractor
|
77
|
-
source_code_uri: https://github.com/activeinteractor/activeinteractor/tree/v2.0.0-alpha.
|
77
|
+
source_code_uri: https://github.com/activeinteractor/activeinteractor/tree/v2.0.0-alpha.2.0.0
|
78
78
|
wiki_uri: https://github.com/activeinteractor/activeinteractor/wiki
|
79
79
|
rubygems_mfa_required: 'true'
|
80
80
|
post_install_message:
|