class RokkinHelper
Public Class Methods
strip_heredoc(heredoc)
click to toggle source
Modified from api.rubyonrails.org/classes/String.html#method-i-strip_heredoc which linked to github.com/rails/rails/blob/b422cda2ebfff4032f4c18271e96ad329c413dcc/activesupport/lib/active_support/core_ext/string/strip.rb#L22 File activesupport/lib/active_support/core_ext/string/strip.rb, line 22
# File lib/rokkin.rb, line 39 def self.strip_heredoc(heredoc) indent = heredoc.scan(/^[ \t]*(?=\S)/).min.length || 0 heredoc.gsub(/^[ \t]{#{indent}}/, '') end