trailblazer-macro-contract 2.1.3 → 2.1.4
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 +6 -4
- data/.github/workflows/ci_jruby.yml +19 -0
- data/.github/workflows/ci_legacy.yml +19 -0
- data/.github/workflows/ci_truffleruby.yml +19 -0
- data/CHANGES.md +4 -0
- data/lib/trailblazer/macro/contract/build.rb +1 -19
- data/lib/trailblazer/macro/contract/persist.rb +1 -1
- data/lib/trailblazer/macro/contract/version.rb +1 -1
- data/test/docs/contract_test.rb +12 -12
- data/trailblazer-macro-contract.gemspec +2 -2
- metadata +11 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0f83a1f35a36e1e84cdc5075c91c7d564b860f2edcddec3665a2f391c9f253ed
|
4
|
+
data.tar.gz: 171070dc6bb8454986fa101d81905ab661ef51aebe13a935ffa8fa149d62eda4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bf7333622c75b4f77636de44021e5d33ff80555042a2e772bf87a1db5e470a6a95afd29a1d84d61905b4f7e5108f3328731ee819e2d08ab87b589bbeba2f5f70
|
7
|
+
data.tar.gz: e3aad011ea7111117048736d2077c2b980959640e683a1259caf1f8a413d93737d08b6a00245ecaa64dd19dee1d17d9bbe97304f1688ef4df81f45040a0897d0
|
data/.github/workflows/ci.yml
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
## This file is managed by Terraform.
|
2
|
+
## Do not modify this file directly, as it may be overwritten.
|
3
|
+
## Please open an issue instead.
|
1
4
|
name: CI
|
2
5
|
on: [push, pull_request]
|
3
6
|
jobs:
|
@@ -5,13 +8,12 @@ jobs:
|
|
5
8
|
strategy:
|
6
9
|
fail-fast: false
|
7
10
|
matrix:
|
8
|
-
|
9
|
-
ruby: [2.6, 2.7, '3.0', jruby]
|
11
|
+
ruby: [2.7, '3.0', '3.1']
|
10
12
|
runs-on: ubuntu-latest
|
11
13
|
steps:
|
12
|
-
- uses: actions/checkout@
|
14
|
+
- uses: actions/checkout@v3
|
13
15
|
- uses: ruby/setup-ruby@v1
|
14
16
|
with:
|
15
17
|
ruby-version: ${{ matrix.ruby }}
|
16
|
-
bundler-cache: true
|
18
|
+
bundler-cache: true
|
17
19
|
- run: bundle exec rake
|
@@ -0,0 +1,19 @@
|
|
1
|
+
## This file is managed by Terraform.
|
2
|
+
## Do not modify this file directly, as it may be overwritten.
|
3
|
+
## Please open an issue instead.
|
4
|
+
name: CI JRuby
|
5
|
+
on: [push, pull_request]
|
6
|
+
jobs:
|
7
|
+
test:
|
8
|
+
strategy:
|
9
|
+
fail-fast: false
|
10
|
+
matrix:
|
11
|
+
ruby: [jruby, jruby-head]
|
12
|
+
runs-on: ubuntu-latest
|
13
|
+
steps:
|
14
|
+
- uses: actions/checkout@v3
|
15
|
+
- uses: ruby/setup-ruby@v1
|
16
|
+
with:
|
17
|
+
ruby-version: ${{ matrix.ruby }}
|
18
|
+
bundler-cache: true
|
19
|
+
- run: bundle exec rake
|
@@ -0,0 +1,19 @@
|
|
1
|
+
## This file is managed by Terraform.
|
2
|
+
## Do not modify this file directly, as it may be overwritten.
|
3
|
+
## Please open an issue instead.
|
4
|
+
name: CI with EOL ruby versions
|
5
|
+
on: [push, pull_request]
|
6
|
+
jobs:
|
7
|
+
test:
|
8
|
+
strategy:
|
9
|
+
fail-fast: false
|
10
|
+
matrix:
|
11
|
+
ruby: [2.5, 2.6]
|
12
|
+
runs-on: ubuntu-latest
|
13
|
+
steps:
|
14
|
+
- uses: actions/checkout@v3
|
15
|
+
- uses: ruby/setup-ruby@v1
|
16
|
+
with:
|
17
|
+
ruby-version: ${{ matrix.ruby }}
|
18
|
+
bundler-cache: true
|
19
|
+
- run: bundle exec rake
|
@@ -0,0 +1,19 @@
|
|
1
|
+
## This file is managed by Terraform.
|
2
|
+
## Do not modify this file directly, as it may be overwritten.
|
3
|
+
## Please open an issue instead.
|
4
|
+
name: CI TruffleRuby
|
5
|
+
on: [push, pull_request]
|
6
|
+
jobs:
|
7
|
+
test:
|
8
|
+
strategy:
|
9
|
+
fail-fast: false
|
10
|
+
matrix:
|
11
|
+
ruby: [truffleruby, truffleruby-head]
|
12
|
+
runs-on: ubuntu-latest
|
13
|
+
steps:
|
14
|
+
- uses: actions/checkout@v3
|
15
|
+
- uses: ruby/setup-ruby@v1
|
16
|
+
with:
|
17
|
+
ruby-version: ${{ matrix.ruby }}
|
18
|
+
bundler-cache: true
|
19
|
+
- run: bundle exec rake
|
data/CHANGES.md
CHANGED
@@ -2,22 +2,6 @@ require "reform"
|
|
2
2
|
|
3
3
|
module Trailblazer
|
4
4
|
module Macro
|
5
|
-
# This Circuit-task calls the {task} Option, then allows
|
6
|
-
# to run an arbitary block to process the option's result.
|
7
|
-
# @private
|
8
|
-
class CircuitTaskWithResultProcessing < Activity::TaskBuilder::Task # DISCUSS: extract to public?
|
9
|
-
def initialize(task, user_proc, block)
|
10
|
-
@block = block
|
11
|
-
super(task, user_proc)
|
12
|
-
end
|
13
|
-
|
14
|
-
def call_option(task_with_option_interface, (ctx, flow_options), **circuit_options)
|
15
|
-
result = super
|
16
|
-
|
17
|
-
@block.call(result, ctx)
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
5
|
module Contract
|
22
6
|
def self.Build(name: "default", constant: nil, builder: nil)
|
23
7
|
contract_path = :"contract.#{name}"
|
@@ -48,9 +32,7 @@ module Trailblazer
|
|
48
32
|
task_option_proc = builder ? builder : default_contract_builder
|
49
33
|
|
50
34
|
# after the builder proc is run, assign its result to {:"contract.default"}.
|
51
|
-
|
52
|
-
|
53
|
-
task = CircuitTaskWithResultProcessing.new(Trailblazer::Option(task_option_proc), task_option_proc, ctx_assign_block)
|
35
|
+
task = Macro.task_adapter_for_decider(task_option_proc, variable_name: contract_path)
|
54
36
|
|
55
37
|
{
|
56
38
|
task: task, id: "contract.build",
|
data/test/docs/contract_test.rb
CHANGED
@@ -56,20 +56,20 @@ class DocsContractOverviewTest < Minitest::Spec
|
|
56
56
|
|
57
57
|
it "shows 2-level tracing" do
|
58
58
|
result = Create.trace( params: { length: "A" } )
|
59
|
-
result.wtf.gsub(/0x\w+/, "").must_equal %{
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
59
|
+
result.wtf.gsub(/0x\w+/, "").must_equal %{DocsContractOverviewTest::Create
|
60
|
+
|-- Start.default
|
61
|
+
|-- model.build
|
62
|
+
|-- contract.build
|
63
|
+
|-- contract.default.validate
|
64
|
+
| |-- Start.default
|
65
|
+
| |-- contract.default.params_extract
|
66
|
+
| |-- contract.default.call
|
67
|
+
| `-- End.failure
|
68
|
+
`-- End.failure}
|
69
69
|
end
|
70
70
|
|
71
71
|
# internal variables from {:builder} are excluded in public ctx.
|
72
|
-
it { Create.(params: {}).keys.inspect.must_equal %{[:params, :model, :\"
|
72
|
+
it { Create.(params: {}).keys.inspect.must_equal %{[:params, :model, :\"contract.default\", :\"contract.default.params\", :\"representer.default.class\", :\"result.contract.default\"]} }
|
73
73
|
end
|
74
74
|
|
75
75
|
#---
|
@@ -594,7 +594,7 @@ class DocContractBuilderTest < Minitest::Spec
|
|
594
594
|
it { Create.(params: {}).inspect(:model).must_equal %{<Result:false [#<struct DocContractBuilderTest::Song id=nil, title=nil>] >} }
|
595
595
|
it { Create.(params: { title: "title"}, current_user: Module).inspect(:model).must_equal %{<Result:true [#<struct DocContractBuilderTest::Song id=nil, title="title">] >} }
|
596
596
|
# internal variables from {:builder} are excluded in public ctx.
|
597
|
-
it { Create.(params: {}).keys.inspect.must_equal %{[:params, :model, :\"
|
597
|
+
it { Create.(params: {}).keys.inspect.must_equal %{[:params, :model, :\"contract.default\", :\"contract.default.params\", :\"representer.default.class\", :\"result.contract.default\"]} }
|
598
598
|
end
|
599
599
|
|
600
600
|
class DocContractTest < Minitest::Spec
|
@@ -23,14 +23,14 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.add_development_dependency "bundler"
|
24
24
|
spec.add_development_dependency "dry-validation"
|
25
25
|
spec.add_development_dependency "reform-rails", "~> 0.2.0.rc2"
|
26
|
-
spec.add_development_dependency "trailblazer-macro", ">= 2.1.
|
26
|
+
spec.add_development_dependency "trailblazer-macro", ">= 2.1.12"
|
27
27
|
spec.add_development_dependency "trailblazer-developer"
|
28
28
|
spec.add_development_dependency "activemodel", "~> 6.0.0" # FIXME: we still don't support the Rails 6.1 errors object.
|
29
29
|
|
30
30
|
spec.add_development_dependency "minitest"
|
31
31
|
spec.add_development_dependency "rake"
|
32
32
|
|
33
|
-
spec.add_dependency "trailblazer-activity-dsl-linear", ">= 1.
|
33
|
+
spec.add_dependency "trailblazer-activity-dsl-linear", ">= 1.1.0", "< 1.2.0"
|
34
34
|
|
35
35
|
spec.required_ruby_version = ">= 2.0.0"
|
36
36
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trailblazer-macro-contract
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nick Sutterer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-12-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: reform
|
@@ -78,14 +78,14 @@ dependencies:
|
|
78
78
|
requirements:
|
79
79
|
- - ">="
|
80
80
|
- !ruby/object:Gem::Version
|
81
|
-
version: 2.1.
|
81
|
+
version: 2.1.12
|
82
82
|
type: :development
|
83
83
|
prerelease: false
|
84
84
|
version_requirements: !ruby/object:Gem::Requirement
|
85
85
|
requirements:
|
86
86
|
- - ">="
|
87
87
|
- !ruby/object:Gem::Version
|
88
|
-
version: 2.1.
|
88
|
+
version: 2.1.12
|
89
89
|
- !ruby/object:Gem::Dependency
|
90
90
|
name: trailblazer-developer
|
91
91
|
requirement: !ruby/object:Gem::Requirement
|
@@ -148,20 +148,20 @@ dependencies:
|
|
148
148
|
requirements:
|
149
149
|
- - ">="
|
150
150
|
- !ruby/object:Gem::Version
|
151
|
-
version: 1.
|
151
|
+
version: 1.1.0
|
152
152
|
- - "<"
|
153
153
|
- !ruby/object:Gem::Version
|
154
|
-
version: 1.
|
154
|
+
version: 1.2.0
|
155
155
|
type: :runtime
|
156
156
|
prerelease: false
|
157
157
|
version_requirements: !ruby/object:Gem::Requirement
|
158
158
|
requirements:
|
159
159
|
- - ">="
|
160
160
|
- !ruby/object:Gem::Version
|
161
|
-
version: 1.
|
161
|
+
version: 1.1.0
|
162
162
|
- - "<"
|
163
163
|
- !ruby/object:Gem::Version
|
164
|
-
version: 1.
|
164
|
+
version: 1.2.0
|
165
165
|
description: Operation macros for form objects
|
166
166
|
email:
|
167
167
|
- apotonick@gmail.com
|
@@ -170,6 +170,9 @@ extensions: []
|
|
170
170
|
extra_rdoc_files: []
|
171
171
|
files:
|
172
172
|
- ".github/workflows/ci.yml"
|
173
|
+
- ".github/workflows/ci_jruby.yml"
|
174
|
+
- ".github/workflows/ci_legacy.yml"
|
175
|
+
- ".github/workflows/ci_truffleruby.yml"
|
173
176
|
- ".gitignore"
|
174
177
|
- ".rubocop-https---raw-githubusercontent-com-trailblazer-meta-master-rubocop-yml"
|
175
178
|
- ".rubocop.yml"
|