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
diff options
context:
space:
mode:
authorJames Lopez <james@jameslopez.es>2016-04-14 17:57:25 +0300
committerJames Lopez <james@jameslopez.es>2016-04-14 17:57:25 +0300
commit0852f539aa389c66ef377b7d567c931f928e147f (patch)
tree82797f5e855f9235d445c943af7161b4cc7d2238 /lib/gitlab/import_export.rb
parent91ffd8028977984d3ea9a741a3a655ff6dae76b2 (diff)
refactored stuff, added a save and compress all class and moved mostly everything to lib
Diffstat (limited to 'lib/gitlab/import_export.rb')
-rw-r--r--lib/gitlab/import_export.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/gitlab/import_export.rb b/lib/gitlab/import_export.rb
new file mode 100644
index 00000000000..fe88850c33d
--- /dev/null
+++ b/lib/gitlab/import_export.rb
@@ -0,0 +1,23 @@
+module Gitlab
+ module ImportExport
+ extend self
+
+ def export_path(relative_path:)
+ File.join(storage_path, relative_path, "#{Time.now.strftime('%Y-%m-%d_%H-%M-%3N')}_gitlab_export")
+ end
+
+ def project_atts
+ %i(name path description issues_enabled wall_enabled merge_requests_enabled wiki_enabled snippets_enabled visibility_level archived)
+ end
+
+ def project_tree
+ Gitlab::ImportExport::ImportExportReader.project_tree
+ end
+
+ private
+
+ def storage_path
+ File.join(Settings.shared['path'], 'tmp/project_exports')
+ end
+ end
+end