Skip to content

Commit

Permalink
get ready for Ruby 3.
Browse files Browse the repository at this point in the history
  • Loading branch information
apotonick committed Feb 26, 2021
1 parent 80ba6fa commit 918bb74
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion lib/trailblazer/developer/generate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class Activity < Representable::Decorator
end

def call(hash)
_, (ctx, _) = Activity::TaskWrap.invoke(Pipeline, hash: hash)
_, (ctx, _) = Activity::TaskWrap.invoke(Pipeline, [{hash: hash}, {}])
ctx[:intermediate]
end

Expand Down
4 changes: 2 additions & 2 deletions lib/trailblazer/developer/render/circuit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ module Trailblazer
module Developer
module_function

def render(activity)
Render::Circuit.(activity)
def render(activity, **options)
Render::Circuit.(activity, **options)
end

module Render
Expand Down
2 changes: 1 addition & 1 deletion lib/trailblazer/developer/trace/present.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def tree_for(stack, level, tree:, **options)
stack.each do |lvl| # always a Stack::Task[input, ..., output]
input, output, nested = Trace::Level.input_output_nested_for_level(lvl)

tree.push(*TreeNodes.for(level, options.merge(input: input, output: output)))
tree.push(*TreeNodes.for(level, **options.merge(input: input, output: output)))

if nested.any? # nesting
opts = options.merge(tree: tree)
Expand Down
8 changes: 4 additions & 4 deletions lib/trailblazer/developer/wtf.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module Trailblazer::Developer
module_function

def wtf(activity, *args)
Wtf.invoke(activity, *args)
def wtf(activity, *args, **circuit_options)
Wtf.invoke(activity, *args, **circuit_options)
end

class << self
Expand All @@ -16,11 +16,11 @@ module Wtf
# This allows to display the trace even when an exception happened
def invoke(activity, (ctx, flow_options), **circuit_options)
activity, (ctx, flow_options), circuit_options = Wtf.arguments_for_trace(
activity, [ctx, flow_options], circuit_options
activity, [ctx, flow_options], **circuit_options
)

_returned_stack, signal, (ctx, flow_options) = Trace.invoke(
activity, [ctx, flow_options], circuit_options
activity, [ctx, flow_options], **circuit_options
)

return signal, [ctx, flow_options], circuit_options
Expand Down
2 changes: 1 addition & 1 deletion test/trace/wtf_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ def <<(value)
Trailblazer::Developer.wtf?(
alpha,
[ctx, flow_options],
circuit_options
**circuit_options
)
end

Expand Down

0 comments on commit 918bb74

Please sign in to comment.