Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions init.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@
# This *must stay after* Redmine::Plugin.register statement
# because it needs to access to plugin settings...
# so we need the plugin to be fully registered...
Rails.configuration.to_prepare do
require_dependency 'load_gitolite_hooks'
end
require_dependency 'load_gitolite_hooks'

# Autoload Git Hosting Libs and Patches
RedmineGitHosting.load_plugin!

# Redmine SCM adapter
require_dependency 'redmine/scm/adapters/xitolite_adapter'

require 'hrack/bundle'
11 changes: 0 additions & 11 deletions lib/redmine_git_hosting.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,3 @@ def additionals_help_items
admin: true }]
end
end

# Set up autoload of patches
Rails.configuration.to_prepare do
# Redmine Git Hosting Libs and Patches
RedmineGitHosting.load_plugin!

# Redmine SCM adapter
require_dependency 'redmine/scm/adapters/xitolite_adapter'

require 'hrack/bundle'
end
5 changes: 0 additions & 5 deletions lib/redmine_git_hosting/commands.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,5 @@

module RedmineGitHosting
module Commands
extend Commands::Base
extend Commands::Git
extend Commands::Gitolite
extend Commands::Ssh
extend Commands::Sudo
end
end
2 changes: 2 additions & 0 deletions lib/redmine_git_hosting/commands/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,7 @@ def logger
RedmineGitHosting.logger
end
end

extend Commands::Base
end
end
2 changes: 2 additions & 0 deletions lib/redmine_git_hosting/commands/git.rb
Original file line number Diff line number Diff line change
Expand Up @@ -120,5 +120,7 @@ def git_config_as_hash(namespace, params)
value_hash
end
end

extend Commands::Git
end
end
2 changes: 2 additions & 0 deletions lib/redmine_git_hosting/commands/gitolite.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,7 @@ def gitolite_home_dir
RedmineGitHosting::Config.gitolite_home_dir
end
end

extend Commands::Gitolite
end
end
2 changes: 2 additions & 0 deletions lib/redmine_git_hosting/commands/ssh.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,7 @@ def ssh_shell_params
]
end
end

extend Commands::Ssh
end
end
2 changes: 2 additions & 0 deletions lib/redmine_git_hosting/commands/sudo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -205,5 +205,7 @@ def content_from_gitolite_side(destination_path)
sudo_cat destination_path
end
end

extend Commands::Sudo
end
end
12 changes: 0 additions & 12 deletions lib/redmine_git_hosting/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,5 @@ module Config

GITOLITE_DEFAULT_CONFIG_FILE = 'gitolite.conf'
GITOLITE_IDENTIFIER_DEFAULT_PREFIX = 'redmine_'

extend Config::Base
extend Config::GitoliteAccess
extend Config::GitoliteBase
extend Config::GitoliteCache
extend Config::GitoliteConfigTests
extend Config::GitoliteHooks
extend Config::GitoliteInfos
extend Config::GitoliteNotifications
extend Config::GitoliteStorage
extend Config::Mirroring
extend Config::RedmineConfig
end
end
2 changes: 2 additions & 0 deletions lib/redmine_git_hosting/config/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,5 +99,7 @@ def file_logger
RedmineGitHosting.logger
end
end

extend Config::Base
end
end
2 changes: 2 additions & 0 deletions lib/redmine_git_hosting/config/gitolite_access.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,7 @@ def my_root_url(ssl: true)
File.join(server_domain[%r{^[^/]*}], redmine_root_url, '/')[0..-2]
end
end

extend Config::GitoliteAccess
end
end
2 changes: 2 additions & 0 deletions lib/redmine_git_hosting/config/gitolite_base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -111,5 +111,7 @@ def gitolite_log_level
get_setting :gitolite_log_level
end
end

extend Config::GitoliteBase
end
end
2 changes: 2 additions & 0 deletions lib/redmine_git_hosting/config/gitolite_cache.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,7 @@ def gitolite_cache_adapter
get_setting :gitolite_cache_adapter
end
end

extend Config::GitoliteCache
end
end
2 changes: 2 additions & 0 deletions lib/redmine_git_hosting/config/gitolite_config_tests.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,5 +84,7 @@ def execute_sudo_test(user, &block)
/#{user}/.match?(test)
end
end

extend Config::GitoliteConfigTests
end
end
2 changes: 2 additions & 0 deletions lib/redmine_git_hosting/config/gitolite_hooks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,7 @@ def update_hook_params!
RedmineGitHosting::GitoliteParams::GlobalParams.new.install!
end
end

extend Config::GitoliteHooks
end
end
2 changes: 2 additions & 0 deletions lib/redmine_git_hosting/config/gitolite_infos.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,7 @@ def gitolite_repository_count
end
end
end

extend Config::GitoliteInfos
end
end
2 changes: 2 additions & 0 deletions lib/redmine_git_hosting/config/gitolite_notifications.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,7 @@ def gitolite_notify_global_exclude
get_setting :gitolite_notify_global_exclude
end
end

extend Config::GitoliteNotifications
end
end
2 changes: 2 additions & 0 deletions lib/redmine_git_hosting/config/gitolite_storage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,7 @@ def recycle_bin_dir
nil
end
end

extend Config::GitoliteStorage
end
end
2 changes: 2 additions & 0 deletions lib/redmine_git_hosting/config/mirroring.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,7 @@ def gitolite_mirroring_script
File.join gitolite_home_dir, '.ssh', 'run_gitolite_admin_ssh'
end
end

extend Config::Mirroring
end
end
2 changes: 2 additions & 0 deletions lib/redmine_git_hosting/config/redmine_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,7 @@ def gitolite_recycle_bin_expiration_time
(get_setting(:gitolite_recycle_bin_expiration_time).to_f * 60).to_i
end
end

extend Config::RedmineConfig
end
end
2 changes: 1 addition & 1 deletion spec/models/gitolite_public_key_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
# There is an isolation issue in tests.
# Try to workaround it...
def test_user
'redmine_git_user1_12'
'redmine_git_user1_13'
end

describe 'Valid SSH key build' do
Expand Down
7 changes: 6 additions & 1 deletion spec/support/global_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,12 @@ def create_svn_repository(**opts)
end

def load_yaml_fixture(fixture)
YAML.load load_fixture(fixture) # rubocop: disable Security/YAMLLoad
if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.1.0')
YAML.load load_fixture(fixture), # rubocop: disable Security/YAMLLoad
permitted_classes: [Symbol, Time]
else
YAML.load load_fixture(fixture) # rubocop: disable Security/YAMLLoad
end
end

def load_fixture(fixture)
Expand Down