Module: DeepCover::Tools::StripHeredoc
- Defined in:
- lib/deep_cover/tools/strip_heredoc.rb
Constant Summary collapse
- IMPLEMENTATION =
In-place implementation copied from active-support.
-> do gsub(/^#{scan(/^[ \t]*(?=\S)/).min}/, ''.freeze).tap do |stripped| stripped.freeze if frozen? end end
Instance Method Summary collapse
-
#strip_heredoc(string) ⇒ Object
Same as #strip_heredoc from active-support github.com/rails/rails/blob/16574409f813e2197f88e4a06b527618d64d9ff0/activesupport/lib/active_support/core_ext/string/strip.rb#L22.
Instance Method Details
#strip_heredoc(string) ⇒ Object
Same as #strip_heredoc from active-support github.com/rails/rails/blob/16574409f813e2197f88e4a06b527618d64d9ff0/activesupport/lib/active_support/core_ext/string/strip.rb#L22
14 15 16 |
# File 'lib/deep_cover/tools/strip_heredoc.rb', line 14 def strip_heredoc(string) string.instance_exec(&IMPLEMENTATION) end |