Sha256: a24b927ab1adfcace257fbd5e050ba26d600a85a5be0b7dedec74e85323a197e

Contents?: true

Size: 1.27 KB

Versions: 1

Compression:

Stored size: 1.27 KB

Contents

# encoding: utf-8
module LocalPac
  module Cli
    class Show < Thor

      desc 'status', 'Show status of local_pac: configuration, known proxy pacs, server running etc.'
      def status
        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.lock

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

        Actions::ShowApplicationStatus.new.run
      end

      desc 'pac_fiel', 'Show pac file.'
      def pac_file(file)
        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.lock

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

        Actions::PrintTitle.new("Content of \"#{file}\"").run
        Actions::ShowPacFile.new(file, LocalPac.config.local_storage).run
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
local_pac-0.6.1 lib/local_pac/cli/show.rb