diff options
author | Douwe Maan <douwe@gitlab.com> | 2015-04-15 16:58:43 +0200 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2015-04-15 16:58:43 +0200 |
commit | 80097606f59c52ab962a3bec1e67f67d1a3cb6c7 (patch) | |
tree | 3de7a45fc5be22e061d85ed888f54dde74099d82 /lib | |
parent | 9193b94ecec58c7c386f9c1b5a6f06f01b1ef42a (diff) | |
download | gitlab-ce-80097606f59c52ab962a3bec1e67f67d1a3cb6c7.tar.gz |
Make sure user has access to namespace in import tests.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/gitorious_import/client.rb | 32 | ||||
-rw-r--r-- | lib/gitlab/gitorious_import/repository.rb | 37 |
2 files changed, 37 insertions, 32 deletions
diff --git a/lib/gitlab/gitorious_import/client.rb b/lib/gitlab/gitorious_import/client.rb index 5043f6a2ebd..8cdc3d4afae 100644 --- a/lib/gitlab/gitorious_import/client.rb +++ b/lib/gitlab/gitorious_import/client.rb @@ -27,37 +27,5 @@ module Gitlab repo_list.to_s.split(',').map(&:strip).reject(&:blank?) end end - - Repository = Struct.new(:full_name) do - def id - Digest::SHA1.hexdigest(full_name) - end - - def namespace - segments.first - end - - def path - segments.last - end - - def name - path.titleize - end - - def description - "" - end - - def import_url - "#{GITORIOUS_HOST}/#{full_name}.git" - end - - private - - def segments - full_name.split('/') - end - end end end diff --git a/lib/gitlab/gitorious_import/repository.rb b/lib/gitlab/gitorious_import/repository.rb new file mode 100644 index 00000000000..f702797dc6e --- /dev/null +++ b/lib/gitlab/gitorious_import/repository.rb @@ -0,0 +1,37 @@ +module Gitlab + module GitoriousImport + GITORIOUS_HOST = "https://gitorious.org" + + Repository = Struct.new(:full_name) do + def id + Digest::SHA1.hexdigest(full_name) + end + + def namespace + segments.first + end + + def path + segments.last + end + + def name + path.titleize + end + + def description + "" + end + + def import_url + "#{GITORIOUS_HOST}/#{full_name}.git" + end + + private + + def segments + full_name.split('/') + end + end + end +end |