Sha256: fa1b250dd18e21c1edca59c1239928e818bf7cbd237ef704517a0289147c9bd4

Contents?: true

Size: 847 Bytes

Versions: 6

Compression:

Stored size: 847 Bytes

Contents

# encoding: utf-8
module LocalPac
  class ApplicationStatus

    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)
    end

    def show
      page if should_page

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

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
local_pac-0.4.0 lib/local_pac/application_status.rb
local_pac-0.3.0 lib/local_pac/application_status.rb
local_pac-0.2.3 lib/local_pac/application_status.rb
local_pac-0.2.2 lib/local_pac/application_status.rb
local_pac-0.2.1 lib/local_pac/application_status.rb
local_pac-0.2.0 lib/local_pac/application_status.rb