Class: Gitlab::ImportExport::Project::TreeSaver

Inherits:
Object
  • Object
show all
Includes:
DurationMeasuring
Defined in:
lib/gitlab/import_export/project/tree_saver.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(project:, current_user:, shared:, params: {}, logger: Gitlab::Export::Logger) ⇒ TreeSaver

Returns a new instance of TreeSaver.



11
12
13
14
15
16
17
# File 'lib/gitlab/import_export/project/tree_saver.rb', line 11

def initialize(project:, current_user:, shared:, params: {}, logger: Gitlab::Export::Logger)
  @params       = params
  @project      = project
  @current_user = current_user
  @shared       = shared
  @logger       = logger
end

Instance Attribute Details

#full_pathObject (readonly)

Returns the value of attribute full_path.



9
10
11
# File 'lib/gitlab/import_export/project/tree_saver.rb', line 9

def full_path
  @full_path
end

Instance Method Details

#saveObject



19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/gitlab/import_export/project/tree_saver.rb', line 19

def save
  with_duration_measuring do
    stream_export

    true
  end
rescue StandardError => e
  @shared.error(e)
  false
ensure
  json_writer&.close
end