blob: cf75a2c7fa8871bbebc1d090f2ebdd75840d3467 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
# frozen_string_literal: true
module Gitlab
module ImportExport
class LegacyRelationTreeSaver
include Gitlab::ImportExport::CommandLineUtil
def serialize(exportable, relations_tree)
Gitlab::ImportExport::FastHashSerializer
.new(exportable, relations_tree)
.execute
end
def save(tree, dir_path, filename)
mkdir_p(dir_path)
tree_json = ::JSON.generate(tree)
File.write(File.join(dir_path, filename), tree_json)
end
end
end
end
|