Class: TestServer::Cli::Reload

Inherits:
Thor
  • Object
show all
Defined in:
lib/test_server/cli/reload.rb

Instance Method Summary collapse

Instance Method Details

#configurationObject



10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/test_server/cli/reload.rb', line 10

def configuration
  TestServer.config = TestServer::Config.new(options[:config_file]) if options[:config_file]
  TestServer.config.log_level = options[:log_level] if options[:log_level]
  TestServer.config.debug_mode = options[:debug_mode] if options[:debug_mode]
  TestServer.config.pid_file = options[:pid_file] if options[:pid_file] 
  TestServer.config.lock

  TestServer.ui_logger.level = TestServer.config.log_level
  TestServer.enable_debug_mode if TestServer.config.debug_mode

  TestServer.ui_logger.info "Ask web application (PID: #{pid(TestServer.config)}) to reload configuration"
  Actions::SendSignal.new(TestServer.config.reload_config_signal).run
end

#local_storageObject



25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/test_server/cli/reload.rb', line 25

def local_storage
  TestServer.config = TestServer::Config.new(options[:config_file]) if options[:config_file]
  TestServer.config.log_level = options[:log_level] if options[:log_level]
  TestServer.config.debug_mode = options[:debug_mode] if options[:debug_mode]
  TestServer.config.pid_file = options[:pid_file] if options[:pid_file] 
  TestServer.config.lock

  TestServer.ui_logger.level = TestServer.config.log_level
  TestServer.enable_debug_mode if TestServer.config.debug_mode

  TestServer.ui_logger.info "Ask web application (PID: #{pid(TestServer.config)}) to reload storage"
  Actions::SendSignal.new(TestServer.config.reload_storage_signal).run
end