# <<~ removes the indentation of the least-indented line. The closing word's own
# indentation plays no part.

def show(title, text)
  puts title
  text.each_line { |line| puts "  |#{line.chomp}|" }
  puts
end

id = 7

show "<<~SQL, lines indented 6, 8 and 7, closing word indented 4:", <<~SQL
      SELECT name
        FROM users
       WHERE id = #{id}
    SQL

show "<<-SQL keeps every space; only the closing word may be indented:", <<-SQL
      SELECT name
    SQL

show "<<~'SQL' in quotes does not interpolate:", <<~'SQL'
    WHERE id = #{id}
  SQL
