trailblazer-operation 0.5.2 → 0.5.3

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: 0cc08959bec35098c45918f83eba640b3557e77f995864c58d3b1a02f199b946
4
- data.tar.gz: f1ce8be398f2156b2b3d5bebf2ee62cf36b4c9e661c9cfc88fbffa9c9f0832ce
3
+ metadata.gz: 875146eae94f05d2e60acc090d469dc3b65ed5278a26afa50787adce1ff490f3
4
+ data.tar.gz: 72c01e7685f4487542b0294ce8d063ed53bbb3becd64c94143516212f8fc4dc1
5
5
  SHA512:
6
- metadata.gz: 73d31c57d4c5c5e8e35d2f2e4a9da147ce62a4238918bbd8922b5d479918a3ca20dd5437eebe3dcb88f5f0ab97977693f50252676ee312a9759b6201e58e0447
7
- data.tar.gz: 110a6eea4813a1c6e22595bd5be9fd6bd0d3bbe4040f938bb0aac92396570a9565b4a7baca44ad50729881627872135b698532045938eccb31a67adab1e0f301
6
+ metadata.gz: a6be7ff9ec4e78446595d50a4b53c9d7c992f3045fb5b14fe38c6d1f6c4b5a220c4f18a75bfc25f8364e5aeff8a6c1124c5d184cdc55361ed67219f6ddbdd0fc
7
+ data.tar.gz: c7f329498fc3e0dcafaa4929fa7624b851304ec8b8cc3aba9dda4bf4a3f7d578da7aa3e186914e8e192116748252ba6a08661693a5e8a40e08411b309818716a
data/CHANGES.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.5.3
2
+
3
+ * New `context` API.
4
+
1
5
  ## 0.5.2
2
6
 
3
7
  * Use `trailblazer-activity-dsl-linear-0.1.6.`
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: "../trailblazer-developer"
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-context", path: "../trailblazer-context"
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 args.any? && args[0].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.
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.for(options, [options, {}], {})
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, *args)
6
- ctx = PublicCall.options_for_public_call(*args) # redundant with PublicCall::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(*args)
22
- Trace.(self, *args)
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.
@@ -1,7 +1,7 @@
1
1
  module Trailblazer
2
2
  module Version
3
3
  module Operation
4
- VERSION = "0.5.2"
4
+ VERSION = "0.5.3"
5
5
  end
6
6
  end
7
7
  end
@@ -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.6", "< 1.0.0"
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.2
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-07-19 00:00:00.000000000 Z
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.6
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.6
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.3
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.