servactory 1.6.6 → 1.6.7
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 +4 -0
- data/lib/servactory/context/workspace.rb +11 -1
- data/lib/servactory/inputs/validations/type.rb +1 -1
- data/lib/servactory/test/fake_type.rb +7 -0
- data/lib/servactory/test/result.rb +13 -0
- data/lib/servactory/version.rb +1 -1
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 36958cd40c5a7f821265cbbaa4509262da61fb1dcb799d9ba57433012d2e35c1
|
4
|
+
data.tar.gz: 3a7a5736e738bc71be30ddef3bee4c536c108a29f24493da9359aa3cfd3eef3c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e9b3da95a52a025298169b2f6eea8e6b75bf538dc1ea98c4e903c3c43e50dccada335f37b6883f1cf7c1cb49ed4370a2b182ee2c05cb1c48e35b888575bdd26e
|
7
|
+
data.tar.gz: d52fe6ad625529e3f5efb114cbea5331505df217802f3acfc3a68acaa61e761de770c394210d28dd16be134c2eb1003e42d6ed1dc994e8ed8ec8ddad6538e1ad
|
@@ -6,6 +6,8 @@ module Servactory
|
|
6
6
|
def call!(arguments = {}) # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
|
7
7
|
@context_store = Store.new(self)
|
8
8
|
|
9
|
+
context_store.context.send(:assign_service_strict_mode, true)
|
10
|
+
|
9
11
|
assign_data_with(arguments)
|
10
12
|
|
11
13
|
inputs_workbench.find_unnecessary!
|
@@ -31,6 +33,8 @@ module Servactory
|
|
31
33
|
def call(arguments = {}) # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
|
32
34
|
@context_store = Store.new(self)
|
33
35
|
|
36
|
+
context_store.context.send(:assign_service_strict_mode, false)
|
37
|
+
|
34
38
|
assign_data_with(arguments)
|
35
39
|
|
36
40
|
inputs_workbench.find_unnecessary!
|
@@ -29,7 +29,17 @@ module Servactory
|
|
29
29
|
end
|
30
30
|
|
31
31
|
def fail!(message:, meta: nil)
|
32
|
-
|
32
|
+
failure = Servactory.configuration.failure_class.new(message: message, meta: meta)
|
33
|
+
|
34
|
+
raise failure if @service_strict_mode
|
35
|
+
|
36
|
+
errors << failure
|
37
|
+
end
|
38
|
+
|
39
|
+
private
|
40
|
+
|
41
|
+
def assign_service_strict_mode(flag)
|
42
|
+
@service_strict_mode = flag
|
33
43
|
end
|
34
44
|
end
|
35
45
|
end
|
@@ -94,7 +94,7 @@ module Servactory
|
|
94
94
|
end
|
95
95
|
|
96
96
|
def prepared_value
|
97
|
-
@prepared_value ||= @input.optional? && !@input.default.nil? ? @input.default : @value
|
97
|
+
@prepared_value ||= @input.optional? && !@input.default.nil? && @value.blank? ? @input.default : @value
|
98
98
|
end
|
99
99
|
end
|
100
100
|
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Servactory
|
4
|
+
module Test
|
5
|
+
class Result
|
6
|
+
def initialize(**attributes)
|
7
|
+
attributes.each_pair do |method_name, method_return|
|
8
|
+
define_singleton_method(method_name) { method_return }
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
data/lib/servactory/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: servactory
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.
|
4
|
+
version: 1.6.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anton Sokolov
|
@@ -247,6 +247,8 @@ files:
|
|
247
247
|
- lib/servactory/outputs/validations/type.rb
|
248
248
|
- lib/servactory/outputs/workbench.rb
|
249
249
|
- lib/servactory/result.rb
|
250
|
+
- lib/servactory/test/fake_type.rb
|
251
|
+
- lib/servactory/test/result.rb
|
250
252
|
- lib/servactory/utils.rb
|
251
253
|
- lib/servactory/version.rb
|
252
254
|
homepage: https://github.com/afuno/servactory
|