trailblazer-operation 0.10.1 → 0.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +2 -2
- data/CHANGES.md +10 -0
- data/lib/trailblazer/operation/class_dependencies.rb +1 -1
- data/lib/trailblazer/operation/public_call.rb +24 -14
- data/lib/trailblazer/operation/railway.rb +13 -7
- data/lib/trailblazer/operation/version.rb +1 -1
- data/lib/trailblazer/operation/wtf.rb +11 -0
- data/lib/trailblazer/operation.rb +2 -2
- data/test/call_test.rb +32 -10
- data/test/class_dependencies_test.rb +8 -4
- data/test/docs/autogenerated/activity_basics_test.rb +72 -0
- data/test/docs/autogenerated/composable_variable_mapping_test.rb +880 -0
- data/test/docs/autogenerated/fast_track_layout_test.rb +76 -0
- data/test/docs/autogenerated/mechanics_test.rb +382 -0
- data/test/docs/autogenerated/sequence_options_test.rb +202 -0
- data/test/docs/autogenerated/subprocess_test.rb +257 -0
- data/test/docs/autogenerated/wiring_api_test.rb +435 -0
- data/test/docs/developer_test.rb +27 -0
- data/test/docs/public_call_monkeypatching_test.rb +96 -0
- data/test/docs/result_test.rb +38 -0
- data/test/docs/step_dsl_test.rb +93 -0
- data/test/operation_test.rb +53 -13
- data/test/result_test.rb +1 -1
- data/test/test_helper.rb +17 -5
- data/test/trace_test.rb +3 -43
- data/trailblazer-operation.gemspec +2 -1
- metadata +42 -23
- data/lib/trailblazer/operation/trace.rb +0 -67
- data/test/callable_test.rb +0 -147
- data/test/docs/doormat_test.rb +0 -190
- data/test/docs/macaroni_test.rb +0 -31
- data/test/skill_test.rb +0 -66
- data/test/wire_test.rb +0 -113
- data/test/wiring/defaults_test.rb +0 -193
- data/test/wiring/subprocess_test.rb +0 -70
@@ -0,0 +1,27 @@
|
|
1
|
+
require "test_helper"
|
2
|
+
|
3
|
+
class Wtf_DeveloperDocsTest < Minitest::Spec
|
4
|
+
Memo = Class.new
|
5
|
+
module Memo::Operation
|
6
|
+
class Create < Trailblazer::Operation
|
7
|
+
step :validate
|
8
|
+
step :save
|
9
|
+
left :handle_errors
|
10
|
+
step :notify
|
11
|
+
#~meths
|
12
|
+
include T.def_steps(:validate, :save, :handle_errors, :notify)
|
13
|
+
#~meths end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
it "what" do
|
18
|
+
#:wtf
|
19
|
+
result = Memo::Operation::Create.wtf?(
|
20
|
+
#~meths
|
21
|
+
seq: [],
|
22
|
+
#~meths end
|
23
|
+
params: {memo: "remember me!"}
|
24
|
+
)
|
25
|
+
#:wtf end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,96 @@
|
|
1
|
+
require "test_helper"
|
2
|
+
|
3
|
+
class PublicCallMonkeypatchingTest < Minitest::Spec
|
4
|
+
#@ test overriding {Operation.call_with_public_interface}
|
5
|
+
#@
|
6
|
+
module AfterCall
|
7
|
+
def self.add_task_name(wrap_ctx, original_args)
|
8
|
+
(ctx, _flow_options), circuit_options = original_args
|
9
|
+
|
10
|
+
activity = circuit_options[:activity] # currently running Activity.
|
11
|
+
task = wrap_ctx[:task] # the current "step".
|
12
|
+
task_id = Trailblazer::Activity::Introspect.Nodes(activity, task: task).id
|
13
|
+
|
14
|
+
ctx[:seq] << task_id
|
15
|
+
|
16
|
+
return wrap_ctx, original_args # yay to mutable state. not.
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
it "overrides {call_with_public_interface} and allows injecting {circuit_options} and {flow_options} from the override" do
|
21
|
+
TaskWrapExtension = Trailblazer::Activity::TaskWrap::Extension(
|
22
|
+
[AfterCall.method(:add_task_name), id: "my.add_1", append: "task_wrap.call_task"]
|
23
|
+
)
|
24
|
+
|
25
|
+
module OperationExtensions
|
26
|
+
def call_with_public_interface(ctx, flow_options, **circuit_options)
|
27
|
+
super(
|
28
|
+
ctx,
|
29
|
+
flow_options.merge({}),
|
30
|
+
**circuit_options.merge(
|
31
|
+
wrap_runtime: Hash.new(TaskWrapExtension),
|
32
|
+
runner: Trailblazer::Activity::TaskWrap::Runner
|
33
|
+
)
|
34
|
+
)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
operation = Class.new(Trailblazer::Operation) do
|
39
|
+
step :a
|
40
|
+
|
41
|
+
include Trailblazer::Activity::Testing.def_steps(:a)
|
42
|
+
end
|
43
|
+
operation.extend OperationExtensions # monkey-patch the "global" Operation.
|
44
|
+
|
45
|
+
|
46
|
+
# circuit interface invocation using call
|
47
|
+
result = operation.call(
|
48
|
+
seq: []
|
49
|
+
)
|
50
|
+
|
51
|
+
assert_equal result.success?, true
|
52
|
+
assert_equal result[:seq], ["Start.default", :a, :a, "End.success", nil] # {nil} because we don't have an ID for the actual operation.
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
class FlowOptionsMonkeypatching < Minitest::Spec
|
57
|
+
module App
|
58
|
+
FLOW_OPTIONS = {
|
59
|
+
context_options: {
|
60
|
+
aliases: { "contract.default": :contract },
|
61
|
+
container_class: Trailblazer::Context::Container::WithAliases,
|
62
|
+
}
|
63
|
+
}
|
64
|
+
|
65
|
+
module OperationExtensions
|
66
|
+
def call_with_public_interface(ctx, flow_options, **circuit_options)
|
67
|
+
super(
|
68
|
+
ctx,
|
69
|
+
flow_options.merge(App::FLOW_OPTIONS),
|
70
|
+
**circuit_options
|
71
|
+
)
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
it "inject aliases for the global run via {flow_options}" do
|
77
|
+
operation = Class.new(Trailblazer::Operation) do
|
78
|
+
step :a
|
79
|
+
|
80
|
+
def a(ctx, contract:, **)
|
81
|
+
ctx[:seq] << contract
|
82
|
+
end
|
83
|
+
end
|
84
|
+
operation.extend App::OperationExtensions # monkey-patch the "global" Operation.
|
85
|
+
|
86
|
+
|
87
|
+
# circuit interface invocation using call
|
88
|
+
result = operation.call(
|
89
|
+
seq: [],
|
90
|
+
:"contract.default" => Object,
|
91
|
+
)
|
92
|
+
|
93
|
+
assert_equal result.success?, true
|
94
|
+
assert_equal result[:seq].inspect, %([Object])
|
95
|
+
end
|
96
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
require "test_helper"
|
2
|
+
|
3
|
+
module A
|
4
|
+
class DocsResultTest < Minitest::Spec
|
5
|
+
Memo = Class.new
|
6
|
+
module Memo::Operation
|
7
|
+
class Create < Trailblazer::Operation
|
8
|
+
step :validate, Output(:failure) => End(:validation_error)
|
9
|
+
step :save
|
10
|
+
include T.def_steps(:validate, :save)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
it "exposes {#terminus}" do
|
15
|
+
result = Memo::Operation::Create.(seq: [])
|
16
|
+
assert_equal CU.inspect(result.terminus.to_h), %({:semantic=>:success})
|
17
|
+
|
18
|
+
result = Memo::Operation::Create.(validate: false, seq: [])
|
19
|
+
assert_equal CU.inspect(result.terminus.to_h), %({:semantic=>:validation_error})
|
20
|
+
|
21
|
+
result = Memo::Operation::Create.(save: false, seq: [])
|
22
|
+
assert_equal CU.inspect(result.terminus.to_h), %({:semantic=>:failure})
|
23
|
+
end
|
24
|
+
|
25
|
+
it "deprecates Result#event" do
|
26
|
+
result = Memo::Operation::Create.(seq: [])
|
27
|
+
terminus = nil
|
28
|
+
|
29
|
+
_, warning = capture_io do
|
30
|
+
terminus = result.event
|
31
|
+
end
|
32
|
+
line_no = __LINE__ - 2
|
33
|
+
|
34
|
+
assert_equal warning, %{[Trailblazer] #{File.realpath(__FILE__)}:#{line_no} Using `Result#event` is deprecated, please use `Result#terminus`\n}
|
35
|
+
assert_equal CU.inspect(terminus.to_h), %({:semantic=>:success})
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,93 @@
|
|
1
|
+
require "test_helper"
|
2
|
+
|
3
|
+
module A
|
4
|
+
class DocsStepTest < Minitest::Spec
|
5
|
+
Memo = Module.new
|
6
|
+
|
7
|
+
#:railway
|
8
|
+
module Memo::Operation
|
9
|
+
class Create < Trailblazer::Operation
|
10
|
+
step :validate
|
11
|
+
step :save
|
12
|
+
#~step
|
13
|
+
left :handle_errors
|
14
|
+
#~left
|
15
|
+
step :notify
|
16
|
+
#~meths
|
17
|
+
# fail :log_error
|
18
|
+
# step :save
|
19
|
+
def validate(ctx, params:, **)
|
20
|
+
ctx[:input] = Form.validate(params) # true/false
|
21
|
+
end
|
22
|
+
|
23
|
+
# def create(ctx, input:, create:, **)
|
24
|
+
# create
|
25
|
+
# end
|
26
|
+
|
27
|
+
# def log_error(ctx, logger:, params:, **)
|
28
|
+
# logger.error("wrong params: #{params.inspect}")
|
29
|
+
# end
|
30
|
+
#~meths end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
#~step end
|
34
|
+
#~left end
|
35
|
+
#:railway end
|
36
|
+
|
37
|
+
# it "what" do
|
38
|
+
# ctx = {params: {text: "Hydrate!"}, create: true}
|
39
|
+
# signal, (ctx, _flow_options) = D::Create.([ctx, {}])
|
40
|
+
# end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
|
45
|
+
module B
|
46
|
+
class Fail_DocsStepTest < Minitest::Spec
|
47
|
+
Memo = Module.new
|
48
|
+
|
49
|
+
#:fail
|
50
|
+
module Memo::Operation
|
51
|
+
class Create < Trailblazer::Operation
|
52
|
+
step :validate
|
53
|
+
step :save
|
54
|
+
fail :handle_errors # just like {#left}
|
55
|
+
#~meths
|
56
|
+
step :notify
|
57
|
+
include T.def_steps(:validate, :save, :handle_errors, :notify)
|
58
|
+
#~meths end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
#:fail end
|
62
|
+
|
63
|
+
it "what" do
|
64
|
+
assert_invoke Memo::Operation::Create, seq: "[:validate, :save, :notify]"
|
65
|
+
assert_invoke Memo::Operation::Create, validate: false, terminus: :failure, seq: "[:validate, :handle_errors]"
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
module A
|
71
|
+
class Pass_DocsStepTest < Minitest::Spec
|
72
|
+
Memo = Module.new
|
73
|
+
|
74
|
+
#:pass
|
75
|
+
module Memo::Operation
|
76
|
+
class Create < Trailblazer::Operation
|
77
|
+
step :validate
|
78
|
+
pass :save # no output goes to the failure track here.
|
79
|
+
left :handle_errors
|
80
|
+
#~meths
|
81
|
+
step :notify
|
82
|
+
include T.def_steps(:validate, :save, :handle_errors, :notify)
|
83
|
+
#~meths end
|
84
|
+
end
|
85
|
+
end
|
86
|
+
#:pass end
|
87
|
+
|
88
|
+
it "what" do
|
89
|
+
assert_invoke Memo::Operation::Create, seq: "[:validate, :save, :notify]"
|
90
|
+
assert_invoke Memo::Operation::Create, validate: false, terminus: :failure, seq: "[:validate, :handle_errors]"
|
91
|
+
end
|
92
|
+
end
|
93
|
+
end
|
data/test/operation_test.rb
CHANGED
@@ -1,5 +1,55 @@
|
|
1
1
|
require "test_helper"
|
2
2
|
|
3
|
+
# Tests around {Operation.call}.
|
4
|
+
class OperationTest < Minitest::Spec
|
5
|
+
class Noop < Trailblazer::Operation
|
6
|
+
def self.capture_circuit_options((ctx, flow_options), **circuit_options)
|
7
|
+
ctx[:capture_circuit_options] = circuit_options.keys.inspect
|
8
|
+
|
9
|
+
return Trailblazer::Activity::Right, [ctx, flow_options]
|
10
|
+
end
|
11
|
+
|
12
|
+
step task: method(:capture_circuit_options)
|
13
|
+
end
|
14
|
+
|
15
|
+
# Mixing keywords and string keys in {Operation.call}.
|
16
|
+
# Test that {.(params: {}, "current_user" => user)} is processed properly
|
17
|
+
|
18
|
+
it "doesn't mistake circuit options as ctx variables when using circuit-interface" do
|
19
|
+
signal, (ctx, _) = Noop.call(
|
20
|
+
[{params: {}}, {}],
|
21
|
+
# real circuit_options
|
22
|
+
variable_for_circuit_options: true
|
23
|
+
) # call_with_public_interface
|
24
|
+
#@ {:variable_for_circuit_options} is not supposed to be in {ctx}.
|
25
|
+
assert_equal CU.inspect(ctx), %({:params=>{}, :capture_circuit_options=>"[:variable_for_circuit_options, :exec_context, :activity, :runner]"})
|
26
|
+
end
|
27
|
+
|
28
|
+
it "doesn't mistake circuit options as ctx variables when using the call interface" do
|
29
|
+
result = Noop.call(
|
30
|
+
params: {},
|
31
|
+
model: true,
|
32
|
+
"current_user" => Object
|
33
|
+
) # call with public interface.
|
34
|
+
#@ {:variable_for_circuit_options} is not supposed to be in {ctx}.
|
35
|
+
assert_result result, {params: {}, model: true, current_user: Object, capture_circuit_options: "[:wrap_runtime, :activity, :exec_context, :runner]"}
|
36
|
+
end
|
37
|
+
|
38
|
+
#@ {#call_with_public_interface}
|
39
|
+
it "doesn't mistake circuit options as ctx variables when using circuit-interface" do
|
40
|
+
result = Noop.call_with_public_interface(
|
41
|
+
{params: {}},
|
42
|
+
{},
|
43
|
+
variable_for_circuit_options: true
|
44
|
+
) # call_with_public_interface has two positional args, and kwargs for {circuit_options}.
|
45
|
+
|
46
|
+
assert_result result, {params: {}, capture_circuit_options: "[:variable_for_circuit_options, :wrap_runtime, :activity, :exec_context, :runner]"}
|
47
|
+
# assert_equal result.inspect, %(<Result:true #<Trailblazer::Context::Container wrapped_options={:params=>{}} mutable_options={:capture_circuit_options=>\"[:variable_for_circuit_options, :wrap_runtime, :activity, :exec_context, :runner]\"}> >)
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
# TODO: remove this test as many cases are covered via autogenerated activity tests.
|
52
|
+
|
3
53
|
class DeclarativeApiTest < Minitest::Spec
|
4
54
|
it "doesn't invoke {call} twice when using public interface" do
|
5
55
|
class MyOp < Trailblazer::Operation
|
@@ -33,7 +83,7 @@ class DeclarativeApiTest < Minitest::Spec
|
|
33
83
|
pass :wasnt_ok!
|
34
84
|
pass :was_ok!
|
35
85
|
fail :return_true!
|
36
|
-
|
86
|
+
left :return_false!
|
37
87
|
|
38
88
|
step :bla, input: ->(ctx, *) { {id: ctx.inspect} }, output: ->(scope, ctx) { ctx["hello"] = scope["1"]; ctx }
|
39
89
|
|
@@ -117,17 +167,6 @@ class DeclarativeApiTest < Minitest::Spec
|
|
117
167
|
Unset. ("params" => {decide: true}).inspect("a", "b", "c", "d", "e").must_equal %{<Result:true [false, true, nil, 1, 2] >}
|
118
168
|
end
|
119
169
|
|
120
|
-
# Mixing keywords and string keys in {Operation.call}.
|
121
|
-
# Test that {.(params: {}, "current_user" => user)} is processed properly
|
122
|
-
class Collect < Trailblazer::Operation
|
123
|
-
# step ->(ctx, **) { ctx[:keys] }
|
124
|
-
end
|
125
|
-
|
126
|
-
it "contains all keys from {call}" do
|
127
|
-
result = Collect.(params: {}, "current_user" => Module)
|
128
|
-
_(result.inspect).must_equal %{<Result:true #<Trailblazer::Context::Container wrapped_options={:params=>{}, \"current_user\"=>Module} mutable_options={}> >}
|
129
|
-
end
|
130
|
-
|
131
170
|
#---
|
132
171
|
#- ctx container
|
133
172
|
it do
|
@@ -141,9 +180,10 @@ class DeclarativeApiTest < Minitest::Spec
|
|
141
180
|
signal, (ctx, _) = Update.([Update.options_for_public_call(options), {}], **{})
|
142
181
|
|
143
182
|
signal.inspect.must_equal %{#<Trailblazer::Activity::Railway::End::Success semantic=:success>}
|
144
|
-
ctx.inspect
|
183
|
+
assert_equal ctx.inspect, %(#<Trailblazer::Context::Container wrapped_options=#{{"params" => {:decide=>true}}} mutable_options=#{{"a" => false, "b" => true}}>)
|
145
184
|
|
146
185
|
# Call by passing aliases as an argument.
|
186
|
+
# This uses {#call}'s second positional argument.
|
147
187
|
if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("3.0.0")
|
148
188
|
result = Update.(
|
149
189
|
options,
|
data/test/result_test.rb
CHANGED
@@ -19,7 +19,7 @@ class RailwayResultTest < Minitest::Spec
|
|
19
19
|
|
20
20
|
#---
|
21
21
|
# inspect
|
22
|
-
it { success.inspect
|
22
|
+
it { assert_equal success.inspect, %(<Result:true #{{"x" => String}} >) }
|
23
23
|
it { Result.new(true, {"x" => true, "y" => 1, "z" => 2}, event).inspect("z", "y").must_equal %{<Result:true [2, 1] >} }
|
24
24
|
|
25
25
|
class Create < Trailblazer::Operation
|
data/test/test_helper.rb
CHANGED
@@ -1,15 +1,27 @@
|
|
1
|
-
|
2
|
-
require "trailblazer/operation"
|
1
|
+
require "minitest/autorun"
|
3
2
|
|
4
3
|
require "pp"
|
4
|
+
require "trailblazer/operation"
|
5
5
|
|
6
|
-
require "minitest/autorun"
|
7
6
|
require "trailblazer/activity/testing"
|
8
7
|
require "trailblazer/developer/render/linear"
|
8
|
+
require "trailblazer/core"
|
9
9
|
|
10
10
|
Minitest::Spec.class_eval do
|
11
|
-
|
12
|
-
|
11
|
+
T = Trailblazer::Activity::Testing
|
12
|
+
include Trailblazer::Activity::Testing::Assertions
|
13
|
+
CU = Trailblazer::Core::Utils
|
14
|
+
|
15
|
+
def assert_equal(asserted, expected, *args)
|
16
|
+
super(expected, asserted, *args)
|
17
|
+
end
|
18
|
+
|
19
|
+
def assert_result(result, variables, outcome: true)
|
20
|
+
assert_equal result.success?, outcome
|
21
|
+
|
22
|
+
# assert_equal result.send(:data).sort_by { |key, _| key.to_s }.to_h.inspect, variables.sort_by { |key, _| key.to_s }.to_h.inspect
|
23
|
+
assert_equal result.send(:data).to_h, variables
|
24
|
+
end
|
13
25
|
end
|
14
26
|
|
15
27
|
# TODO: replace all this with {Activity::Testing.def_steps}
|
data/test/trace_test.rb
CHANGED
@@ -13,38 +13,13 @@ class TraceTest < Minitest::Spec
|
|
13
13
|
step ->(_options, params:, **) { params.any? }, id: "Create.task.params"
|
14
14
|
end
|
15
15
|
|
16
|
-
it "deprecates {result.wtf?} and {Operation.trace}" do
|
17
|
-
output, warning = capture_io do
|
18
|
-
result = Create.trace({a_return: true, params: {}})
|
19
|
-
result.wtf?
|
20
|
-
end
|
21
|
-
line_no = __LINE__ - 2
|
22
|
-
|
23
|
-
assert_equal warning, %([Trailblazer] #{File.realpath(__FILE__)}:#{line_no - 1} Using `Operation.trace` is deprecated and will be removed in {trailblazer-operation-0.11.0}.
|
24
|
-
Please use `TraceTest::Create.wtf?` as documented here: https://trailblazer.to/2.1/docs/trailblazer#trailblazer-developer-wtf-
|
25
|
-
[Trailblazer] #{File.realpath(__FILE__)}:#{line_no} Using `result.wtf?` is deprecated. Please use `TraceTest::Create.wtf?` and have a nice day.
|
26
|
-
)
|
27
|
-
assert_equal output, %(TraceTest::Create
|
28
|
-
|-- Start.default
|
29
|
-
|-- Create.task.a
|
30
|
-
|-- MyNested
|
31
|
-
| |-- Start.default
|
32
|
-
| |-- B.task.b
|
33
|
-
| |-- B.task.e
|
34
|
-
| `-- End.success
|
35
|
-
|-- Create.task.c
|
36
|
-
|-- Create.task.params
|
37
|
-
`-- End.failure
|
38
|
-
)
|
39
|
-
end
|
40
|
-
|
41
16
|
it "allows using low-level Operation::Trace" do
|
42
|
-
result = Trailblazer::
|
17
|
+
stack, result = Trailblazer::Developer::Trace.(
|
43
18
|
Create,
|
44
19
|
{ a_return: true, params: {} },
|
45
20
|
)
|
46
21
|
|
47
|
-
output =
|
22
|
+
output = Trailblazer::Developer::Trace::Present.(stack)
|
48
23
|
|
49
24
|
assert_equal output.gsub(/0x\w+/, "").gsub(/@.+_test/, ""), %{TraceTest::Create
|
50
25
|
|-- Start.default
|
@@ -59,21 +34,6 @@ class TraceTest < Minitest::Spec
|
|
59
34
|
`-- End.failure}
|
60
35
|
end
|
61
36
|
|
62
|
-
it "Operation::trace" do
|
63
|
-
result = Create.trace(params: {x: 1}, a_return: true)
|
64
|
-
assert_equal result.wtf.gsub(/0x\w+/, "").gsub(/@.+_test/, ""), %{TraceTest::Create
|
65
|
-
|-- Start.default
|
66
|
-
|-- Create.task.a
|
67
|
-
|-- MyNested
|
68
|
-
| |-- Start.default
|
69
|
-
| |-- B.task.b
|
70
|
-
| |-- B.task.e
|
71
|
-
| `-- End.success
|
72
|
-
|-- Create.task.c
|
73
|
-
|-- Create.task.params
|
74
|
-
`-- End.success}
|
75
|
-
end
|
76
|
-
|
77
37
|
it "Operation.wtf?" do
|
78
38
|
result = nil
|
79
39
|
output, = capture_io do
|
@@ -95,6 +55,6 @@ class TraceTest < Minitest::Spec
|
|
95
55
|
|
96
56
|
result.success?.must_equal true
|
97
57
|
result[:a_return].must_equal true
|
98
|
-
result[:params]
|
58
|
+
assert_equal CU.inspect(result[:params]), %({:x=>1})
|
99
59
|
end
|
100
60
|
end
|
@@ -17,13 +17,14 @@ Gem::Specification.new do |spec|
|
|
17
17
|
spec.test_files = spec.files.grep(%r{^(test)/})
|
18
18
|
spec.require_paths = ["lib"]
|
19
19
|
|
20
|
-
spec.add_dependency "trailblazer-activity-dsl-linear", ">= 1.2.
|
20
|
+
spec.add_dependency "trailblazer-activity-dsl-linear", ">= 1.2.3", "< 1.4.0"
|
21
21
|
spec.add_dependency "trailblazer-developer", ">= 0.1.0", "< 0.2.0"
|
22
22
|
|
23
23
|
spec.add_development_dependency "bundler"
|
24
24
|
spec.add_development_dependency "minitest"
|
25
25
|
spec.add_development_dependency "minitest-line"
|
26
26
|
spec.add_development_dependency "rake"
|
27
|
+
spec.add_development_dependency "trailblazer-core-utils"
|
27
28
|
|
28
29
|
spec.required_ruby_version = ">= 2.5.0"
|
29
30
|
end
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trailblazer-operation
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.11.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nick Sutterer
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 2024-11-15 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: trailblazer-activity-dsl-linear
|
@@ -16,7 +15,7 @@ dependencies:
|
|
16
15
|
requirements:
|
17
16
|
- - ">="
|
18
17
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.2.
|
18
|
+
version: 1.2.3
|
20
19
|
- - "<"
|
21
20
|
- !ruby/object:Gem::Version
|
22
21
|
version: 1.4.0
|
@@ -26,7 +25,7 @@ dependencies:
|
|
26
25
|
requirements:
|
27
26
|
- - ">="
|
28
27
|
- !ruby/object:Gem::Version
|
29
|
-
version: 1.2.
|
28
|
+
version: 1.2.3
|
30
29
|
- - "<"
|
31
30
|
- !ruby/object:Gem::Version
|
32
31
|
version: 1.4.0
|
@@ -106,6 +105,20 @@ dependencies:
|
|
106
105
|
- - ">="
|
107
106
|
- !ruby/object:Gem::Version
|
108
107
|
version: '0'
|
108
|
+
- !ruby/object:Gem::Dependency
|
109
|
+
name: trailblazer-core-utils
|
110
|
+
requirement: !ruby/object:Gem::Requirement
|
111
|
+
requirements:
|
112
|
+
- - ">="
|
113
|
+
- !ruby/object:Gem::Version
|
114
|
+
version: '0'
|
115
|
+
type: :development
|
116
|
+
prerelease: false
|
117
|
+
version_requirements: !ruby/object:Gem::Requirement
|
118
|
+
requirements:
|
119
|
+
- - ">="
|
120
|
+
- !ruby/object:Gem::Version
|
121
|
+
version: '0'
|
109
122
|
description: Trailblazer's operation object.
|
110
123
|
email:
|
111
124
|
- apotonick@gmail.com
|
@@ -125,16 +138,24 @@ files:
|
|
125
138
|
- lib/trailblazer/operation/public_call.rb
|
126
139
|
- lib/trailblazer/operation/railway.rb
|
127
140
|
- lib/trailblazer/operation/result.rb
|
128
|
-
- lib/trailblazer/operation/trace.rb
|
129
141
|
- lib/trailblazer/operation/version.rb
|
142
|
+
- lib/trailblazer/operation/wtf.rb
|
130
143
|
- test/benchmark/skill_resolver_benchmark.rb
|
131
144
|
- test/call_test.rb
|
132
|
-
- test/callable_test.rb
|
133
145
|
- test/class_dependencies_test.rb
|
146
|
+
- test/docs/autogenerated/activity_basics_test.rb
|
147
|
+
- test/docs/autogenerated/composable_variable_mapping_test.rb
|
148
|
+
- test/docs/autogenerated/fast_track_layout_test.rb
|
149
|
+
- test/docs/autogenerated/mechanics_test.rb
|
150
|
+
- test/docs/autogenerated/sequence_options_test.rb
|
151
|
+
- test/docs/autogenerated/subprocess_test.rb
|
152
|
+
- test/docs/autogenerated/wiring_api_test.rb
|
134
153
|
- test/docs/class_dependencies_test.rb
|
135
|
-
- test/docs/
|
136
|
-
- test/docs/macaroni_test.rb
|
154
|
+
- test/docs/developer_test.rb
|
137
155
|
- test/docs/operation_test.rb
|
156
|
+
- test/docs/public_call_monkeypatching_test.rb
|
157
|
+
- test/docs/result_test.rb
|
158
|
+
- test/docs/step_dsl_test.rb
|
138
159
|
- test/docs/wiring_test.rb
|
139
160
|
- test/fast_track_test.rb
|
140
161
|
- test/gemfiles/Gemfile.ruby-1.9
|
@@ -145,19 +166,14 @@ files:
|
|
145
166
|
- test/introspect_test.rb
|
146
167
|
- test/operation_test.rb
|
147
168
|
- test/result_test.rb
|
148
|
-
- test/skill_test.rb
|
149
169
|
- test/step_test.rb
|
150
170
|
- test/test_helper.rb
|
151
171
|
- test/trace_test.rb
|
152
|
-
- test/wire_test.rb
|
153
|
-
- test/wiring/defaults_test.rb
|
154
|
-
- test/wiring/subprocess_test.rb
|
155
172
|
- trailblazer-operation.gemspec
|
156
173
|
homepage: https://trailblazer.to/2.1/docs/operation.html
|
157
174
|
licenses:
|
158
175
|
- MIT
|
159
176
|
metadata: {}
|
160
|
-
post_install_message:
|
161
177
|
rdoc_options: []
|
162
178
|
require_paths:
|
163
179
|
- lib
|
@@ -172,19 +188,26 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
172
188
|
- !ruby/object:Gem::Version
|
173
189
|
version: '0'
|
174
190
|
requirements: []
|
175
|
-
rubygems_version: 3.
|
176
|
-
signing_key:
|
191
|
+
rubygems_version: 3.6.0.dev
|
177
192
|
specification_version: 4
|
178
193
|
summary: Trailblazer's operation object with railway flow and integrated error handling.
|
179
194
|
test_files:
|
180
195
|
- test/benchmark/skill_resolver_benchmark.rb
|
181
196
|
- test/call_test.rb
|
182
|
-
- test/callable_test.rb
|
183
197
|
- test/class_dependencies_test.rb
|
198
|
+
- test/docs/autogenerated/activity_basics_test.rb
|
199
|
+
- test/docs/autogenerated/composable_variable_mapping_test.rb
|
200
|
+
- test/docs/autogenerated/fast_track_layout_test.rb
|
201
|
+
- test/docs/autogenerated/mechanics_test.rb
|
202
|
+
- test/docs/autogenerated/sequence_options_test.rb
|
203
|
+
- test/docs/autogenerated/subprocess_test.rb
|
204
|
+
- test/docs/autogenerated/wiring_api_test.rb
|
184
205
|
- test/docs/class_dependencies_test.rb
|
185
|
-
- test/docs/
|
186
|
-
- test/docs/macaroni_test.rb
|
206
|
+
- test/docs/developer_test.rb
|
187
207
|
- test/docs/operation_test.rb
|
208
|
+
- test/docs/public_call_monkeypatching_test.rb
|
209
|
+
- test/docs/result_test.rb
|
210
|
+
- test/docs/step_dsl_test.rb
|
188
211
|
- test/docs/wiring_test.rb
|
189
212
|
- test/fast_track_test.rb
|
190
213
|
- test/gemfiles/Gemfile.ruby-1.9
|
@@ -195,10 +218,6 @@ test_files:
|
|
195
218
|
- test/introspect_test.rb
|
196
219
|
- test/operation_test.rb
|
197
220
|
- test/result_test.rb
|
198
|
-
- test/skill_test.rb
|
199
221
|
- test/step_test.rb
|
200
222
|
- test/test_helper.rb
|
201
223
|
- test/trace_test.rb
|
202
|
-
- test/wire_test.rb
|
203
|
-
- test/wiring/defaults_test.rb
|
204
|
-
- test/wiring/subprocess_test.rb
|