trailblazer-activity-dsl-linear 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c856e0d550eab6b731d73ab0e8908bb4d5d72004448b817d0827df4ab64417b4
|
4
|
+
data.tar.gz: 2d953bfdb16bf688fe849bc002125da89432df5d349ce263624d6c687315e896
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 58b2dee42d346d555806415883cec7126b29354974bcc03779bce6d623ee412c3b86262e34b97e1e06a43119d9c2c875504154a3142adcf0413109957c4a65eb
|
7
|
+
data.tar.gz: 74aa3adbad25af14f2646791480bca64b1bc39cccc716c1a84389b756b4e87ff0e1bf064141a690ab1d4d305c61a45bb46a12b792fa74b320bafa71ee895ebce
|
data/CHANGES.md
CHANGED
data/Gemfile
CHANGED
@@ -8,5 +8,5 @@ gem "minitest-line"
|
|
8
8
|
gem "rubocop", require: false
|
9
9
|
|
10
10
|
# gem "trailblazer-context", path: "../trailblazer-context"
|
11
|
-
|
12
|
-
|
11
|
+
gem "trailblazer-developer", path: "../trailblazer-developer"
|
12
|
+
gem "trailblazer-activity", path: "../trailblazer-activity"
|
@@ -207,13 +207,13 @@ module Trailblazer
|
|
207
207
|
end
|
208
208
|
|
209
209
|
def input_output_dsl((ctx, flow_options), *)
|
210
|
-
|
210
|
+
config = ctx.select { |k,v| [:input, :output].include?(k) } # TODO: optimize this, we don't have to go through the entire hash.
|
211
211
|
|
212
|
-
return Trailblazer::Activity::Right, [ctx, flow_options]
|
212
|
+
return Trailblazer::Activity::Right, [ctx, flow_options] if config.size == 0 # no :input/:output passed.
|
213
213
|
|
214
214
|
new_ctx = {}
|
215
215
|
new_ctx[:extensions] ||= [] # FIXME
|
216
|
-
new_ctx[:extensions] += [Linear.VariableMapping(
|
216
|
+
new_ctx[:extensions] += [Linear.VariableMapping(**config)]
|
217
217
|
|
218
218
|
return Trailblazer::Activity::Right, [ctx.merge(new_ctx), flow_options]
|
219
219
|
end
|
@@ -4,20 +4,16 @@ module Trailblazer
|
|
4
4
|
module Linear
|
5
5
|
# Normalizer-steps to implement {:input} and {:output}
|
6
6
|
# Returns an Extension instance to be thrown into the `step` DSL arguments.
|
7
|
-
def self.VariableMapping(input
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
)
|
13
|
-
#)
|
7
|
+
def self.VariableMapping(input: VariableMapping.default_input, output: VariableMapping.default_output)
|
8
|
+
input =
|
9
|
+
VariableMapping::Input::Scoped.new(
|
10
|
+
Trailblazer::Option::KW( VariableMapping::filter_for(input) )
|
11
|
+
)
|
14
12
|
|
15
|
-
output =
|
13
|
+
output =
|
16
14
|
VariableMapping::Output::Unscoped.new(
|
17
15
|
Trailblazer::Option::KW( VariableMapping::filter_for(output) )
|
18
|
-
|
19
|
-
# id: :dsl_input_output
|
20
|
-
)
|
16
|
+
)
|
21
17
|
|
22
18
|
TaskWrap::Extension(
|
23
19
|
merge: TaskWrap::VariableMapping.merge_for(input, output, id: input.object_id), # wraps filters: {Input(input), Output(output)}
|
@@ -25,8 +21,23 @@ module Trailblazer
|
|
25
21
|
end
|
26
22
|
|
27
23
|
module VariableMapping
|
24
|
+
module_function
|
25
|
+
|
26
|
+
# @private
|
27
|
+
def default_output
|
28
|
+
->(scoped, **) do
|
29
|
+
_wrapped, mutable = scoped.decompose # `_wrapped` is what the `:input` filter returned, `mutable` is what the task wrote to `scoped`.
|
30
|
+
mutable
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
# @private
|
35
|
+
def default_input
|
36
|
+
->(ctx, **) { ctx }
|
37
|
+
end
|
38
|
+
|
28
39
|
# @private
|
29
|
-
def
|
40
|
+
def filter_for(filter)
|
30
41
|
if filter.is_a?(::Array) || filter.is_a?(::Hash)
|
31
42
|
DSL.filter_from_dsl(filter)
|
32
43
|
else
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trailblazer-activity-dsl-linear
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
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-06-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: trailblazer-activity
|