u-service 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/micro/service.rb +1 -1
- data/lib/micro/service/pipeline.rb +6 -3
- data/lib/micro/service/strict.rb +9 -0
- data/lib/micro/service/version.rb +1 -1
- metadata +2 -2
- data/lib/micro/service/strict/base.rb +0 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5726d2ecb67cd07b309e07b8df1efca7d5b3c1249f494eafd844fb1f09779424
|
4
|
+
data.tar.gz: 5ae6ec089cba9c0b2e82df8c04179aada1fa973ffb5ce05e9fb90d04de92ce7e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 84e07635d0b6763c90fd3ac17d413a2380eecf7a3b4d050b68483d25e95d7d94815f76c5019b0af360594aea660df2bc5147df8ae130391f5afb32c4857565a0
|
7
|
+
data.tar.gz: b7e863689304c30d7023b4a65107fd23bbb04804cff0628365d535d1f1c4bd044b0e0dcf11debab688b42e1c6f6042d484fc4fdf599e7832a6d3018305c97ec3
|
data/Gemfile.lock
CHANGED
data/lib/micro/service.rb
CHANGED
@@ -15,9 +15,7 @@ module Micro
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def call(arg={})
|
18
|
-
initial_result
|
19
|
-
|
20
|
-
@services.reduce(initial_result) do |result, service|
|
18
|
+
@services.reduce(initial_result(arg)) do |result, service|
|
21
19
|
break result if result.failure?
|
22
20
|
service.call(result.value)
|
23
21
|
end
|
@@ -32,6 +30,11 @@ module Micro
|
|
32
30
|
end
|
33
31
|
end
|
34
32
|
end
|
33
|
+
|
34
|
+
def initial_result(arg)
|
35
|
+
return arg if arg.is_a?(Micro::Service::Result)
|
36
|
+
Micro::Service::Result::Success(value: arg)
|
37
|
+
end
|
35
38
|
end
|
36
39
|
end
|
37
40
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: u-service
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rodrigo Serradura
|
@@ -87,7 +87,7 @@ files:
|
|
87
87
|
- lib/micro/service/base.rb
|
88
88
|
- lib/micro/service/pipeline.rb
|
89
89
|
- lib/micro/service/result.rb
|
90
|
-
- lib/micro/service/strict
|
90
|
+
- lib/micro/service/strict.rb
|
91
91
|
- lib/micro/service/version.rb
|
92
92
|
- lib/micro/u-service.rb
|
93
93
|
- u-service.gemspec
|