# encoding: utf-8 module LocalPac module Cli class Reload < Thor no_commands { include LocalPac::Cli::Helper } desc 'configuration', 'Reload configuration' def configuration LocalPac.config = LocalPac::Config.new(options[:config_file]) if options[:config_file] LocalPac.config.log_level = options[:log_level] if options[:log_level] LocalPac.config.debug_mode = options[:debug_mode] if options[:debug_mode] LocalPac.config.pid_file = options[:pid_file] if options[:pid_file] LocalPac.config.lock LocalPac.ui_logger.level = LocalPac.config.log_level LocalPac.enable_debug_mode if LocalPac.config.debug_mode LocalPac.ui_logger.info "Ask web application (PID: #{pid(LocalPac.config)}) to reload configuration" Actions::SendSignal.new(LocalPac.config.reload_config_signal).run end desc 'local_storage', 'Reload local_storage' def local_storage LocalPac.config = LocalPac::Config.new(options[:config_file]) if options[:config_file] LocalPac.config.log_level = options[:log_level] if options[:log_level] LocalPac.config.debug_mode = options[:debug_mode] if options[:debug_mode] LocalPac.config.pid_file = options[:pid_file] if options[:pid_file] LocalPac.config.lock LocalPac.ui_logger.level = LocalPac.config.log_level LocalPac.enable_debug_mode if LocalPac.config.debug_mode LocalPac.ui_logger.info "Ask web application (PID: #{pid(LocalPac.config)}) to reload storage" Actions::SendSignal.new(LocalPac.config.reload_storage_signal).run end end end end