basics/heredoc.rb

tests/_examples/basics/heredoc.rb in the metorex repository.

# Heredoc examples
text = <<~HEREDOC
  Hello, World!
  This is a heredoc.
HEREDOC
puts text

greeting = <<~MSG
  Good morning!
MSG
puts greeting.strip

Output:

Hello, World!
This is a heredoc.
Good morning!