trailblazer-rails 2.4.0 → 2.4.1

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: fe070d02341d42cec07e9681ea5f846cf28e053c5c863bb60bf2252b80898b8c
4
- data.tar.gz: defcb8d97fc97fc542c62cb2d9f9051ccca365f1318921d239bb7b408122077c
3
+ metadata.gz: 1ac9dffebfdbbac3059ac33b30b6b3fc58958d10af2de83c0113c634e4def667
4
+ data.tar.gz: 74a09ebe5100532430d532c83c69ab5e7dccfe21bf0fdfbbf407af6268652cef
5
5
  SHA512:
6
- metadata.gz: 7b372914675637bb7d93377eac15c199abb6985f59f872025aaa1fc87da329b197733ddd9dc2ff4dc99b00668a49364566eb68181e1d14c1ce9feee6a7d00c71
7
- data.tar.gz: ad1efced8aea0c07de9d425f9cd131ccaf9aeccc5042a208de03a1d218729f5d23c2e7f1bb9e2b3cc00dac7cdf43da3bae50c7079025941d5dd13fd35e1ecba9
6
+ metadata.gz: dfd30ba60691fa98acd40e32498dd75a768a23783fd6f62dbf5fce4cfd67684b35bbf2b6ae384112a1acbad1ac65eb60d1c21d305c24c6c0f98fbefb6ae36a33
7
+ data.tar.gz: e95e9d4e38226bba64a06fb9483e815373ac5ed58ff41d8e5ae279042d5db3feac18e1cec4e06ea1784488d9e01ff044049a3b4472cd0b24f40d84e3a1f4d460
data/Appraisals CHANGED
@@ -7,8 +7,9 @@ appraise "rails-6.1" do
7
7
  gem "activerecord", "~> 6.1.0"
8
8
  end
9
9
  appraise "rails-7.0" do
10
- gem "actionpack", "~> 7.0.0.rc1"
11
- gem "activerecord", "~> 7.0.0.rc1"
10
+ gem "actionpack", "~> 7.0.0"
11
+ gem "activerecord", "~> 7.0.0"
12
+ gem "sqlite3", "~> 1.4.0"
12
13
  end
13
14
 
14
15
  appraise "rails-5.2" do
data/CHANGES.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 2.4.1
2
+
3
+ * Pass keyword arguments to the success result block
4
+
1
5
  # 2.4.0
2
6
  * Remove legacy code belonging to the old `trailblazer-loader` gem.
3
7
  * Use ActionController::API in addition to ActionController::Base to add the `run` method.
data/TESTING.md ADDED
@@ -0,0 +1,9 @@
1
+ Trailblazer-Rails supports rails 5.2.0 and up.
2
+
3
+ To run the tests, you need to have the run the following command:
4
+ ```
5
+ bundle install
6
+ bundle exec appraisal install # This will install the different version of rails
7
+ bundle exec appraisal rake db:create db:schema:load test # Run tests in all versions
8
+ bundle exec appraisal rails-7.0 rake db:create db:schema:load test # Run tests in rails 7.0 only
9
+ ```
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- trailblazer-rails (2.4.0)
4
+ trailblazer-rails (2.4.1)
5
5
  railties (>= 5.2.0)
6
6
  trailblazer (>= 2.1.0, < 2.2.0)
7
7
 
@@ -87,6 +87,8 @@ GEM
87
87
  capybara
88
88
  minitest (~> 5.0)
89
89
  rake
90
+ nokogiri (1.12.5-x86_64-darwin)
91
+ racc (~> 1.4)
90
92
  nokogiri (1.12.5-x86_64-linux)
91
93
  racc (~> 1.4)
92
94
  public_suffix (4.0.6)
@@ -160,6 +162,8 @@ GEM
160
162
  nokogiri (~> 1.8)
161
163
 
162
164
  PLATFORMS
165
+ x86_64-darwin-19
166
+ x86_64-darwin-21
163
167
  x86_64-linux
164
168
 
165
169
  DEPENDENCIES
@@ -180,4 +184,4 @@ DEPENDENCIES
180
184
  trailblazer-rails!
181
185
 
182
186
  BUNDLED WITH
183
- 2.2.33
187
+ 2.3.11
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- trailblazer-rails (2.4.0)
4
+ trailblazer-rails (2.4.1)
5
5
  railties (>= 5.2.0)
6
6
  trailblazer (>= 2.1.0, < 2.2.0)
7
7
 
@@ -86,6 +86,8 @@ GEM
86
86
  capybara
87
87
  minitest (~> 5.0)
88
88
  rake
89
+ nokogiri (1.12.5-x86_64-darwin)
90
+ racc (~> 1.4)
89
91
  nokogiri (1.12.5-x86_64-linux)
90
92
  racc (~> 1.4)
91
93
  public_suffix (4.0.6)
@@ -160,6 +162,8 @@ GEM
160
162
  zeitwerk (2.5.1)
161
163
 
162
164
  PLATFORMS
165
+ x86_64-darwin-19
166
+ x86_64-darwin-21
163
167
  x86_64-linux
164
168
 
165
169
  DEPENDENCIES
@@ -180,4 +184,4 @@ DEPENDENCIES
180
184
  trailblazer-rails!
181
185
 
182
186
  BUNDLED WITH
183
- 2.2.33
187
+ 2.3.11
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- trailblazer-rails (2.4.0)
4
+ trailblazer-rails (2.4.1)
5
5
  railties (>= 5.2.0)
6
6
  trailblazer (>= 2.1.0, < 2.2.0)
7
7
 
@@ -86,6 +86,8 @@ GEM
86
86
  capybara
87
87
  minitest (~> 5.0)
88
88
  rake
89
+ nokogiri (1.12.5-x86_64-darwin)
90
+ racc (~> 1.4)
89
91
  nokogiri (1.12.5-x86_64-linux)
90
92
  racc (~> 1.4)
91
93
  public_suffix (4.0.6)
@@ -159,6 +161,8 @@ GEM
159
161
  zeitwerk (2.5.1)
160
162
 
161
163
  PLATFORMS
164
+ x86_64-darwin-19
165
+ x86_64-darwin-21
162
166
  x86_64-linux
163
167
 
164
168
  DEPENDENCIES
@@ -179,4 +183,4 @@ DEPENDENCIES
179
183
  trailblazer-rails!
180
184
 
181
185
  BUNDLED WITH
182
- 2.2.33
186
+ 2.3.11
@@ -8,10 +8,10 @@ gem "reform-rails"
8
8
  gem "trailblazer"
9
9
  gem "trailblazer-cells"
10
10
  gem "trailblazer-loader"
11
- gem "sqlite3"
11
+ gem "sqlite3", "~> 1.4.0"
12
12
  gem "minitest-capybara"
13
13
  gem "appraisal"
14
- gem "actionpack", "~> 7.0.0.rc1"
15
- gem "activerecord", "~> 7.0.0.rc1"
14
+ gem "actionpack", "~> 7.0.0"
15
+ gem "activerecord", "~> 7.0.0"
16
16
 
17
17
  gemspec path: "../"
@@ -1,32 +1,32 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- trailblazer-rails (2.4.0)
4
+ trailblazer-rails (2.4.1)
5
5
  railties (>= 5.2.0)
6
6
  trailblazer (>= 2.1.0, < 2.2.0)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- actionpack (7.0.0.rc1)
12
- actionview (= 7.0.0.rc1)
13
- activesupport (= 7.0.0.rc1)
11
+ actionpack (7.0.3)
12
+ actionview (= 7.0.3)
13
+ activesupport (= 7.0.3)
14
14
  rack (~> 2.0, >= 2.2.0)
15
15
  rack-test (>= 0.6.3)
16
16
  rails-dom-testing (~> 2.0)
17
17
  rails-html-sanitizer (~> 1.0, >= 1.2.0)
18
- actionview (7.0.0.rc1)
19
- activesupport (= 7.0.0.rc1)
18
+ actionview (7.0.3)
19
+ activesupport (= 7.0.3)
20
20
  builder (~> 3.1)
21
21
  erubi (~> 1.4)
22
22
  rails-dom-testing (~> 2.0)
23
23
  rails-html-sanitizer (~> 1.1, >= 1.2.0)
24
- activemodel (7.0.0.rc1)
25
- activesupport (= 7.0.0.rc1)
26
- activerecord (7.0.0.rc1)
27
- activemodel (= 7.0.0.rc1)
28
- activesupport (= 7.0.0.rc1)
29
- activesupport (7.0.0.rc1)
24
+ activemodel (7.0.3)
25
+ activesupport (= 7.0.3)
26
+ activerecord (7.0.3)
27
+ activemodel (= 7.0.3)
28
+ activesupport (= 7.0.3)
29
+ activesupport (7.0.3)
30
30
  concurrent-ruby (~> 1.0, >= 1.0.2)
31
31
  i18n (>= 1.6, < 2)
32
32
  minitest (>= 5.1)
@@ -38,7 +38,7 @@ GEM
38
38
  rake
39
39
  thor (>= 0.14.0)
40
40
  builder (3.2.4)
41
- capybara (3.36.0)
41
+ capybara (3.37.1)
42
42
  addressable
43
43
  matrix
44
44
  mini_mime (>= 0.1.3)
@@ -55,10 +55,10 @@ GEM
55
55
  cells-erb (0.1.0)
56
56
  cells (~> 4.0)
57
57
  erbse (>= 0.1.1)
58
- cells-rails (0.1.4)
58
+ cells-rails (0.1.5)
59
59
  actionpack (>= 5.0)
60
60
  cells (>= 4.1.6, < 5.0.0)
61
- concurrent-ruby (1.1.9)
61
+ concurrent-ruby (1.1.10)
62
62
  crass (1.0.6)
63
63
  declarative (0.0.20)
64
64
  declarative-builder (0.1.0)
@@ -72,22 +72,24 @@ GEM
72
72
  erubi (1.10.0)
73
73
  hashie (5.0.0)
74
74
  hirb (0.7.3)
75
- i18n (1.8.11)
75
+ i18n (1.10.0)
76
76
  concurrent-ruby (~> 1.0)
77
- loofah (2.12.0)
77
+ loofah (2.18.0)
78
78
  crass (~> 1.0.2)
79
79
  nokogiri (>= 1.5.9)
80
80
  matrix (0.4.2)
81
81
  method_source (1.0.0)
82
82
  mini_mime (1.1.2)
83
- minitest (5.14.4)
83
+ minitest (5.15.0)
84
84
  minitest-capybara (0.9.0)
85
85
  capybara
86
86
  minitest (~> 5.0)
87
87
  rake
88
- nokogiri (1.12.5-x86_64-linux)
88
+ nokogiri (1.13.6-x86_64-darwin)
89
89
  racc (~> 1.4)
90
- public_suffix (4.0.6)
90
+ nokogiri (1.13.6-x86_64-linux)
91
+ racc (~> 1.4)
92
+ public_suffix (4.0.7)
91
93
  racc (1.6.0)
92
94
  rack (2.2.3)
93
95
  rack-test (1.1.0)
@@ -97,9 +99,9 @@ GEM
97
99
  nokogiri (>= 1.6)
98
100
  rails-html-sanitizer (1.4.2)
99
101
  loofah (~> 2.3)
100
- railties (7.0.0.rc1)
101
- actionpack (= 7.0.0.rc1)
102
- activesupport (= 7.0.0.rc1)
102
+ railties (7.0.3)
103
+ actionpack (= 7.0.3)
104
+ activesupport (= 7.0.3)
103
105
  method_source
104
106
  rake (>= 12.2)
105
107
  thor (~> 1.0)
@@ -112,40 +114,39 @@ GEM
112
114
  reform-rails (0.2.3)
113
115
  activemodel (>= 5.0)
114
116
  reform (>= 2.3.1, < 3.0.0)
115
- regexp_parser (2.2.0)
117
+ regexp_parser (2.4.0)
116
118
  representable (3.1.1)
117
119
  declarative (< 0.1.0)
118
120
  trailblazer-option (>= 0.1.1, < 0.2.0)
119
121
  uber (< 0.2.0)
120
122
  sqlite3 (1.4.2)
121
123
  temple (0.8.2)
122
- thor (1.1.0)
124
+ thor (1.2.1)
123
125
  tilt (2.0.10)
124
126
  trailblazer (2.1.0)
125
127
  trailblazer-macro (>= 2.1.0, < 2.2.0)
126
128
  trailblazer-macro-contract (>= 2.1.0, < 2.2.0)
127
129
  trailblazer-operation
128
- trailblazer-activity (0.12.2)
130
+ trailblazer-activity (0.13.0)
129
131
  trailblazer-context (~> 0.5.0)
130
132
  trailblazer-option (~> 0.1.0)
131
- trailblazer-activity-dsl-linear (0.4.3)
132
- trailblazer-activity (>= 0.12.2, < 0.13.0)
133
+ trailblazer-activity-dsl-linear (0.5.0)
134
+ trailblazer-activity (>= 0.13.0, < 1.0.0)
133
135
  trailblazer-cells (0.0.3)
134
136
  cells (>= 4.1.0.rc1, < 5.0.0)
135
137
  trailblazer-context (0.5.0)
136
138
  hashie (>= 3.0.0)
137
- trailblazer-developer (0.0.22)
139
+ trailblazer-developer (0.0.23)
138
140
  hirb
139
- representable (>= 3.1.1, < 4.0.0)
140
141
  trailblazer-activity (>= 0.12.2, < 1.0.0)
141
142
  trailblazer-activity-dsl-linear (>= 0.4.1, < 1.0.0)
142
143
  trailblazer-loader (0.1.2)
143
- trailblazer-macro (2.1.7)
144
- trailblazer-activity-dsl-linear (>= 0.4.0, < 0.5.0)
144
+ trailblazer-macro (2.1.9)
145
+ trailblazer-activity-dsl-linear (>= 0.5.0, < 0.6.0)
145
146
  trailblazer-operation (>= 0.7.0)
146
- trailblazer-macro-contract (2.1.1)
147
+ trailblazer-macro-contract (2.1.2)
147
148
  reform (>= 2.2.0, < 3.0.0)
148
- trailblazer-activity-dsl-linear (>= 0.4.0, < 0.5.0)
149
+ trailblazer-activity-dsl-linear (>= 0.5.0, < 0.6.0)
149
150
  trailblazer-operation (0.7.5)
150
151
  trailblazer-activity (>= 0.12.2, < 1.0.0)
151
152
  trailblazer-activity-dsl-linear (>= 0.4.1, < 1.0.0)
@@ -156,14 +157,16 @@ GEM
156
157
  uber (0.1.0)
157
158
  xpath (3.2.0)
158
159
  nokogiri (~> 1.8)
159
- zeitwerk (2.5.2)
160
+ zeitwerk (2.6.0)
160
161
 
161
162
  PLATFORMS
163
+ x86_64-darwin-19
164
+ x86_64-darwin-21
162
165
  x86_64-linux
163
166
 
164
167
  DEPENDENCIES
165
- actionpack (~> 7.0.0.rc1)
166
- activerecord (~> 7.0.0.rc1)
168
+ actionpack (~> 7.0.0)
169
+ activerecord (~> 7.0.0)
167
170
  appraisal
168
171
  bundler
169
172
  cells-erb
@@ -172,11 +175,11 @@ DEPENDENCIES
172
175
  minitest-capybara
173
176
  rake
174
177
  reform-rails
175
- sqlite3
178
+ sqlite3 (~> 1.4.0)
176
179
  trailblazer
177
180
  trailblazer-cells
178
181
  trailblazer-loader
179
182
  trailblazer-rails!
180
183
 
181
184
  BUNDLED WITH
182
- 2.2.33
185
+ 2.3.11
@@ -1,7 +1,7 @@
1
1
  module Trailblazer::Rails
2
2
  module Controller
3
3
  # TODO: deprecate {*dependencies}.
4
- def run_v21(operation, *dependencies, **variables)
4
+ def run_v21(operation, *dependencies, **variables, &block)
5
5
  result = if Rails.application.config.trailblazer.enable_tracing
6
6
  _run_operation_v21(operation, :trace, *dependencies, **variables).tap { |r| _operation_trace(r) }
7
7
  else
@@ -10,9 +10,15 @@ module Trailblazer::Rails
10
10
 
11
11
  _assign_trb_ivars(result)
12
12
 
13
- yield(result) if result.success? && block_given?
14
-
15
13
  @_result = result
14
+
15
+ return if result.failure? || block.nil?
16
+
17
+ if block.arity.eql?(1)
18
+ yield(result)
19
+ else
20
+ yield(result, **result.to_hash)
21
+ end
16
22
  end
17
23
 
18
24
  alias run run_v21 unless method_defined?(:run)
@@ -1,5 +1,5 @@
1
1
  module Trailblazer
2
2
  module Rails
3
- VERSION = "2.4.0".freeze
3
+ VERSION = "2.4.1".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trailblazer-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.0
4
+ version: 2.4.1
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-01-09 00:00:00.000000000 Z
11
+ date: 2022-06-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -101,6 +101,7 @@ files:
101
101
  - LICENSE.txt
102
102
  - README.md
103
103
  - Rakefile
104
+ - TESTING.md
104
105
  - gemfiles/rails_5.2.gemfile
105
106
  - gemfiles/rails_5.2.gemfile.lock
106
107
  - gemfiles/rails_6.0.gemfile
@@ -136,7 +137,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
136
137
  - !ruby/object:Gem::Version
137
138
  version: '0'
138
139
  requirements: []
139
- rubygems_version: 3.2.3
140
+ rubygems_version: 3.1.6
140
141
  signing_key:
141
142
  specification_version: 4
142
143
  summary: Convenient Rails support for Trailblazer.