How do I remove leading whitespace chars from Ruby HEREDOC?
The <<- form of heredoc only ignores leading whitespace for the end delimiter. With Ruby 2.3 and later you can use a squiggly heredoc (<<~) to suppress the leading whitespace of content lines: def test <<~END First content line. Two spaces here. No space here. END end test # => “First content line.\n Two spaces … Read more