From 8f29eb8d58b629e6668667ad86cf6559bb248e61 Mon Sep 17 00:00:00 2001 From: nishiki Date: Sat, 7 May 2016 12:08:36 +0200 Subject: [PATCH] fix comments --- lib/mpw/mpw.rb | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/lib/mpw/mpw.rb b/lib/mpw/mpw.rb index 0d1af7a..230ff53 100644 --- a/lib/mpw/mpw.rb +++ b/lib/mpw/mpw.rb @@ -77,8 +77,7 @@ class MPW end # Encrypt a file - # @rtrn: true if the file has been encrypted - # TODO export key pub + # TODO backup and restore file with raise def write_data data = {} @@ -119,12 +118,15 @@ class MPW end end - # TODO comment + # Get a password + # args: id -> the item id def get_password(id) return decrypt(@passwords[id]) end - # TODO comment + # Set a password + # args: id -> the item id + # password -> the new password def set_password(id, password) @passwords[id] = encrypt(password) end @@ -138,8 +140,6 @@ class MPW # Add a new item # @args: item -> Object MPW::Item - # @rtrn: true if add item - # TODO add password def add(item) if not item.instance_of?(Item) raise I18n.t('error.bad_class') @@ -192,7 +192,7 @@ class MPW return nil end - # Export to csv + # Export to yaml # @args: file -> file where you export the data def export(file) data = {} @@ -261,8 +261,7 @@ class MPW end # Decrypt a gpg file - # @args: password -> the GPG key password - # @rtrn: true if data has been decrypted + # @args: data -> string to decrypt private def decrypt(data) crypto = GPGME::Crypto.new(armor: true) @@ -273,7 +272,7 @@ class MPW end # Encrypt a file - # @rtrn: true if the file has been encrypted + # args: data -> string to encrypt private def encrypt(data) recipients = []