This commit introduces changes to the user data export archive format. This extends data set which is included in the archive. This data can be then imported to other pods when this feature is implemented. Also the commit adds the archive format json schema. ATM it is used in automatic tests only, but in future it will also be used to validate incoming archives.
28 lines
556 B
Ruby
28 lines
556 B
Ruby
# Copyright (c) 2010-2011, Diaspora Inc. This file is
|
|
# licensed under the Affero General Public License version 3 or later. See
|
|
# the COPYRIGHT file.
|
|
|
|
module Diaspora
|
|
|
|
class Exporter
|
|
|
|
SERIALIZED_VERSION = "2.0".freeze
|
|
|
|
def initialize(user)
|
|
@user = user
|
|
end
|
|
|
|
def execute
|
|
JSON.generate full_archive
|
|
end
|
|
|
|
private
|
|
|
|
def full_archive
|
|
{version: SERIALIZED_VERSION}
|
|
.merge(Export::UserSerializer.new(@user).as_json)
|
|
.merge(Export::OthersDataSerializer.new(@user).as_json)
|
|
end
|
|
end
|
|
|
|
end
|