1
0
Fork 0
mirror of https://github.com/nishiki/manage-password.git synced 2024-11-26 23:33:03 +00:00

fix show config

This commit is contained in:
Adrien Waksberg 2017-05-18 23:30:54 +02:00
parent 62318fe077
commit 8e4fb1c91b
2 changed files with 9 additions and 7 deletions

View file

@ -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
} }

View file

@ -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 = {
numeric: true,
alpha: true, alpha: true,
special: false, special: false,
length: 16 } 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?