Sha256: 35f5c17cb1ab5d2a15f4a822c12ccd2d476d4aed44e855aca4d754e36994c3a1

Contents?: true

Size: 1.22 KB

Versions: 7

Compression:

Stored size: 1.22 KB

Contents

# 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.pid_file = options[:pid_file] if options[:pid_file] 
        LocalPac.config.lock

        set_log_level(options[:log_level])
        set_debug(options[:debug])

        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.pid_file = options[:pid_file] if options[:pid_file] 
        LocalPac.config.lock

        set_log_level(options[:log_level])
        set_debug(options[:debug])

        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

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
local_pac-0.5.0 lib/local_pac/cli/reload.rb
local_pac-0.4.0 lib/local_pac/cli/reload.rb
local_pac-0.3.0 lib/local_pac/cli/reload.rb
local_pac-0.2.3 lib/local_pac/cli/reload.rb
local_pac-0.2.2 lib/local_pac/cli/reload.rb
local_pac-0.2.1 lib/local_pac/cli/reload.rb
local_pac-0.2.0 lib/local_pac/cli/reload.rb