Method: J1::Utils#strip_heredoc
- Defined in:
- lib/j1/utils.rb
#strip_heredoc(str) ⇒ Object
Takes an indented string and removes the preceding spaces on each line
72 73 74 |
# File 'lib/j1/utils.rb', line 72 def strip_heredoc(str) str.gsub(%r!^[ \t]{#{(str.scan(%r!^[ \t]*(?=\S)!).min || "").size}}!, "") end |