1
0
Fork 0
mirror of https://github.com/nishiki/manage-password.git synced 2025-02-20 01:50:04 +00:00

replace var.length == 0 by var.empty?

This commit is contained in:
Adrien Waksberg 2017-03-28 23:13:45 +02:00
parent db6bb2b0f6
commit e99b18519d
2 changed files with 5 additions and 5 deletions

View file

@ -224,7 +224,7 @@ class Cli
def list(options={})
result = @mpw.list(options)
if result.length == 0
if result.empty?
puts I18n.t('display.nothing')
else
table_items(result)
@ -414,7 +414,7 @@ class Cli
def update(password=false, options={})
items = @mpw.list(options)
if items.length == 0
if items.empty?
puts "#{I18n.t('display.warning')}: #{I18n.t('warning.select')}".yellow
else
table_items(items) if items.length > 1
@ -439,7 +439,7 @@ class Cli
def delete(options={})
items = @mpw.list(options)
if items.length == 0
if items.empty?
puts "#{I18n.t('display.warning')}: #{I18n.t('warning.select')}".yellow
else
table_items(items)
@ -464,7 +464,7 @@ class Cli
def copy(clipboard=true, options={})
items = @mpw.list(options)
if items.length == 0
if items.empty?
puts I18n.t('display.nothing')
else
table_items(items)

View file

@ -62,7 +62,7 @@ class MPW
when /^wallet\/keys\/(?<key>.+)\.pub$/
key = Regexp.last_match('key')
if GPGME::Key.find(:public, key).length == 0
if GPGME::Key.find(:public, key).empty?
GPGME::Key.import(f.read, armor: true)
end