servactory 2.4.1 → 2.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/servactory/context/callable.rb +1 -1
- data/lib/servactory/result.rb +7 -3
- data/lib/servactory/test_kit/result.rb +2 -2
- data/lib/servactory/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fbf66d2c89ef6a0b50a80343230e56d940e41ce3754528cc902dbf17663800a7
|
4
|
+
data.tar.gz: dc302908e1305c9b9cbecacf1506fe9222db5e9b835fd0e8febb6e54e1211b92
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b9eb5b104b1ff966b92b2f656070379daf252d00921937383e094549bc3ae3a7782b6e43cbdec08051b38168a1d2d7f8e38d4b90e9c6a367828fd40c66218399
|
7
|
+
data.tar.gz: 2b51810de55de6b8a13ba4f7cc22e2ebd913839cd86fa68f05cec9c83b5558dbcba9bf13cf194f163287c5c7a0d7bab5bdf5a715b159106338611cc2d082c706
|
@@ -22,7 +22,7 @@ module Servactory
|
|
22
22
|
rescue config.success_class => e
|
23
23
|
Servactory::Result.success_for(context: e.context)
|
24
24
|
rescue config.failure_class => e
|
25
|
-
Servactory::Result.failure_for(exception: e)
|
25
|
+
Servactory::Result.failure_for(context: context, exception: e)
|
26
26
|
end
|
27
27
|
|
28
28
|
private
|
data/lib/servactory/result.rb
CHANGED
@@ -19,11 +19,11 @@ module Servactory
|
|
19
19
|
new(context: context).send(:as_success)
|
20
20
|
end
|
21
21
|
|
22
|
-
def self.failure_for(exception:)
|
23
|
-
new(exception: exception).send(:as_failure)
|
22
|
+
def self.failure_for(context:, exception:)
|
23
|
+
new(context: context, exception: exception).send(:as_failure)
|
24
24
|
end
|
25
25
|
|
26
|
-
def initialize(context
|
26
|
+
def initialize(context:, exception: nil)
|
27
27
|
@context = context
|
28
28
|
@exception = exception
|
29
29
|
end
|
@@ -78,6 +78,10 @@ module Servactory
|
|
78
78
|
false
|
79
79
|
end
|
80
80
|
|
81
|
+
outputs.methods(false).each do |method_name|
|
82
|
+
define_singleton_method(method_name) { outputs.send(method_name) }
|
83
|
+
end
|
84
|
+
|
81
85
|
self
|
82
86
|
end
|
83
87
|
|
@@ -7,8 +7,8 @@ module Servactory
|
|
7
7
|
Servactory::Result.success_for(context: new(attributes))
|
8
8
|
end
|
9
9
|
|
10
|
-
def self.as_failure(exception: nil)
|
11
|
-
Servactory::Result.failure_for(exception: exception)
|
10
|
+
def self.as_failure(attributes = {}, exception: nil)
|
11
|
+
Servactory::Result.failure_for(context: new(attributes), exception: exception)
|
12
12
|
end
|
13
13
|
|
14
14
|
def initialize(attributes = {})
|
data/lib/servactory/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: servactory
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.4.
|
4
|
+
version: 2.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anton Sokolov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-03-
|
11
|
+
date: 2024-03-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|