18 Nov

Heredoc Tip

I do really like the Heredoc format allowing you easily create multiple lines explicit strings in Ruby. However you will suffer from a trailing newline which most of the time you won’t want.

e.g.

html_expected = <<eos
<!DOCTYPE html>
<html>

Fruitful theme by fruitfulcode Powered by: WordPress