2012-05-26 12:37:49 +02:00
|
|
|
require File.join(Rails.root, "lib", "gitlab", "gitolite")
|
2011-12-04 00:44:59 +01:00
|
|
|
|
2012-05-26 12:37:49 +02:00
|
|
|
module Gitlab
|
2011-12-04 00:44:59 +01:00
|
|
|
class GitHost
|
|
|
|
def self.system
|
2012-05-26 12:37:49 +02:00
|
|
|
Gitlab::Gitolite
|
2011-12-04 00:44:59 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def self.admin_uri
|
|
|
|
GIT_HOST["admin_uri"]
|
|
|
|
end
|
2011-12-05 08:43:53 +01:00
|
|
|
|
|
|
|
def self.url_to_repo(path)
|
|
|
|
if !GIT_HOST["port"] or GIT_HOST["port"] == 22
|
|
|
|
"#{GIT_HOST["git_user"]}@#{GIT_HOST["host"]}:#{path}.git"
|
|
|
|
else
|
|
|
|
"ssh://#{GIT_HOST["git_user"]}@#{GIT_HOST["host"]}:#{GIT_HOST["port"]}/#{path}.git"
|
|
|
|
end
|
|
|
|
end
|
2011-12-04 00:44:59 +01:00
|
|
|
end
|
|
|
|
end
|