Compare commits

...

2 Commits

Author SHA1 Message Date
70153a6e42
0.2.2 2022-04-08 17:49:26 +03:00
d72acba22c
check file permissions 2022-04-08 17:35:56 +03:00
2 changed files with 39 additions and 18 deletions

View File

@ -7,14 +7,15 @@
- ♻️ - Edited
## 0.2.2 - [08/04/2022]
- 🐛 - Before label emoji not insert space symbol (temponary change emoji)
- - Added check permissions for password file
- - Added title by start program
- - Added clear terminal by new search
- - Added by start&close program clear terminal
- - Added help tooltip to prompt
- - Added emoji to output
- ✔️ - Fixed BYE emoji color
- ♻️ - Edited URL color & style output
- - Added terminal cleaning functionality
- - Added help tips to user prompt
- - Added emoji for output
- - Added colors for help sections
- ✔️ - Fixed bug on bye emoji color
- ♻️ - Edited color & style for data output
- 🐛 - After emoji label not view space symbol (emoji temporary changed)
## 0.2.1 - [14/03/2022]
- - prompt '>' set color green

View File

@ -80,6 +80,15 @@ while count < yaml.size
count += 1
end
# check file ppermissions
password_file_permissions = File.info(password_file_path).permissions.to_s
if /\d{3}/.match(password_file_permissions).try &.[0] != "600"
puts "Password file permissions is not RW for you.".colorize(:red)
exit(1)
end
# pmng title
system "clear"
puts "The very simple password manager for humans".colorize(:yellow).mode(:bold)
@ -98,25 +107,31 @@ while loop
password_string = gets
# if ':q' to close program
if password_string.to_s == ":q"
# if ':q' to close program
system "clear"
puts "Bye! 👋"
exit(0)
# if puts empty, retry prompt
elsif password_string.to_s.size == 0
# if puts empty, retry prompt
puts
# if ':h' to view help
elsif password_string.to_s == ":h"
puts "Help:\n-----"
puts ":s - Return stats"
# if ':s' to view Statistics
# if ':h' to view help
system "clear"
puts "Help\n----".colorize(:yellow).mode(:bold)
print ":s".colorize(:red).mode(:bold)
puts " - Return stats"
elsif password_string.to_s == ":s"
puts "Statistics:\n----------"
print "Elements: ".colorize(:yellow)
# if ':s' to view Statistics
system "clear"
puts "Statistics\n----------".colorize(:yellow).mode(:bold)
print "All elements: ".colorize(:yellow).mode(:bold)
puts passwords_array.size
print "Outdated: ".colorize(:red)
print "Passwords outdated: ".colorize(:red).mode(:bold)
outdated_count = 0
current_time = Time.local.to_unix
a = [] of String
@ -128,8 +143,8 @@ while loop
end
puts outdated_count
# list search password
else
# list search password
system "clear"
passwords_array.each do |item|
@ -141,18 +156,23 @@ while loop
print "📧 "
puts item.email.colorize(:red)
end
if !item.login.blank?
print "🏷️ "
# print "🏷️ " # Bug
print "🗿 "
puts item.login.colorize(:yellow)
end
if !item.password.blank?
print "🔐 "
puts item.password.colorize(:red).back(:red)
end
if !item.desc.blank?
print "📄 "
puts item.desc.colorize(:cyan)
end
if !item.profile_url.blank?
print "👦 "
puts item.profile_url.colorize(:green)