mirror of
https://github.com/nishiki/manage-password.git
synced 2024-11-23 05:47:53 +00:00
fix show config
This commit is contained in:
parent
62318fe077
commit
8e4fb1c91b
2 changed files with 9 additions and 7 deletions
|
@ -105,7 +105,7 @@ module MPW
|
||||||
'lang' => @config.lang,
|
'lang' => @config.lang,
|
||||||
'gpg_key' => @config.gpg_key,
|
'gpg_key' => @config.gpg_key,
|
||||||
'default_wallet' => @config.default_wallet,
|
'default_wallet' => @config.default_wallet,
|
||||||
'config_dir' => @config.config_dir,
|
'wallet_dir' => @config.wallet_dir,
|
||||||
'pinmode' => @config.pinmode,
|
'pinmode' => @config.pinmode,
|
||||||
'gpg_exe' => @config.gpg_exe
|
'gpg_exe' => @config.gpg_exe
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,11 +58,13 @@ module MPW
|
||||||
wallet_dir = options[:wallet_dir] || @wallet_dir
|
wallet_dir = options[:wallet_dir] || @wallet_dir
|
||||||
default_wallet = options[:default_wallet] || @default_wallet
|
default_wallet = options[:default_wallet] || @default_wallet
|
||||||
gpg_exe = options[:gpg_exe] || @gpg_exe
|
gpg_exe = options[:gpg_exe] || @gpg_exe
|
||||||
pinmode = options[:pinmode] || @pinmode
|
pinmode = options.key?(:pinmode) ? options[:pinmode] : @pinmode
|
||||||
password = { numeric: true,
|
password = {
|
||||||
alpha: true,
|
numeric: true,
|
||||||
special: false,
|
alpha: true,
|
||||||
length: 16 }
|
special: false,
|
||||||
|
length: 16
|
||||||
|
}
|
||||||
|
|
||||||
%w[numeric special alpha length].each do |k|
|
%w[numeric special alpha length].each do |k|
|
||||||
if options.key?("pwd_#{k}".to_sym)
|
if options.key?("pwd_#{k}".to_sym)
|
||||||
|
@ -134,7 +136,7 @@ module MPW
|
||||||
@default_wallet = config['default_wallet']
|
@default_wallet = config['default_wallet']
|
||||||
@gpg_exe = config['gpg_exe']
|
@gpg_exe = config['gpg_exe']
|
||||||
@password = config['password'] || {}
|
@password = config['password'] || {}
|
||||||
@pinmode = config['pinmode']
|
@pinmode = config['pinmode'] || false
|
||||||
|
|
||||||
raise if @gpg_key.empty? || @wallet_dir.empty?
|
raise if @gpg_key.empty? || @wallet_dir.empty?
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue