diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-03-11 09:35:33 +0200 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-03-11 09:35:33 +0200 |
commit | 238fd9b65f243fef552a1e7aa0bf2e3ba6e52b10 (patch) | |
tree | bd6cef235825cda977a5f3d096990f2964e8226b /lib/gitlab_projects.rb | |
parent | 55818a4f0ca0fb331d7820b35a14dacd27dfd6c2 (diff) | |
download | gitlab-shell-238fd9b65f243fef552a1e7aa0bf2e3ba6e52b10.tar.gz |
Cover with tests GitlabProjects
Diffstat (limited to 'lib/gitlab_projects.rb')
-rw-r--r-- | lib/gitlab_projects.rb | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/gitlab_projects.rb b/lib/gitlab_projects.rb index b9eb36a..220ecb1 100644 --- a/lib/gitlab_projects.rb +++ b/lib/gitlab_projects.rb @@ -2,7 +2,17 @@ require 'open3' require 'fileutils' class GitlabProjects - attr_reader :project_name, :full_path + # Project name is a directory name for repository with .git at the end + # It may be namespaced or not. Like repo.git or gitlab/repo.git + attr_reader :project_name + + # Absolute path to directory where repositories stored + # By default it is /home/git/repositories + attr_reader :repos_path + + # Full path is an absolute path to the repository + # Ex /home/git/repositories/test.git + attr_reader :full_path def initialize @command = ARGV.shift @@ -42,7 +52,7 @@ class GitlabProjects def import_project @source = ARGV.shift - cmd = "cd #{@repos_path} && git clone --bare #{@source} #{@project_name} && #{create_hooks_cmd}" + cmd = "cd #{repos_path} && git clone --bare #{@source} #{project_name} && #{create_hooks_cmd}" system(cmd) end end |