Sha256: 7d3a24a1b2c1d359e7009b715a254bf70f7d22c8d61c4bf07e675de016900b76
Contents?: true
Size: 613 Bytes
Versions: 34
Compression:
Stored size: 613 Bytes
Contents
# frozen_string_literal: true module RailsAppGenerator # Utility methods class Util class << self # Log KeyValue pair # # @example # Util.kv(:key, :value) def kv(label, value, len = 35) return ' ' * len if label.nil? label = label.to_s if label.is_a?(Symbol) label = label.length > len ? label.slice(0..len) : label.ljust(len, ' ') puts "#{label}: #{value}" end def line(heading, len = 80) heading = "- [ #{heading} ]" puts heading.length > len ? heading : heading.ljust(len, '-') end end end end
Version data entries
34 entries across 34 versions & 1 rubygems