Skip to content

Commit a96ba91

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

File tree

6 files changed

+22
-17
lines changed

6 files changed

+22
-17
lines changed

Diff for: app/use_cases/settings/apply.rb

+12-6
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,11 @@ def check_gitolite_config
8383
if value_has_changed?(:gitolite_config_file) ||
8484
value_has_changed?(:gitolite_identifier_prefix) ||
8585
value_has_changed?(:gitolite_identifier_strip_user_id)
86-
options = { message: 'Gitolite configuration has been modified, resync all projects (active, closed, archived)...' }
87-
gitolite_accessor.update_projects 'all', options
86+
87+
gitolite_accessor.update_projects(
88+
'all',
89+
message: 'Gitolite configuration has been modified, resync all projects (active, closed, archived)...'
90+
)
8891
end
8992
end
9093

@@ -96,8 +99,8 @@ def check_gitolite_default_values
9699
value_has_changed?(:gitolite_notify_global_exclude)
97100

98101
# Need to update everyone!
99-
options = { message: 'Gitolite configuration has been modified, resync all active projects...' }
100-
gitolite_accessor.update_projects 'active', options
102+
gitolite_accessor.update_projects 'active',
103+
message: 'Gitolite configuration has been modified, resync all active projects...'
101104
end
102105
end
103106

@@ -118,9 +121,12 @@ def check_cache_config
118121
end
119122

120123
def do_resync_projects
124+
return unless resync_projects
125+
121126
## A resync has been asked within the interface, update all projects in force mode
122-
options = { message: 'Forced resync of all projects (active, closed, archived)...', force: true }
123-
gitolite_accessor.update_projects 'all', options if resync_projects
127+
gitolite_accessor.update_projects 'all',
128+
message: 'Forced resync of all projects (active, closed, archived)...',
129+
force: true
124130
end
125131

126132
def do_resync_ssh_keys

Diff for: lib/redmine_git_hosting/gitolite_accessor.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def destroy_repositories(repositories, **opts)
6161
end
6262
end
6363

64-
def update_projects(projects, opts)
64+
def update_projects(projects, **opts)
6565
message = opts.delete(:message) { ' ' }
6666
logger.info message
6767
resync_gitolite :update_projects, projects, **opts

Diff for: lib/redmine_git_hosting/patches/member_patch.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ def self.prepended(base)
1616
private
1717

1818
def update_project
19-
options = { message: "Membership changes on project '#{project}', update!" }
20-
gitolite_accessor.update_projects [project.id], **options
19+
gitolite_accessor.update_projects [project.id],
20+
message: "Membership changes on project '#{project}', update!"
2121
end
2222
end
2323
end

Diff for: lib/redmine_git_hosting/patches/projects_controller_patch.rb

+2-4
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,11 @@ def move_project_hierarchy
8989
end
9090

9191
def update_project(message)
92-
options = { message: message }
93-
Projects::Update.call @project, options
92+
Projects::Update.call @project, message: message
9493
end
9594

9695
def update_project_hierarchy(message)
97-
options = { message: message }
98-
gitolite_accessor.update_projects hierarchy_to_update, options
96+
gitolite_accessor.update_projects hierarchy_to_update, message: message
9997
end
10098

10199
def hierarchy_to_update

Diff for: lib/redmine_git_hosting/patches/users_controller_patch.rb

+2-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ def set_public_key_values
5050
end
5151

5252
def update_projects
53-
gitolite_accessor.update_projects projects_to_update, message: "Status of '#{@user.login}' has changed, update projects"
53+
gitolite_accessor.update_projects projects_to_update,
54+
message: "Status of '#{@user.login}' has changed, update projects"
5455
end
5556

5657
def projects_to_update

Diff for: lib/tasks/migration_tools.rake

+3-3
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ namespace :redmine_git_hosting do
7272

7373
puts ''
7474

75-
options = { message: 'Gitolite configuration has been modified, resync all projects...', bypass_sidekiq: true }
76-
RedmineGitHosting::GitoliteAccessor.update_projects 'all', options
77-
75+
RedmineGitHosting::GitoliteAccessor.update_projects 'all',
76+
message: 'Gitolite configuration has been modified, resync all projects...',
77+
bypass_sidekiq: true
7878
puts 'Done!'
7979
end
8080

0 commit comments

Comments
 (0)