1
0
Fork 0
mirror of https://github.com/nishiki/manage-password.git synced 2024-11-23 13:57:52 +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 # Export to csv
# @args: file -> file where you export the data # @args: file -> file where you export the data
def export(file) def export(file)
data = {} data = {}
@data.each do |item| @data.each do |item|
data.merge!(item.id => {'id' => item.id, data.merge!(item.id => {'id' => item.id,
'name' => item.name, 'name' => item.name,
'group' => item.group, 'group' => item.group,
'host' => item.host, 'host' => item.host,
'protocol' => item.protocol, 'protocol' => item.protocol,
'user' => item.user, 'user' => item.user,
'password' => get_password(item.id), 'password' => get_password(item.id),
'port' => item.port, 'port' => item.port,
'comment' => item.comment, 'comment' => item.comment,
'last_edit' => item.last_edit, 'last_edit' => item.last_edit,
'created' => item.created, 'created' => item.created,
} }
) )
end end
File.open(file, 'w') {|f| f << data.to_yaml} File.open(file, 'w') {|f| f << data.to_yaml}
rescue Exception => e rescue Exception => e
raise "#{I18n.t('error.export.write', file: file)}\n#{e}" raise "#{I18n.t('error.export.write', file: file)}\n#{e}"
end end