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 - ♻️ - Edited
## 0.2.2 - [08/04/2022] ## 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 title by start program
- - Added clear terminal by new search - - Added terminal cleaning functionality
- - Added by start&close program clear terminal - - Added help tips to user prompt
- - Added help tooltip to prompt - - Added emoji for output
- - Added emoji to output - - Added colors for help sections
- ✔️ - Fixed BYE emoji color - ✔️ - Fixed bug on bye emoji color
- ♻️ - Edited URL color & style output - ♻️ - Edited color & style for data output
- 🐛 - After emoji label not view space symbol (emoji temporary changed)
## 0.2.1 - [14/03/2022] ## 0.2.1 - [14/03/2022]
- - prompt '>' set color green - - prompt '>' set color green

View File

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