From 65549a5866da6ceaf7ee4052736077879b5e641d Mon Sep 17 00:00:00 2001 From: James Lopez Date: Fri, 15 Jul 2016 12:47:06 +0200 Subject: add project name and namespace to filename on project export added changelog --- lib/gitlab/import_export.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib/gitlab/import_export.rb') diff --git a/lib/gitlab/import_export.rb b/lib/gitlab/import_export.rb index 588647e5adb..bab2ea73c4f 100644 --- a/lib/gitlab/import_export.rb +++ b/lib/gitlab/import_export.rb @@ -3,6 +3,7 @@ module Gitlab extend self VERSION = '0.1.1' + FILENAME_LIMIT = 50 def export_path(relative_path:) File.join(storage_path, relative_path) @@ -28,6 +29,12 @@ module Gitlab 'VERSION' end + def export_filename(project:) + basename = "#{Time.now.strftime('%Y-%m-%d_%H-%M-%3N')}_#{project.namespace.path}_#{project.path}" + + "#{basename[0..FILENAME_LIMIT]}_export.tar.gz" + end + def version VERSION end -- cgit v1.2.1