Replace empty array with undef, because if() in template evaluates [] as true
Merge pull request #1 from djotto/bugfix

Replace empty array with undef
Add each_line to support ruby 1.9+.