Permalink
Browse files

Fixes for R CMD check

  • Loading branch information...
wch committed Aug 20, 2012
1 parent e313bc6 commit 1893d905b3b29ea6e9c32994e85af9f797bac199
Showing with 36 additions and 4 deletions.
  1. +1 −0 NAMESPACE
  2. +2 −0 R/imports-env.r
  3. +4 −3 R/namespace-env.r
  4. +3 −1 R/parent-envs.r
  5. +1 −0 R/reload-devtools.r
  6. +5 −0 R/run-loadhooks.r
  7. +5 −0 man/imports_env.Rd
  8. +4 −0 man/print.envlist.Rd
  9. +3 −0 man/reload_devtools.Rd
  10. +4 −0 man/run_onattach.Rd
  11. +4 −0 man/run_onload.Rd
View
@@ -70,6 +70,7 @@ importFrom(httr,GET)
importFrom(httr,authenticate)
importFrom(httr,config)
importFrom(httr,content)
+importFrom(httr,parsed_content)
importFrom(httr,stop_for_status)
importFrom(httr,text_content)
importFrom(memoise,memoise)
View
@@ -4,6 +4,8 @@
#' package namespace environment, and is a child of <namespace:base>,
#' which is a child of R_GlobalEnv.
#' @keywords programming
+#' @param pkg package description, can be path or package name. See
+#' \code{\link{as.package}} for more information.
#' @seealso \code{\link{ns_env}} for the namespace environment that
#' all the objects (exported and not exported).
#' @seealso \code{\link{pkg_env}} for the attached environment that contains
View
@@ -80,9 +80,10 @@ setup_ns_imports <- function(pkg) {
# namespaceExport throw errors if the objects are not present.
setup_ns_exports <- function(pkg, export_all = FALSE) {
nsInfo <- parse_ns_file(pkg)
+ nsenv <- ns_env(pkg)
if (export_all) {
- exports <- ls(ns_env(pkg), all.names = TRUE)
+ exports <- ls(nsenv, all.names = TRUE)
# List of things to ignore is from loadNamespace. There are also a
# couple things to ignore from devtools.
@@ -96,12 +97,12 @@ setup_ns_exports <- function(pkg, export_all = FALSE) {
# This code is from base::loadNamespace
exports <- nsInfo$exports
for (p in nsInfo$exportPatterns)
- exports <- c(ls(env, pattern = p, all.names = TRUE), exports)
+ exports <- c(ls(nsenv, pattern = p, all.names = TRUE), exports)
}
# Update the exports metadata for the namespace with base::namespaceExport
# It will throw warnings if objects are already listed in the exports
# metadata, so catch those warnings and ignore them.
- suppressWarnings(namespaceExport(ns_env(pkg), exports))
+ suppressWarnings(namespaceExport(nsenv, exports))
invisible()
}
View
@@ -69,10 +69,12 @@ as.envlist <- function(x) {
#' Print an \code{envlist}
#'
+#' @param x An \code{envlist} object to print.
#' @param name If \code{TRUE} (the default), print the \code{name}
#' attribute of each environment.
#' @param path If \code{TRUE}, print the \code{path} attribute of
#' each environment.
+#' @param ... Other arguments to be passed to \code{print}.
#' @export
#' @method print envlist
print.envlist <- function(x, name = TRUE, path = FALSE, ...) {
@@ -92,7 +94,7 @@ print.envlist <- function(x, name = TRUE, path = FALSE, ...) {
dat <- cbind(dat, path = paths, stringsAsFactors = FALSE)
}
- print(dat, right = FALSE)
+ print(dat, ..., right = FALSE)
invisible(x)
}
View
@@ -11,6 +11,7 @@
#'
#' @param pkg package description, can be path or package name. This
#' must be the devtools package.
+#' @param ... other arguments to be passed on to \code{load_all}.
reload_devtools <- function(pkg = NULL, ...) {
pkg <- as.package(pkg)
View
@@ -6,6 +6,8 @@
#'
#' A variable called \code{onLoad} is created in the package's
#' devtools metdata to indicate that it's attached.
+#' @param pkg package description, can be path or package name. See
+#' \code{\link{as.package}} for more information
run_onload <- function(pkg = NULL) {
pkg <- as.package(pkg)
nsenv <- ns_env(pkg)
@@ -27,6 +29,9 @@ run_onload <- function(pkg = NULL) {
#'
#' A variable called \code{onAttach} is created in the package's
#' devtools metdata to indicate that it's attached.
+#' @param pkg package description, can be path or package name. See
+#' \code{\link{as.package}} for more information
+#' @importFrom httr parsed_content
run_onattach <- function(pkg = NULL) {
pkg <- as.package(pkg)
nsenv <- ns_env(pkg)
View
@@ -4,6 +4,11 @@
\usage{
imports_env(pkg = NULL)
}
+\arguments{
+ \item{pkg}{package description, can be path or package
+ name. See \code{\link{as.package}} for more
+ information.}
+}
\description{
Contains objects imported from other packages. Is the
parent of the package namespace environment, and is a
View
@@ -6,11 +6,15 @@
...)
}
\arguments{
+ \item{x}{An \code{envlist} object to print.}
+
\item{name}{If \code{TRUE} (the default), print the
\code{name} attribute of each environment.}
\item{path}{If \code{TRUE}, print the \code{path}
attribute of each environment.}
+
+ \item{...}{Other arguments to be passed to \code{print}.}
}
\description{
Print an \code{envlist}
View
@@ -7,6 +7,9 @@
\arguments{
\item{pkg}{package description, can be path or package
name. This must be the devtools package.}
+
+ \item{...}{other arguments to be passed on to
+ \code{load_all}.}
}
\description{
Special care must be take to reload the devtools package.
View
@@ -4,6 +4,10 @@
\usage{
run_onattach(pkg = NULL)
}
+\arguments{
+ \item{pkg}{package description, can be path or package
+ name. See \code{\link{as.package}} for more information}
+}
\description{
This is run after copying objects from the namespace to
the package environment. In a normal install + load, the
View
@@ -4,6 +4,10 @@
\usage{
run_onload(pkg = NULL)
}
+\arguments{
+ \item{pkg}{package description, can be path or package
+ name. See \code{\link{as.package}} for more information}
+}
\description{
This is run before copying objects from the namespace to
the package environment. In a normal install + load, the

0 comments on commit 1893d90

Please sign in to comment.