trailblazer-operation 0.5.2 → 0.5.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +4 -0
- data/Gemfile +3 -4
- data/lib/trailblazer/operation/public_call.rb +12 -7
- data/lib/trailblazer/operation/trace.rb +4 -4
- data/lib/trailblazer/operation/version.rb +1 -1
- data/trailblazer-operation.gemspec +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 875146eae94f05d2e60acc090d469dc3b65ed5278a26afa50787adce1ff490f3
|
4
|
+
data.tar.gz: 72c01e7685f4487542b0294ce8d063ed53bbb3becd64c94143516212f8fc4dc1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a6be7ff9ec4e78446595d50a4b53c9d7c992f3045fb5b14fe38c6d1f6c4b5a220c4f18a75bfc25f8364e5aeff8a6c1124c5d184cdc55361ed67219f6ddbdd0fc
|
7
|
+
data.tar.gz: c7f329498fc3e0dcafaa4929fa7624b851304ec8b8cc3aba9dda4bf4a3f7d578da7aa3e186914e8e192116748252ba6a08661693a5e8a40e08411b309818716a
|
data/CHANGES.md
CHANGED
data/Gemfile
CHANGED
@@ -10,9 +10,8 @@ gem "dry-auto_inject"
|
|
10
10
|
gem "benchmark-ips"
|
11
11
|
gem "minitest-line"
|
12
12
|
|
13
|
-
gem "trailblazer-developer", path: "../
|
13
|
+
# gem "trailblazer-developer", path: "../developer"
|
14
14
|
# gem "trailblazer-developer", git: "https://github.com/trailblazer/trailblazer-developer"
|
15
|
-
gem "trailblazer-activity", path: "../trailblazer-activity"
|
16
|
-
gem "trailblazer-
|
17
|
-
gem "trailblazer-activity-dsl-linear", path: "../trailblazer-activity-dsl-linear"
|
15
|
+
# gem "trailblazer-activity", path: "../trailblazer-activity"
|
16
|
+
# gem "trailblazer-activity-dsl-linear", path: "../trailblazer-activity-dsl-linear"
|
18
17
|
# gem "trailblazer-activity", github: "trailblazer/trailblazer-activity"
|
@@ -13,21 +13,21 @@ module Trailblazer
|
|
13
13
|
#
|
14
14
|
# @note Do not override this method as it will be removed in future versions. Also, you will break tracing.
|
15
15
|
# @return Operation::Railway::Result binary result object
|
16
|
-
def call(*args)
|
17
|
-
return call_with_circuit_interface(*args) if
|
16
|
+
def call(options = {}, *args)
|
17
|
+
return call_with_circuit_interface(options, *args) if options.is_a?(Array) # This is kind of a hack that could be well hidden if Ruby had method overloading. Goal is to simplify the call/__call__ thing as we're fading out Operation::call anyway.
|
18
18
|
|
19
|
-
call_with_public_interface(*args)
|
19
|
+
call_with_public_interface(options, *args)
|
20
20
|
end
|
21
21
|
|
22
22
|
def call_with_public_interface(*args)
|
23
|
-
ctx = options_for_public_call(*args)
|
23
|
+
ctx = options_for_public_call(*args, flow_options())
|
24
24
|
|
25
25
|
# call the activity.
|
26
26
|
# This will result in invoking {::call_with_circuit_interface}.
|
27
27
|
# last_signal, (options, flow_options) = Activity::TaskWrap.invoke(self, [ctx, {}], {})
|
28
28
|
signal, (ctx, flow_options) = Activity::TaskWrap.invoke(
|
29
29
|
@activity,
|
30
|
-
[ctx,
|
30
|
+
[ctx, flow_options()],
|
31
31
|
exec_context: new
|
32
32
|
)
|
33
33
|
|
@@ -46,8 +46,13 @@ module Trailblazer
|
|
46
46
|
|
47
47
|
# Compile a Context object to be passed into the Activity::call.
|
48
48
|
# @private
|
49
|
-
def self.options_for_public_call(options
|
50
|
-
Trailblazer::Context.
|
49
|
+
def self.options_for_public_call(options, **flow_options)
|
50
|
+
Trailblazer::Context.for_circuit(options, {}, [options, flow_options], {})
|
51
|
+
end
|
52
|
+
|
53
|
+
# @semi=public
|
54
|
+
def flow_options
|
55
|
+
{context_alias: {}}
|
51
56
|
end
|
52
57
|
end
|
53
58
|
end
|
@@ -2,8 +2,8 @@ module Trailblazer
|
|
2
2
|
class Operation
|
3
3
|
module Trace
|
4
4
|
# @note The problem in this method is, we have redundancy with Operation::PublicCall
|
5
|
-
def self.call(operation,
|
6
|
-
ctx = PublicCall.options_for_public_call(
|
5
|
+
def self.call(operation, options)
|
6
|
+
ctx = PublicCall.options_for_public_call(options) # redundant with PublicCall::call.
|
7
7
|
|
8
8
|
stack, signal, (ctx, _flow_options) = Activity::Trace.(operation, [ctx, {}])
|
9
9
|
|
@@ -18,8 +18,8 @@ module Trailblazer
|
|
18
18
|
# @public
|
19
19
|
#
|
20
20
|
# Operation.trace(params, current_user: current_user).wtf
|
21
|
-
def trace(
|
22
|
-
Trace.(self,
|
21
|
+
def trace(options)
|
22
|
+
Trace.(self, options)
|
23
23
|
end
|
24
24
|
|
25
25
|
# Presentation of the traced stack via the returned result object.
|
@@ -17,7 +17,7 @@ Gem::Specification.new do |spec|
|
|
17
17
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
18
18
|
spec.require_paths = ["lib"]
|
19
19
|
|
20
|
-
spec.add_dependency "trailblazer-activity-dsl-linear", ">= 0.1
|
20
|
+
spec.add_dependency "trailblazer-activity-dsl-linear", ">= 0.2.1", "< 1.0.0"
|
21
21
|
|
22
22
|
spec.add_development_dependency "bundler"
|
23
23
|
spec.add_development_dependency "minitest"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trailblazer-operation
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nick Sutterer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-09-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: trailblazer-activity-dsl-linear
|
@@ -16,7 +16,7 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.1
|
19
|
+
version: 0.2.1
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
22
|
version: 1.0.0
|
@@ -26,7 +26,7 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: 0.1
|
29
|
+
version: 0.2.1
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
32
|
version: 1.0.0
|
@@ -174,7 +174,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
174
174
|
version: '0'
|
175
175
|
requirements: []
|
176
176
|
rubyforge_project:
|
177
|
-
rubygems_version: 2.7.
|
177
|
+
rubygems_version: 2.7.6
|
178
178
|
signing_key:
|
179
179
|
specification_version: 4
|
180
180
|
summary: Trailblazer's operation object with railway flow and integrated error handling.
|