Skip to content

Commit

Permalink
Merge pull request #4099 from envato/datadog-tracer
Browse files Browse the repository at this point in the history
Pass keyword arguments for Ruby 3 compatibility
  • Loading branch information
grosser authored Feb 13, 2024
2 parents caf3c54 + 5009188 commit 28725a0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/samson/hooks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,9 @@ def fire(name, *args, **kwargs)
traced(name) { hooks(name).map { |hook| hook.call(*args, **kwargs) } }
end

def render_views(name, view, *args)
def render_views(name, view, *args, **kwargs)
hooks(name).each_with_object("".html_safe) do |partial, html|
html << view.render(partial, *args)
html << view.render(partial, *args, **kwargs)
end
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ def wrap_method(klass, method, scope, &callback)
raise "#{scope} wrapper already defined for #{method}"
end
klass.alias_method without, method
klass.define_method(method) do |*args, &block|
callback.call { send(without, *args, &block) }
klass.define_method(method) do |*args, **kwargs, &block|
callback.call { send(without, *args, **kwargs, &block) }
end
klass.send visibility, method
klass.send visibility, without
Expand Down

0 comments on commit 28725a0

Please sign in to comment.