module LocalPac module Actions class PrintTitle private attr_reader :title, :width public def initialize(title, width = 0) @title = title @width = width end def run puts long_line puts full_title puts long_line print "\n" end private def long_line '#' * full_title.size end def full_title header + ' ' + title + ' ' + header end def header if width > title.size '#' * ((width - title.size) / 2) else '#' end end end end end