Sha256: a68216b0e396bcebafbc88d5d25631245bb216571f592726195d3837dd8c4409
Contents?: true
Size: 334 Bytes
Versions: 9
Compression:
Stored size: 334 Bytes
Contents
module Runbook::Helpers module FormatHelper def deindent(str, padding: 0) lines = str.split("\n") indentations = lines.map { |l| l.size - l.gsub(/^\s+/, "").size } min_indentation = indentations.min lines.map! { |line| " " * padding + line[min_indentation..-1] } lines.join("\n") end end end
Version data entries
9 entries across 9 versions & 2 rubygems