1
0
Fork 0
mirror of https://github.com/nishiki/manage-password.git synced 2024-11-30 08:53:05 +00:00

add last_update in MPWConfig

This commit is contained in:
nishiki 2014-01-12 11:36:56 +01:00
parent 477178ecdd
commit b9988102d6

View file

@ -19,6 +19,7 @@ class MPWConfig
attr_accessor :sync_port attr_accessor :sync_port
attr_accessor :sync_pwd attr_accessor :sync_pwd
attr_accessor :sync_sufix attr_accessor :sync_sufix
attr_accessor :sync_last_update
# Constructor # Constructor
# @args: file_config -> the specify config file # @args: file_config -> the specify config file
@ -57,7 +58,8 @@ class MPWConfig
'sync_host' => host, 'sync_host' => host,
'sync_port' => port, 'sync_port' => port,
'sync_pwd' => password, 'sync_pwd' => password,
'sync_suffix' => suffix}} 'sync_suffix' => suffix,
'last_update' => 0 }}
begin begin
File.open(@file_config, 'w') do |file| File.open(@file_config, 'w') do |file|
@ -84,6 +86,7 @@ class MPWConfig
@sync_port = config['config']['sync_port'] @sync_port = config['config']['sync_port']
@sync_pwd = config['config']['sync_pwd'] @sync_pwd = config['config']['sync_pwd']
@sync_sufix = config['config']['sync_suffix'] @sync_sufix = config['config']['sync_suffix']
@sync_last_update = config['config']['sync_last_update'].to_i
if @key.empty? || @file_gpg.empty? if @key.empty? || @file_gpg.empty?
@error_msg = I18n.t('error.config.check') @error_msg = I18n.t('error.config.check')