Module: Librarian::Helpers
Instance Method Summary collapse
-
#strip_heredoc(string) ⇒ Object
[active_support/core_ext/string/strip].
Instance Method Details
#strip_heredoc(string) ⇒ Object
- active_support/core_ext/string/strip
6 7 8 9 10 |
# File 'lib/librarian/helpers.rb', line 6 def strip_heredoc(string) indent = string.scan(/^[ \t]*(?=\S)/).min indent = indent.respond_to?(:size) ? indent.size : 0 string.gsub(/^[ \t]{#{indent}}/, '') end |