2016-04-14 14:57:25 +00:00
|
|
|
module Gitlab
|
2016-03-08 11:35:37 +00:00
|
|
|
module ImportExport
|
|
|
|
class Shared
|
2016-05-10 15:15:20 +00:00
|
|
|
|
|
|
|
attr_reader :errors
|
|
|
|
|
2016-03-08 11:35:37 +00:00
|
|
|
def initialize(opts)
|
|
|
|
@opts = opts
|
2016-05-10 15:15:20 +00:00
|
|
|
@errors = []
|
2016-03-08 11:35:37 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def export_path
|
2016-04-14 14:57:25 +00:00
|
|
|
@export_path ||= Gitlab::ImportExport.export_path(relative_path: @opts[:relative_path])
|
2016-03-08 11:35:37 +00:00
|
|
|
end
|
2016-05-10 15:15:20 +00:00
|
|
|
|
|
|
|
def error(message)
|
|
|
|
error_out(message, caller[0].dup)
|
|
|
|
@errors << message
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def error_out(message, caller)
|
|
|
|
Rails.logger.error("Import/Export error raised on #{caller}: #{message}")
|
|
|
|
end
|
2016-03-08 11:35:37 +00:00
|
|
|
end
|
|
|
|
end
|
2016-03-08 17:20:32 +00:00
|
|
|
end
|