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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 63f655777a97401ddf1ae5b1706757a7b284efbc6d5545397c00da0b4904a606
4
- data.tar.gz: 71b308182ed3ad9c27333c0fd818ec017309002a1c7588adf64a85b54fde714e
3
+ metadata.gz: eed1e7874a383c6c3dbc53924149998cf286da7c706121eaa4b169d06f98ba68
4
+ data.tar.gz: 838e7936ee1d37a8d5e546276e9be7afb3c9eaebb103f0dfd65224182c7e351e
5
5
  SHA512:
6
- metadata.gz: d2372fb0f13931fb7e08a2e60cff6d9f4850b74a3d17b5661ad3a9853a460fd855656117387d685d6135306d1f67e27e26350c5e1ef07b29c2b16990fda5c874
7
- data.tar.gz: cda2f29f0892f0d7c20d5c8af862e1076bec5a2c8849c307d53af92b09214720293e637fd6163690a76e7c9de282017743eb9c31107f3648329300a076d650db
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
- options = circuit_options.any? ? circuit_options : options # This is needed in Ruby 3 for {Create.(params: {})} calls.
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
 
@@ -1,7 +1,7 @@
1
1
  module Trailblazer
2
2
  module Version
3
3
  module Operation
4
- VERSION = "0.7.1"
4
+ VERSION = "0.7.2"
5
5
  end
6
6
  end
7
7
  end
@@ -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.1
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-04 00:00:00.000000000 Z
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.0.8
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.
data/.travis.yml DELETED
@@ -1,11 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - ruby-head
4
- - 3.0
5
- - 2.7
6
- - 2.6
7
- - 2.5
8
- - 2.4
9
- jobs:
10
- allow_failures:
11
- - rvm: ruby-head