mirror of
https://github.com/nishiki/manage-password.git
synced 2025-02-21 10:20:05 +00:00
fix indentation for multiline method and hash
This commit is contained in:
parent
782f3d8b5f
commit
b1fd013d92
3 changed files with 45 additions and 43 deletions
|
@ -148,8 +148,7 @@ class MPW::Cli
|
|||
protocol: { length: 9, color: 'white' },
|
||||
port: { length: 5, color: 'white' },
|
||||
otp: { length: 4, color: 'white' },
|
||||
comment: { length: 14, color: 'magenta' },
|
||||
}
|
||||
comment: { length: 14, color: 'magenta' } }
|
||||
|
||||
items.each do |item|
|
||||
data.each do |k, v|
|
||||
|
@ -481,7 +480,9 @@ class MPW::Cli
|
|||
data = {}
|
||||
|
||||
items.each do |item|
|
||||
data.merge!(item.id => { 'host' => item.host,
|
||||
data.merge!(
|
||||
item.id => {
|
||||
'host' => item.host,
|
||||
'user' => item.user,
|
||||
'group' => item.group,
|
||||
'password' => @mpw.get_password(item.id),
|
||||
|
@ -514,8 +515,7 @@ class MPW::Cli
|
|||
protocol: row['protocol'],
|
||||
user: row['user'],
|
||||
port: row['port'],
|
||||
comment: row['comment'],
|
||||
)
|
||||
comment: row['comment'])
|
||||
|
||||
next if item.empty?
|
||||
|
||||
|
|
|
@ -60,8 +60,7 @@ class MPW::Config
|
|||
password = { numeric: true,
|
||||
alpha: true,
|
||||
special: false,
|
||||
length: 16,
|
||||
}
|
||||
length: 16 }
|
||||
|
||||
%w(numeric special alpha length).each do |k|
|
||||
if options.key?("pwd_#{k}".to_sym)
|
||||
|
@ -81,8 +80,7 @@ class MPW::Config
|
|||
'wallet_dir' => wallet_dir,
|
||||
'default_wallet' => default_wallet,
|
||||
'gpg_exe' => gpg_exe,
|
||||
'password' => password,
|
||||
}
|
||||
'password' => password }
|
||||
|
||||
FileUtils.mkdir_p(@config_dir, mode: 0700)
|
||||
FileUtils.mkdir_p(wallet_dir, mode: 0700)
|
||||
|
|
|
@ -80,7 +80,9 @@ class MPW::MPW
|
|||
|
||||
unless data.to_s.empty?
|
||||
YAML.safe_load(data).each_value do |d|
|
||||
@data.push(Item.new(id: d['id'],
|
||||
@data.push(
|
||||
Item.new(
|
||||
id: d['id'],
|
||||
group: d['group'],
|
||||
host: d['host'],
|
||||
protocol: d['protocol'],
|
||||
|
@ -108,7 +110,9 @@ class MPW::MPW
|
|||
@data.each do |item|
|
||||
next if item.empty?
|
||||
|
||||
data.merge!(item.id => { 'id' => item.id,
|
||||
data.merge!(
|
||||
item.id => {
|
||||
'id' => item.id,
|
||||
'group' => item.group,
|
||||
'host' => item.host,
|
||||
'protocol' => item.protocol,
|
||||
|
|
Loading…
Add table
Reference in a new issue