module ForemanMaintain::CoreExt::StripHeredoc

Public Instance Methods

strip_heredoc() click to toggle source
# File lib/foreman_maintain/core_ext.rb, line 4
def strip_heredoc
  indent = 0
  indented_lines = scan(/^[ \t]+(?=\S)/)
  unless indented_lines.empty?
    indent = indented_lines.min.size
  end
  gsub(/^[ \t]{#{indent}}/, '')
end