Replace match with end_with: more readable, faster

This commit is contained in:
Ciro Santilli 2014-10-18 22:36:00 +02:00
parent 3880bb6176
commit 2901042196
1 changed files with 1 additions and 1 deletions

View File

@ -11,7 +11,7 @@ namespace :gitlab do
home_dir = Rails.env.test? ? Rails.root.join('tmp/tests') : Settings.gitlab.user_home
gitlab_url = Settings.gitlab.url
# gitlab-shell requires a / at the end of the url
gitlab_url += "/" unless gitlab_url.match(/\/$/)
gitlab_url += '/' unless gitlab_url.end_with?('/')
repos_path = Gitlab.config.gitlab_shell.repos_path
target_dir = Gitlab.config.gitlab_shell.path