trailblazer-activity-dsl-linear 0.2.9 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 979e2d306818d28e7dfaafbb9f312c1a1ad9e629d48466b37f1f86c11cb96263
4
- data.tar.gz: 1de9bba59e9ddfa45e2c330200294c3b5b45c214ecacbc89b4e6a0bebe3c3fb5
3
+ metadata.gz: fb92b49935156ee66dcf347cfe7b803cc3be0222ebf84ee676923e48bfb20ea2
4
+ data.tar.gz: 802be96cb11290483f4b326d9251933b7783f230dbf8cf6f6bf6781b64bb6a4e
5
5
  SHA512:
6
- metadata.gz: 25c6ec869be2f6802188e3ae3ea7f5db7e445fa36a3739f8224830d5543a1837b77d02a84ebd4cdc4cd5f61a99f243c1d01399afe5a82d7070289ee23e69f25b
7
- data.tar.gz: 58a92185b6dc1959a0698262123798493a72e0cef542c3c197b14f628793c8a9bb52b5cb11e995a04ec2fdfcced67a65dec0c3eedfada174cddc45727f03818b
6
+ metadata.gz: 3b408a672b9ad2ccbd09352ede7f47938f3506c687a7204ac762da44abd949a9788f61fd7dce096e41c222dafcbc6ee67c4ee304aede850f7f7ffcae90b42137
7
+ data.tar.gz: 4f13684ec5f770e321f713747460b095033ff39e2c1e9b67f9afc82ac69bec057d4f5e32f4342d88fb763344be9f710aa42e04026fcc44dd824d66a7517e4c69
data/CHANGES.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 0.3.0
2
+
3
+ * Fix circuit interface callable to make `step task: :instance_method` use circuit signature.
4
+
1
5
  # 0.2.9
2
6
 
3
7
  * The `Path()` helper, when used with `:end_task` will now automatically _append_ the end task (or terminus) to `End.success`.
@@ -54,22 +54,26 @@ module Trailblazer
54
54
  # Specific to the "step DSL": if the first argument is a callable, wrap it in a {step_interface_builder}
55
55
  # since its interface expects the step interface, but the circuit will call it with circuit interface.
56
56
  def normalize_step_interface((ctx, flow_options), *)
57
- options = case (step_args = ctx[:options]) # either a <#task> or {} from macro
57
+ options = case ctx[:options]
58
58
  when Hash
59
- # extract task for interfaces like `step task: :instance_method_name`
60
- step_args[:task].is_a?(Symbol) ? step_args[:task] : step_args
59
+ # Circuit Interface
60
+ task = ctx[:options].fetch(:task)
61
+
62
+ if task.is_a?(Symbol)
63
+ # step task: :find
64
+ { options: { task: Trailblazer::Option( task ) } }
65
+ else
66
+ # step task: Callable, ... (Subprocess, Proc, macros etc)
67
+ { task: task }
68
+ end
61
69
  else
62
- step_args
70
+ # Step Interface
71
+ # step :find, ...
72
+ # step Callable, ... (Method, Proc etc)
73
+ { options: { task: ctx[:options], wrap_task: true } }
63
74
  end
64
75
 
65
- unless options.is_a?(::Hash)
66
- # task = wrap_with_step_interface(task: options, step_interface_builder: ctx[:user_options][:step_interface_builder]) # TODO: make this optional with appropriate wiring.
67
- task = options
68
-
69
- ctx = ctx.merge(options: {task: task, wrap_task: true})
70
- end
71
-
72
- return Trailblazer::Activity::Right, [ctx, flow_options]
76
+ return Trailblazer::Activity::Right, [ctx.merge(options), flow_options]
73
77
  end
74
78
 
75
79
  def wrap_task_with_step_interface((ctx, flow_options), **)
@@ -3,7 +3,7 @@ module Trailblazer
3
3
  module Activity
4
4
  module DSL
5
5
  module Linear
6
- VERSION = "0.2.9"
6
+ VERSION = "0.3.0"
7
7
  end
8
8
  end
9
9
  end
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.2.9
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Sutterer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-07-02 00:00:00.000000000 Z
11
+ date: 2020-08-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: trailblazer-activity
@@ -135,8 +135,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
135
135
  - !ruby/object:Gem::Version
136
136
  version: '0'
137
137
  requirements: []
138
- rubyforge_project:
139
- rubygems_version: 2.7.6
138
+ rubygems_version: 3.0.8
140
139
  signing_key:
141
140
  specification_version: 4
142
141
  summary: Simple DSL to define Trailblazer activities.