module Tkn2::Utils

Public Class Methods

strip_heredoc(string) click to toggle source
# File lib/tkn2/utils.rb, line 4
def strip_heredoc(string)
  indent = string.scan(/^[ \t]*(?=\S)/).min
  indent_level = (indent && indent.size) || 0
  string.gsub(/^[ \t]{#{indent_level}}/, '')
end