puppetlabs/puppet — pull request #167 by jhelwig (2011-10-12 20:24:02+00:00)
Title: Tickets/2.7.x/9996 exec resources with multiline commands

Originally we were relying on the behavior that `Array.new` would call
when `#to_a` is called on a string, it does not always return
`[original_string]`. Because `string.to_a` is effectively equivalent to
`string.each_line.to_a` (at least in Ruby 1.8.7) we were breaking
commands with embedded newlines.

Manually wrapping the passed in command in an array, and calling
`#flatten` is much safer since it will not "helpfully" split up the
command string for us.