Skip to content

Commit 3422a7a

Browse files
committed
Merge branch 'master' of github.com:trailblazer/trailblazer-macro
2 parents 4528ae8 + e92ded4 commit 3422a7a

File tree

5 files changed

+24
-24
lines changed

5 files changed

+24
-24
lines changed

lib/trailblazer/macro/strategy.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module Macro
44
class Strategy # We want to look like a real {Linear::Strategy}.
55
class << self
66
extend Forwardable
7-
def_delegators :block_activity, :step, :pass, :fail, :Subprocess # TODO: add all DSL::Helper
7+
def_delegators :block_activity, :step, :pass, :fail, :left, :Subprocess # TODO: add all DSL::Helper
88
end
99

1010
# This makes {Wrap} look like {block_activity}.

test/docs/autogenerated/operation_each_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
# step Macro::Each(:report_templates, key: :report_template) {
66
# step Subprocess(ReportTemplate::Update), input: :input_report_template
7-
# fail :set_report_template_errors
7+
# left :set_report_template_errors
88
# }
99

1010
# def report_templates(ctx, **) ctx["result.contract.default"].report_templates

test/docs/each_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
# step Macro::Each(:report_templates, key: :report_template) {
55
# step Subprocess(ReportTemplate::Update), input: :input_report_template
6-
# fail :set_report_template_errors
6+
# left :set_report_template_errors
77
# }
88

99
# def report_templates(ctx, **) ctx["result.contract.default"].report_templates

test/docs/rescue_test.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ class NestedInsanity < Trailblazer::Operation
1717
step ->(options, **) { options["b"] = true }
1818
pass ->(options, **) { raise A if options["raise-a"] }
1919
step ->(options, **) { options["c"] = true }
20-
fail ->(options, **) { options["inner-err"] = true }
20+
left ->(options, **) { options["inner-err"] = true }
2121
}
2222
step ->(options, **) { options["e"] = true }, id: "nested/e"
23-
fail ->(options, **) { options["outer-err"] = true }, id: "nested/failure"
23+
left ->(options, **) { options["outer-err"] = true }, id: "nested/failure"
2424
end
2525

2626
it { assert_match /\[>Rescue\/.{1,3},>nested/, Trailblazer::Developer.railway(NestedInsanity) } # FIXME: better introspect tests for all id-generating macros.
@@ -54,7 +54,7 @@ class Song::Activity::Create < Trailblazer::Activity::Railway
5454
step :rehash
5555
}
5656
step :notify
57-
fail :log_error
57+
left :log_error
5858
#~methods
5959
include T.def_steps(:create_model, :upload, :notify, :log_error)
6060
include Rehash
@@ -91,7 +91,7 @@ class Song::Activity::Create < Trailblazer::Activity::Railway
9191
step :rehash
9292
}
9393
step :notify
94-
fail :log_error
94+
left :log_error
9595
#~methods
9696
include T.def_steps(:create_model, :upload, :notify, :log_error)
9797
include Rehash
@@ -125,7 +125,7 @@ class Memo::Create < Trailblazer::Operation
125125
step :rehash
126126
}
127127
step :notify
128-
fail :log_error
128+
left :log_error
129129
include T.def_steps(:find_model, :update, :notify, :log_error)
130130
include Rehash
131131
end
@@ -148,7 +148,7 @@ class Memo::Create < Trailblazer::Operation
148148
step :rehash
149149
}
150150
step :notify
151-
fail :log_error
151+
left :log_error
152152
#~methods
153153
include T.def_steps(:find_model, :update, :notify, :log_error)
154154
include Rehash
@@ -180,7 +180,7 @@ class Memo::Create < Trailblazer::Operation
180180
step :find_model
181181
step Rescue(&rescue_block), fail_fast: true
182182
step :notify
183-
fail :log_error
183+
left :log_error
184184
#~methods
185185
include T.def_steps(:find_model, :update, :notify, :log_error, :rehash)
186186
end

test/docs/wrap_test.rb

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class Upload < Trailblazer::Activity::FastTrack
2626
step :transfer # this might even break!
2727
}
2828
step :notify
29-
fail :log_error
29+
left :log_error
3030
#~meths
3131
include T.def_steps(:model, :update, :transfer, :notify, :log_error)
3232
#~meths end
@@ -63,7 +63,7 @@ class Upload < Trailblazer::Activity::FastTrack
6363
Output(:timeout) => Track(:fail_fast) # any wiring is possible here.
6464
#:out end
6565
step :notify
66-
fail :log_error
66+
left :log_error
6767
#~meths
6868
include T.def_steps(:model, :update, :transfer, :notify, :log_error)
6969
#~meths end
@@ -109,7 +109,7 @@ class Upload < Trailblazer::Activity::FastTrack
109109
step :transfer # might raise an exception.
110110
}
111111
step :notify
112-
fail :log_error
112+
left :log_error
113113
#~meths
114114
include T.def_steps(:model, :update, :transfer, :notify, :log_error)
115115
def transfer(ctx, seq:, transfer: true, **)
@@ -157,7 +157,7 @@ class Memo::Create < Trailblazer::Operation
157157
step :rehash
158158
}
159159
step :notify
160-
fail :log_error
160+
left :log_error
161161
#~methods
162162
include T.def_steps(:model, :update, :notify, :log_error)
163163
include Rehash
@@ -196,7 +196,7 @@ def self.call((ctx), *, &block)
196196
step :rehash
197197
}, fail_fast: true
198198
step :notify
199-
fail :log_error
199+
left :log_error
200200

201201
#~methods
202202
include T.def_steps(:model, :update, :notify, :log_error)
@@ -233,7 +233,7 @@ class Memo::Create < Trailblazer::Operation
233233
step :rehash
234234
}, fast_track: true
235235
step :notify
236-
fail :log_error
236+
left :log_error
237237
#~methods
238238
include T.def_steps(:model, :update, :notify, :log_error)
239239
include Rehash
@@ -274,7 +274,7 @@ class Memo::Create < Trailblazer::Operation
274274
Output(:success) => End(:transaction_worked),
275275
Output(MyTransaction::MyFailSignal, :failure) => End(:transaction_failed)
276276
step :notify
277-
fail :log_error
277+
left :log_error
278278
#~methods
279279
include T.def_steps(:model, :update, :notify, :log_error)
280280
include Rehash
@@ -319,7 +319,7 @@ def self.call((ctx), *, &block)
319319
step :rehash
320320
}
321321
step :notify
322-
fail :log_error
322+
left :log_error
323323

324324
#~methods
325325
include T.def_steps(:model, :update, :notify, :log_error)
@@ -354,7 +354,7 @@ def self.call((ctx), *, &block)
354354
step :rehash
355355
}
356356
step :notify
357-
fail :log_error
357+
left :log_error
358358

359359
#~methods
360360
include T.def_steps(:model, :update, :notify, :log_error)
@@ -393,7 +393,7 @@ def self.call((ctx), *, &block)
393393
step :rehash
394394
}
395395
step :notify
396-
fail :log_error
396+
left :log_error
397397

398398
#~methods
399399
include T.def_steps(:model, :update, :notify, :log_error)
@@ -432,7 +432,7 @@ def self.call((ctx), *, &block)
432432
step :rehash
433433
}
434434
step :notify
435-
fail :log_error
435+
left :log_error
436436

437437
#~methods
438438
include T.def_steps(:model, :update, :notify, :log_error)
@@ -480,7 +480,7 @@ class Memo::Create < Trailblazer::Operation
480480
step :rehash
481481
}
482482
step :notify
483-
fail :log_error
483+
left :log_error
484484
#~methods
485485
include T.def_steps(:model, :update, :notify, :log_error)
486486
include Rehash
@@ -521,7 +521,7 @@ class Memo::Create < Trailblazer::Operation
521521
step :update
522522
}, fast_track: true # because Wrap can return pass_fast! now
523523
step :notify
524-
fail :log_error
524+
left :log_error
525525
#~methods
526526
include T.def_steps(:model, :update, :notify, :log_error)
527527
#~methods end
@@ -554,7 +554,7 @@ class Upload < Trailblazer::Activity::FastTrack
554554
},
555555
Output(:timeout__) => Track(:fail_fast)
556556
step :upload
557-
fail :log_error
557+
left :log_error
558558
#~methods
559559
include T.def_steps(:model, :send_request, :upload, :log_error)
560560
#~methods end

0 commit comments

Comments
 (0)