Class: RokkinHelper
- Inherits:
-
Object
- Object
- RokkinHelper
- Defined in:
- lib/rokkin.rb
Class Method Summary collapse
-
.strip_heredoc(heredoc) ⇒ Object
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.
Class Method Details
.strip_heredoc(heredoc) ⇒ Object
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
39 40 41 42 |
# File 'lib/rokkin.rb', line 39 def self.strip_heredoc(heredoc) indent = heredoc.scan(/^[ \t]*(?=\S)/).min.length || 0 heredoc.gsub(/^[ \t]{#{indent}}/, '') end |