trailblazer-operation 0.7.1 → 0.7.2
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 +17 -0
- data/CHANGES.md +4 -0
- data/lib/trailblazer/operation/public_call.rb +3 -2
- data/lib/trailblazer/operation/version.rb +1 -1
- data/test/operation_test.rb +11 -0
- metadata +4 -4
- data/.travis.yml +0 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eed1e7874a383c6c3dbc53924149998cf286da7c706121eaa4b169d06f98ba68
|
4
|
+
data.tar.gz: 838e7936ee1d37a8d5e546276e9be7afb3c9eaebb103f0dfd65224182c7e351e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ae508e32c10a27a85c46a269db6c03476bdb81b37db36c4161894e0b8b1ae8e37060c2b74beb7ee3a81005be0c44bc7ee6396525ab08dfef17c481a85d3c1c31
|
7
|
+
data.tar.gz: 87d9da3817bf539e053ad615c0ff880677f6436450afd146008d35e236ebc1de06421416f70f9e6051c28941fca9da22d761d9f7d4175c154e9068ca9b47030e
|
@@ -0,0 +1,17 @@
|
|
1
|
+
name: CI
|
2
|
+
on: [push, pull_request]
|
3
|
+
jobs:
|
4
|
+
test:
|
5
|
+
strategy:
|
6
|
+
fail-fast: false
|
7
|
+
matrix:
|
8
|
+
# Due to https://github.com/actions/runner/issues/849, we have to use quotes for '3.0'
|
9
|
+
ruby: [2.5, 2.6, 2.7, '3.0', head, jruby, jruby-head]
|
10
|
+
runs-on: ubuntu-latest
|
11
|
+
steps:
|
12
|
+
- uses: actions/checkout@v2
|
13
|
+
- uses: ruby/setup-ruby@v1
|
14
|
+
with:
|
15
|
+
ruby-version: ${{ matrix.ruby }}
|
16
|
+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
17
|
+
- run: bundle exec rake
|
data/CHANGES.md
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
## 0.7.2
|
2
|
+
|
3
|
+
* Bugfix: when calling `Operation.call(params: {}, "current_user" => user)` the stringified variables got lost in Ruby < 3.
|
4
|
+
|
1
5
|
## 0.7.1
|
2
6
|
|
3
7
|
* In `Operation.call_with_public_interface`, pass `self` and not `@activity` to the `invoke`r. This fixes tracing as it now catches the actual Operation class, not an activity instance.
|
@@ -29,8 +29,9 @@ module Trailblazer
|
|
29
29
|
def call_with_public_interface(options, flow_options, invoke_class: Activity::TaskWrap, **circuit_options)
|
30
30
|
flow_options = flow_options_for_public_call(flow_options)
|
31
31
|
|
32
|
-
|
33
|
-
|
32
|
+
# In Ruby < 3, calling Op.(params: {}, "current_user" => user) results in both {circuit_options} and {options} containing variables.
|
33
|
+
# In Ruby 3.0, **circuit_options is always empty.
|
34
|
+
options = circuit_options.any? ? circuit_options.merge(options) : options
|
34
35
|
|
35
36
|
ctx = options_for_public_call(options, flow_options)
|
36
37
|
|
data/test/operation_test.rb
CHANGED
@@ -95,6 +95,17 @@ class DeclarativeApiTest < Minitest::Spec
|
|
95
95
|
Unset. ("params" => {decide: true}).inspect("a", "b", "c", "d", "e").must_equal %{<Result:true [false, true, nil, 1, 2] >}
|
96
96
|
end
|
97
97
|
|
98
|
+
# Mixing keywords and string keys in {Operation.call}.
|
99
|
+
# Test that {.(params: {}, "current_user" => user)} is processed properly
|
100
|
+
class Collect < Trailblazer::Operation
|
101
|
+
# step ->(ctx, **) { ctx[:keys] }
|
102
|
+
end
|
103
|
+
|
104
|
+
it "contains all keys from {call}" do
|
105
|
+
result = Collect.(params: {}, "current_user" => Module)
|
106
|
+
_(result.inspect).must_equal %{<Result:true #<Trailblazer::Context::Container wrapped_options={:params=>{}, \"current_user\"=>Module} mutable_options={}> >}
|
107
|
+
end
|
108
|
+
|
98
109
|
#---
|
99
110
|
#- ctx container
|
100
111
|
it do
|
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.7.
|
4
|
+
version: 0.7.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nick Sutterer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-03-
|
11
|
+
date: 2021-03-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: trailblazer-activity-dsl-linear
|
@@ -107,10 +107,10 @@ executables: []
|
|
107
107
|
extensions: []
|
108
108
|
extra_rdoc_files: []
|
109
109
|
files:
|
110
|
+
- ".github/workflows/ci.yml"
|
110
111
|
- ".gitignore"
|
111
112
|
- ".rubocop.yml"
|
112
113
|
- ".rubocop_todo.yml"
|
113
|
-
- ".travis.yml"
|
114
114
|
- CHANGES.md
|
115
115
|
- Gemfile
|
116
116
|
- README.md
|
@@ -170,7 +170,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
170
170
|
- !ruby/object:Gem::Version
|
171
171
|
version: '0'
|
172
172
|
requirements: []
|
173
|
-
rubygems_version: 3.
|
173
|
+
rubygems_version: 3.2.3
|
174
174
|
signing_key:
|
175
175
|
specification_version: 4
|
176
176
|
summary: Trailblazer's operation object with railway flow and integrated error handling.
|