# 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