From 96d49bf04ce77c975fe500f4d961e4a1ffed4c26 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Sun, 30 Dec 2012 14:43:00 +0200 Subject: Use sdoc to generate application code documentation --- doc/code/classes/NamespacedProject.html | 344 ++++++++++++++++++++++++++++++++ 1 file changed, 344 insertions(+) create mode 100644 doc/code/classes/NamespacedProject.html (limited to 'doc/code/classes/NamespacedProject.html') diff --git a/doc/code/classes/NamespacedProject.html b/doc/code/classes/NamespacedProject.html new file mode 100644 index 00000000000..976338e8810 --- /dev/null +++ b/doc/code/classes/NamespacedProject.html @@ -0,0 +1,344 @@ + + + + + NamespacedProject + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + +
Methods
+
+ +
C
+
+ +
+ +
N
+
+ +
+ +
P
+
+ +
+ +
T
+
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + +
Instance Public methods
+ +
+
+ + chief() + + +
+ + +
+ +
+ + + + + + +
+ + +
+
# File app/roles/namespaced_project.rb, line 44
+def chief
+  if namespace
+    namespace_owner
+  else
+    owner
+  end
+end
+
+
+ +
+ +
+
+ + name_with_namespace() + + +
+ + +
+ +
+ + + + + + +
+ + +
+
# File app/roles/namespaced_project.rb, line 30
+def name_with_namespace
+  @name_with_namespace ||= begin
+                             if namespace
+                               namespace.human_name + " / " + name
+                             else
+                               name
+                             end
+                           end
+end
+
+
+ +
+ +
+
+ + namespace_owner() + + +
+ + +
+ +
+ + + + + + +
+ + +
+
# File app/roles/namespaced_project.rb, line 40
+def namespace_owner
+  namespace.try(:owner)
+end
+
+
+ +
+ +
+
+ + path_with_namespace() + + +
+ + +
+ +
+ + + + + + +
+ + +
+
# File app/roles/namespaced_project.rb, line 52
+def path_with_namespace
+  if namespace
+    namespace.path + '/' + path
+  else
+    path
+  end
+end
+
+
+ +
+ +
+
+ + transfer(new_namespace) + + +
+ + +
+ +
+ + + + + + +
+ + +
+
# File app/roles/namespaced_project.rb, line 2
+def transfer(new_namespace)
+  Project.transaction do
+    old_namespace = namespace
+    self.namespace = new_namespace
+
+    old_dir = old_namespace.try(:path) || ''
+    new_dir = new_namespace.try(:path) || ''
+
+    old_repo = if old_dir.present?
+                 File.join(old_dir, self.path)
+               else
+                 self.path
+               end
+
+    if Project.where(path: self.path, namespace_id: new_namespace.try(:id)).present?
+      raise TransferError.new("Project with same path in target namespace already exists")
+    end
+
+    Gitlab::ProjectMover.new(self, old_dir, new_dir).execute
+
+    git_host.move_repository(old_repo, self)
+
+    save!
+  end
+rescue Gitlab::ProjectMover::ProjectMoveError => ex
+  raise Project::TransferError.new(ex.message)
+end
+
+
+ +
+
+ +
+ + \ No newline at end of file -- cgit v1.2.1