Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-04-15 17:58:43 +0300
committerDouwe Maan <douwe@gitlab.com>2015-04-15 17:58:43 +0300
commit80097606f59c52ab962a3bec1e67f67d1a3cb6c7 (patch)
tree3de7a45fc5be22e061d85ed888f54dde74099d82 /lib
parent9193b94ecec58c7c386f9c1b5a6f06f01b1ef42a (diff)
Make sure user has access to namespace in import tests.
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/gitorious_import/client.rb32
-rw-r--r--lib/gitlab/gitorious_import/repository.rb37
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