trailblazer-activity 0.8.4 → 0.9.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: 73ac40ea6f639442695a8e2f31a28e100ccf5daf762075967a41fb5f4f71d10a
4
- data.tar.gz: 9881d9eb6814208c514992f786b994802deb4481e20b2d6ab14fb58ebc28ad47
3
+ metadata.gz: 5f50cd0494bec7054e6dda24aaf8d2a2aff9575aa4c6a0e5a4ee2a526ba01eb3
4
+ data.tar.gz: 0ed8764ab5f77fceeae9c097c151514e797146f755672434ea38dfcf521c95ef
5
5
  SHA512:
6
- metadata.gz: 4632b1fe8b23f3484e415e5bea8844969f3ad5aea9a9414c31b225ed5590aa845579bd800b8caa45821a44e117f0750c22aedcc2bab23dc805b1d6045d57b0e4
7
- data.tar.gz: e40ef9e003f8a99b2da766bc1a0021729e08cf6f298948998eaaf32c4c3689dc39496cbe4c168d323c8014816e81527e68050a0d25a3799cb34c1bb703e3d980
6
+ metadata.gz: 40da5dd6bd2ff3379609261e4270e4071cee4cac78d710300d043e11b8780b90dff4bd898fb8b0972410d0d19f92967c90e1141931e96737e35bbe510a925092
7
+ data.tar.gz: '00863321ebfb71d0b2799e88c0c7b9af9bc7781b44887bbbc5566720633f5c650de8992332eac6b75cf25438d9d6204da89c7d1d118d166b1a30da41da1b1aa2'
data/CHANGES.md CHANGED
@@ -1,3 +1,9 @@
1
+ # 0.9.0
2
+
3
+ * Change API of `Input`/`Output` filters. Instead of calling them with `original_ctx, circuit_options` they're now called with the complete (original!) circuit interface. This simplifies calling and provides all circuit arguments to the filter which can then filter-out what is not needed.
4
+ * `:input` is now called with `((original_ctx, flow_options), circuit_options)`
5
+ * `:output` is now called with `(new_ctx, (original_ctx, flow_options), circuit_options)`
6
+
1
7
  # 0.8.4
2
8
  * Update `Present` to render `Developer.wtf?` for given activity fearlessly
3
9
 
data/Gemfile CHANGED
@@ -8,6 +8,6 @@ gem "minitest-line"
8
8
 
9
9
  gem "rubocop", require: false
10
10
 
11
- # gem "trailblazer-context", path: "../trailblazer-context"
11
+ gem "trailblazer-context", path: "../trailblazer-context"
12
12
  # gem "trailblazer-developer", path: "../trailblazer-developer"
13
13
  # gem "trailblazer-developer", github: "trailblazer/trailblazer-developer", branch: "exception-tracing"
data/LICENSE ADDED
@@ -0,0 +1,9 @@
1
+ Copyright (c) 2018 Trailblazer GmbH
2
+
3
+ Trailblazer is an Open Source project licensed under the terms of
4
+ the LGPLv3 license. Please see <http://www.gnu.org/licenses/lgpl-3.0.html>
5
+ for license text.
6
+
7
+ Trailblazer PRO has a commercial-friendly license allowing private forks
8
+ and modifications of Trailblazer. Please see http://trailblazer.to/pro for
9
+ more detail.
@@ -8,7 +8,7 @@ class Trailblazer::Activity
8
8
 
9
9
  def Extension(defaults)
10
10
  # Returns new ctx.
11
- input = ->(original_ctx) do
11
+ input = ->((original_ctx, flow_options), circuit_options) do
12
12
  defaulted_options = defaults_for(defaults, original_ctx)
13
13
 
14
14
  ctx = original_ctx.merge(defaulted_options)
@@ -16,7 +16,7 @@ class Trailblazer::Activity
16
16
  Trailblazer::Context.for(ctx, [original_ctx, {}], {})
17
17
  end
18
18
 
19
- output = ->(original_ctx, new_ctx) { # FIXME: use Unscope
19
+ output = ->(new_ctx, (original_ctx, flow_options), circuit_options) { # FIXME: use Unscope
20
20
  _, mutable_data = new_ctx.decompose
21
21
 
22
22
  # we are only interested in the {mutable_data} part since the disposed part
@@ -9,9 +9,6 @@ class Trailblazer::Activity
9
9
  module VariableMapping
10
10
  # The taskWrap extension that's included into the static taskWrap for a task.
11
11
  def self.Extension(input, output, id: input.object_id)
12
- input = Trailblazer::Option(input)
13
- output = Trailblazer::Option(output)
14
-
15
12
  Trailblazer::Activity::TaskWrap::Extension(
16
13
  merge: merge_for(input, output, id: id),
17
14
  )
@@ -58,8 +55,9 @@ class Trailblazer::Activity
58
55
 
59
56
  private
60
57
 
58
+ # Invoke the @filter callable with the original circuit interface.
61
59
  def apply_filter((ctx, original_flow_options), original_circuit_options)
62
- @filter.( ctx, original_circuit_options ) # returns {new_ctx}.
60
+ @filter.([ctx, original_flow_options], original_circuit_options) # returns {new_ctx}.
63
61
  end
64
62
  end
65
63
 
@@ -78,7 +76,7 @@ class Trailblazer::Activity
78
76
  returned_ctx, _ = wrap_ctx[:return_args] # this is the Context returned from {call}ing the wrapped user task.
79
77
  original_ctx = wrap_ctx[@id] # grab the original ctx from before which was set in the {:input} filter.
80
78
  # let user compute the output.
81
- output_ctx = @filter.(original_ctx, returned_ctx, **original_circuit_options)
79
+ output_ctx = @filter.(returned_ctx, [original_ctx, original_flow_options], original_circuit_options)
82
80
 
83
81
  wrap_ctx = wrap_ctx.merge( return_args: [output_ctx, original_flow_options] )
84
82
 
@@ -1,7 +1,7 @@
1
1
  module Trailblazer
2
2
  module Version
3
3
  module Activity
4
- VERSION = "0.8.4"
4
+ VERSION = "0.9.0"
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trailblazer-activity
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.4
4
+ version: 0.9.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: 2019-08-23 00:00:00.000000000 Z
11
+ date: 2019-09-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: trailblazer-context
@@ -94,6 +94,7 @@ files:
94
94
  - ".travis.yml"
95
95
  - CHANGES.md
96
96
  - Gemfile
97
+ - LICENSE
97
98
  - NOTES
98
99
  - README.md
99
100
  - Rakefile