Sha256: 619952f323b656b60f4a45f8eee87566eb082099be18b12231faedd53452b343

Contents?: true

Size: 1.1 KB

Versions: 8

Compression:

Stored size: 1.1 KB

Contents

# encoding: utf-8
module LocalPac
  module Actions
    class ShowApplicationStatus

      private

      include Pager

      attr_reader :should_page

      public

      def initialize(options = {})
        @should_page = options.fetch(:pager, :true)
        config = options.fetch(:config, LocalPac.config)

        @actions = []
        @actions << Actions::PrintTitle.new('System Information')
        @actions << Actions::GetSystemInformation.new
        @actions << Actions::PrintNewline.new(2)
        @actions << Actions::PrintTitle.new('Application Configuration')
        @actions << Actions::ShowConfig.new
        @actions << Actions::PrintNewline.new(2)
        @actions << Actions::PrintTitle.new('Process Information')
        @actions << Actions::ShowProcessInformation.new(config.pid_file)
        @actions << Actions::PrintNewline.new(2)
        @actions << Actions::PrintTitle.new('Available Proxy.Pac-Files')
        @actions << Actions::ShowAvailableProxyPacFiles.new(config.local_storage)
      end

      def run
        page if should_page

        @actions.each(&:run)
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
local_pac-0.10.2 lib/local_pac/actions/show_application_status.rb
local_pac-0.10.1 lib/local_pac/actions/show_application_status.rb
local_pac-0.10.0 lib/local_pac/actions/show_application_status.rb
local_pac-0.9.0 lib/local_pac/actions/show_application_status.rb
local_pac-0.7.0 lib/local_pac/actions/show_application_status.rb
local_pac-0.6.3 lib/local_pac/actions/show_application_status.rb
local_pac-0.6.2 lib/local_pac/actions/show_application_status.rb
local_pac-0.6.1 lib/local_pac/actions/show_application_status.rb