mirror of
https://github.com/nishiki/manage-password.git
synced 2025-02-17 08:30:04 +00:00
change array.new
This commit is contained in:
parent
958792801e
commit
1f5b37ed3c
2 changed files with 6 additions and 6 deletions
10
MPW/MPW.rb
10
MPW/MPW.rb
|
@ -78,7 +78,7 @@ module MPW
|
||||||
# protocol -> the connection protocol (ssh, web, other)
|
# protocol -> the connection protocol (ssh, web, other)
|
||||||
# @rtrn: a list with the resultat of the search
|
# @rtrn: a list with the resultat of the search
|
||||||
def search(search='', group=nil, protocol=nil)
|
def search(search='', group=nil, protocol=nil)
|
||||||
result = Array.new()
|
result = []
|
||||||
|
|
||||||
if !search.nil?
|
if !search.nil?
|
||||||
search = search.downcase
|
search = search.downcase
|
||||||
|
@ -110,7 +110,7 @@ module MPW
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
return Array.new()
|
return []
|
||||||
end
|
end
|
||||||
|
|
||||||
# Update an item
|
# Update an item
|
||||||
|
@ -125,7 +125,7 @@ module MPW
|
||||||
# comment -> a comment
|
# comment -> a comment
|
||||||
# @rtrn: true if the item has been updated
|
# @rtrn: true if the item has been updated
|
||||||
def update(name, group, server, protocol, login, passwd, port, comment, id=nil)
|
def update(name, group, server, protocol, login, passwd, port, comment, id=nil)
|
||||||
row = Array.new()
|
row = []
|
||||||
update = false
|
update = false
|
||||||
|
|
||||||
i = 0
|
i = 0
|
||||||
|
@ -142,7 +142,7 @@ module MPW
|
||||||
port = nil
|
port = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
row_update = Array.new()
|
row_update = []
|
||||||
row_update[DATE] = Time.now.to_i
|
row_update[DATE] = Time.now.to_i
|
||||||
|
|
||||||
row_update[ID] = id.nil? || id.empty? ? MPW.password(16) : id
|
row_update[ID] = id.nil? || id.empty? ? MPW.password(16) : id
|
||||||
|
@ -238,7 +238,7 @@ module MPW
|
||||||
# @args: file -> path to file import
|
# @args: file -> path to file import
|
||||||
# @rtrn: an array with the items to import, if there is an error return false
|
# @rtrn: an array with the items to import, if there is an error return false
|
||||||
def import_preview(file)
|
def import_preview(file)
|
||||||
result = Array.new()
|
result = []
|
||||||
id = 0
|
id = 0
|
||||||
|
|
||||||
data = IO.read(file)
|
data = IO.read(file)
|
||||||
|
|
|
@ -165,7 +165,7 @@ class Cli
|
||||||
|
|
||||||
# Form to add a new item
|
# Form to add a new item
|
||||||
def add()
|
def add()
|
||||||
row = Array.new()
|
row = []
|
||||||
puts I18n.t('form.add.title')
|
puts I18n.t('form.add.title')
|
||||||
puts '--------------------'
|
puts '--------------------'
|
||||||
name = ask(I18n.t('form.add.name')).to_s
|
name = ask(I18n.t('form.add.name')).to_s
|
||||||
|
|
Loading…
Add table
Reference in a new issue