[Rake-devel] Rake::Win32.rake_system

Turpin, Jay jay.turpin at intel.com
Thu Sep 25 23:08:43 EDT 2008


All,

Once we upgraded from rake 0.8.1 to 0.8.3, our builds began to break. I traced the issue down to the tasks which were executing sh commands that had embedded newline characters in them.

For instance, we will often construct small SQL queries using Ruby and then execute using a command-line SQL tool:

sh "sqlcmd -E -S localhost -Q \"SET NOCOUNT ON
EXEC sp_who"

This syntax used to work fine, but now there has been a change to use Rake::Win32.rake_system() instead of using the system()

# Run a command line on windows.
def rake_system(*cmd)
  if cmd.size == 1
    system("call #{cmd}")
  else
     system(*cmd)
  end
end

I'm not sure why this change was made, but if we can modify it to use this syntax instead, it resolves the issue for us:

def rake_system(*cmd)
  cmd.each do |c|
    system(c)
  end
end

Thanks

Regards,
Jay Turpin
"Wit is educated insolence." - Aristotle
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rake-devel/attachments/20080925/eea612e7/attachment.html>


More information about the Rake-devel mailing list