1
0
Fork 0
mirror of https://github.com/nishiki/manage-password.git synced 2024-10-27 02:33:19 +00:00

fix indent for export function

This commit is contained in:
nishiki 2016-05-07 12:03:55 +02:00
parent 09f53a3c85
commit d56ab48797

View file

@ -195,24 +195,24 @@ class MPW
# Export to csv
# @args: file -> file where you export the data
def export(file)
data = {}
@data.each do |item|
data.merge!(item.id => {'id' => item.id,
'name' => item.name,
'group' => item.group,
'host' => item.host,
'protocol' => item.protocol,
'user' => item.user,
'password' => get_password(item.id),
'port' => item.port,
'comment' => item.comment,
'last_edit' => item.last_edit,
'created' => item.created,
}
)
end
data = {}
@data.each do |item|
data.merge!(item.id => {'id' => item.id,
'name' => item.name,
'group' => item.group,
'host' => item.host,
'protocol' => item.protocol,
'user' => item.user,
'password' => get_password(item.id),
'port' => item.port,
'comment' => item.comment,
'last_edit' => item.last_edit,
'created' => item.created,
}
)
end
File.open(file, 'w') {|f| f << data.to_yaml}
File.open(file, 'w') {|f| f << data.to_yaml}
rescue Exception => e
raise "#{I18n.t('error.export.write', file: file)}\n#{e}"
end