Sha256: 0b5af74c8a5fccacbc91f6f4f1b4735f47b36b9831e22d41daf118510b8f4c39
Contents?: true
Size: 592 Bytes
Versions: 12
Compression:
Stored size: 592 Bytes
Contents
require 'highline' module CollinsShell module PrinterUtil def format_datetime value if !value.is_a?(DateTime) then val = DateTime.parse(value) else val = value end val.strftime('%Y-%m-%d %H:%M:%S') end def wrap_text(txt, col = 80) txt.gsub(/(.{1,#{col}})( +|$\n?)|(.{1,#{col}})/, "\\1\\3\n") end def dynamic_terminal_width highline_width = HighLine::SystemExtensions.terminal_size[1].to_i thor_width = Thor::Shell::Basic.new.terminal_width.to_i [highline_width,thor_width,80].max end end end
Version data entries
12 entries across 12 versions & 1 rubygems