Path: blob/master/lib/msf/ui/console/table.rb
19592 views
# -*- coding: binary -*-12module Msf3module Ui4module Console56###7#8# Console table display wrapper that allows for stylized tables9#10###11class Table < Rex::Text::Table1213#14# Default table styles.15#16module Style17Default = 018end1920def self.new(*args, &block)21style, opts = args2223if style == Style::Default24opts['Indent'] = 325if (!opts['Prefix'])26opts['Prefix'] = "\n"27end28if (!opts['Postfix'])29opts['Postfix'] = "\n"30end31end3233instance = super(opts, &block)34if style == Style::Default35instance.extend(DefaultStyle)36end37instance38end3940module DefaultStyle41#42# Print nothing if there are no rows if the style is default.43#44def to_s45return '' if (rows.length == 0)4647super48end49end50end51end52end53end545556