RcppCore/Rcpp — pull request #141 by yixuan (2014-04-29 21:59:43+00:00)
Title: enhance the output of sourceCpp()

There are some drawbacks of the current version of `sourceCpp()`:

1. On windows, the output will be squeezed into one line which looks a bit messy. This is because in line 131 and line 135 of R/Attributes.R, `result` is a character **vector** but `cat(result, "\n")` will concatenate each string with the default space separator. We should use `cat(result, sep = "\n")` instead.
2. Some of the output by `sourceCpp()` is not captured by R, but instead written to `stderr`. This means that if we are calling `sourceCpp()`(or `cppFunction()`) inside a `knitr` document, we will lose part of the error messages.

This patch uses `system2()` instead of `system` to capture the output of `R CMD SHLIB`, which will record all the warning and error messages.