summaryrefslogtreecommitdiff
path: root/lib/gitlab/import_export/project_tree_saver.rb
diff options
context:
space:
mode:
authorJames Lopez <james@jameslopez.es>2016-05-06 13:40:02 +0200
committerJames Lopez <james@jameslopez.es>2016-05-06 13:40:02 +0200
commitce598b05414d52b31437dbe19412eb6a9a16f1b5 (patch)
tree34349e8e2c95ae01c0e219cedd42e335ef0e9321 /lib/gitlab/import_export/project_tree_saver.rb
parent6612ca096a496caaa0d30724190964df8aac2f46 (diff)
downloadgitlab-ce-ce598b05414d52b31437dbe19412eb6a9a16f1b5.tar.gz
fixed and refactored a few things based on MR feedback
Diffstat (limited to 'lib/gitlab/import_export/project_tree_saver.rb')
-rw-r--r--lib/gitlab/import_export/project_tree_saver.rb12
1 files changed, 4 insertions, 8 deletions
diff --git a/lib/gitlab/import_export/project_tree_saver.rb b/lib/gitlab/import_export/project_tree_saver.rb
index 394411a56c2..29d715c16d3 100644
--- a/lib/gitlab/import_export/project_tree_saver.rb
+++ b/lib/gitlab/import_export/project_tree_saver.rb
@@ -3,19 +3,13 @@ module Gitlab
class ProjectTreeSaver
attr_reader :full_path
- def initialize(project: , shared: )
+ def initialize(project:, shared:)
@project = project
@export_path = shared.export_path
- end
-
- def save
@full_path = File.join(@export_path, project_filename)
- save_to_disk
end
- private
-
- def save_to_disk
+ def save
FileUtils.mkdir_p(@export_path)
File.write(full_path, project_json_tree)
true
@@ -24,6 +18,8 @@ module Gitlab
false
end
+ private
+
# TODO remove magic keyword and move it to a shared config
def project_filename
"project.json"