Sha256: 9d61a6bf3f59955c5e905bb9cbd5a9cd5db8d283de66cc543165976ecde5db8e

Contents?: true

Size: 1.68 KB

Versions: 20

Compression:

Stored size: 1.68 KB

Contents

# encoding: utf-8
module TestServer
  module Cli
    class Reload < Thor
      no_commands {
        include TestServer::Cli::Helper
      }

      desc 'configuration', 'Reload configuration'
      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

      desc 'local_storage', 'Reload local_storage'
      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
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
test_server-0.5.2 lib/test_server/cli/reload.rb
test_server-0.5.1 lib/test_server/cli/reload.rb
test_server-0.5.0 lib/test_server/cli/reload.rb
test_server-0.4.1 lib/test_server/cli/reload.rb
test_server-0.4.0 lib/test_server/cli/reload.rb
test_server-0.3.7 lib/test_server/cli/reload.rb
test_server-0.3.6 lib/test_server/cli/reload.rb
test_server-0.3.5 lib/test_server/cli/reload.rb
test_server-0.3.4 lib/test_server/cli/reload.rb
test_server-0.3.2 lib/test_server/cli/reload.rb
test_server-0.3.1 lib/test_server/cli/reload.rb
test_server-0.2.4 lib/test_server/cli/reload.rb
test_server-0.2.3 lib/test_server/cli/reload.rb
test_server-0.2.2 lib/test_server/cli/reload.rb
test_server-0.2.1 lib/test_server/cli/reload.rb
test_server-0.2.0 lib/test_server/cli/reload.rb
test_server-0.1.2 lib/test_server/cli/reload.rb
test_server-0.1.1 lib/test_server/cli/reload.rb
test_server-0.1.0 lib/test_server/cli/reload.rb
test_server-0.0.11 lib/test_server/cli/reload.rb