Skip to content

Commit a11040c

Browse files
More work on ruby 3 support
1 parent a96ba91 commit a11040c

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

Diff for: lib/redmine/scm/adapters/xitolite_adapter.rb

+2-1
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,8 @@ def archive(revision, format)
453453
def mirror_push(mirror_url, branch = nil, args = [])
454454
cmd_args = git_mirror_cmd.concat(['push', *args, mirror_url, branch]).compact
455455
cmd = cmd_args.shift
456-
RedmineGitHosting::Utils::Exec.capture(cmd, cmd_args, { merge_output: true })
456+
457+
RedmineGitHosting::Utils::Exec.capture cmd, cmd_args, merge_output: true
457458
end
458459

459460
class Revision < Redmine::Scm::Adapters::Revision

Diff for: lib/redmine_git_hosting/plugins/gitolite_plugin.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def directory_exists?(dir)
4141

4242
def sudo_git(*params)
4343
cmd = RedmineGitHosting::Commands.sudo_git_args_for_repo(gitolite_repo_path, git_args).concat(params)
44-
RedmineGitHosting::Commands.capture cmd, git_opts
44+
RedmineGitHosting::Commands.capture cmd, **git_opts
4545
end
4646

4747
# You may override this method to prepend args like environment variables

Diff for: lib/redmine_git_hosting/utils/exec.rb

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ module Exec
1212
#
1313
# If the operation throws an exception or the operation yields a non-zero exit code
1414
# we rethrow a +GitoliteCommandException+ with a meaningful error message.
15-
def capture(command, args = [], opts = {}, &block)
15+
def capture(command, args = [], **opts, &block)
1616
merge_output = opts.delete(:merge_output) { false }
17-
stdout, stderr, code = execute(command, args, opts, &block)
17+
stdout, stderr, code = execute(command, args, **opts, &block)
1818
if code != 0
1919
error_msg = "Non-zero exit code #{code} for `#{command} #{args.join ' '}`"
2020
RedmineGitHosting.logger.debug error_msg
@@ -29,8 +29,8 @@ def capture(command, args = [], opts = {}, &block)
2929
#
3030
# If the operation throws an exception or the operation we rethrow a
3131
# +GitoliteCommandException+ with a meaningful error message.
32-
def execute(command, args = [], opts = {}, &block)
33-
Open3.capture3(command, *args, opts, &block)
32+
def execute(command, args = [], **opts, &block)
33+
Open3.capture3(command, *args, **opts, &block)
3434
rescue StandardError => e
3535
error_msg = "Exception occured executing `#{command} #{args.join ' '}` : #{e.message}"
3636
RedmineGitHosting.logger.debug error_msg

0 commit comments

Comments
 (0)