def pad(text, padding, fill: SPACE, separator: NEWLINE)
      padding   = Strings::Padder.parse(padding)
      text_copy = text.dup
      line_width = max_line_length(text, separator)
      output = []

      filler_line = fill * line_width

      padding.top.times do
        output << pad_around(filler_line, padding, fill: fill)
      end

      text_copy.split(separator).each do |line|
        output << pad_around(line, padding, fill: fill)
      end

      padding.bottom.times do
        output << pad_around(filler_line, padding, fill: fill)
      end

      output.join(separator)
    end
def pad(text, padding, fill: SPACE, separator: NEWLINE)
      padding   = Strings::Padder.parse(padding)
      text_copy = text.dup
      line_width = max_line_length(text, separator)
      output = []

      filler_line = fill * line_width

      padding.top.times do
        output << pad_around(filler_line, padding, fill: fill)
      end

      text_copy.split(separator).each do |line|
        output << pad_around(line, padding, fill: fill)
      end

      padding.bottom.times do
        output << pad_around(filler_line, padding, fill: fill)
      end

      output.join(separator)
    end
Apply padding to multiline text with ANSI codes

 @param [String] text
   the text to pad out
 @param [Integer, Array[Integer]] padding
   the padding to apply to text

 @example
  text = "Ignorance is the parent of fear."

  Strings::Pad.pad(text, [1, 2], fill: "*")
  # =>
  # "************************************\n"
  # "**Ignorance is the parent of fear.**\n"
  # "************************************\n"

 @return [String]

 @api private