Skip to content

Commit

Permalink
Samson Hooks uses kwargs for Ruby 3 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
orien committed Feb 11, 2024
1 parent 3e5c1e9 commit 0cb8914
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 @@ -178,8 +178,8 @@ def only_callbacks_for_plugin(plugin_name, hook_name)
end

# use
def fire(name, *args)
traced(name) { hooks(name).map { |hook| hook.call(*args) } }
def fire(name, *args, **kwargs)
traced(name) { hooks(name).map { |hook| hook.call(*args, **kwargs) } }
end

def render_views(name, view, *args)
Expand Down
4 changes: 2 additions & 2 deletions plugins/env/lib/samson_env/samson_plugin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ def write_dotenv(base_file, groups)
end

# TODO: use for write_env_files
Samson::Hooks.callback :deploy_env do |*args|
EnvironmentVariable.env(*args)
Samson::Hooks.callback :deploy_env do |*args, **kwargs|
EnvironmentVariable.env(*args, **kwargs)
end

Samson::Hooks.callback(:link_parts_for_resource) do
Expand Down

0 comments on commit 0cb8914

Please sign in to comment.