@@ -28,6 +28,7 @@ Rcpp.package.skeleton <- function(name = "anRpackage", list = character(),
2828
2929 havePkgKitten <- requireNamespace(" pkgKitten" , quietly = TRUE )
3030
31+
3132 call <- match.call()
3233 call [[1 ]] <- as.name(" package.skeleton" )
3334 env <- parent.frame(1 )
@@ -118,16 +119,7 @@ Rcpp.package.skeleton <- function(name = "anRpackage", list = character(),
118119 if (havePkgKitten ) { # if pkgKitten is available, use it
119120 pkgKitten :: playWithPerPackageHelpPage(name , path , maintainer , email )
120121 } else {
121- package_help_page <- file.path(root , " man" , sprintf( " %s-package.Rd" , name ))
122- if (file.exists(package_help_page )) {
123- lines <- readLines(package_help_page )
124- lines <- gsub(" What license is it under?" , license , lines , fixed = TRUE )
125- lines <- gsub(" Who to complain to <yourfault@somewhere.net>" ,
126- sprintf( " %s <%s>" , maintainer , email ),
127- lines , fixed = TRUE )
128- lines <- gsub( " Who wrote it" , author , lines , fixed = TRUE )
129- writeLines(lines , package_help_page )
130- }
122+ .playWithPerPackageHelpPage(name , path , maintainer , email )
131123 }
132124
133125 # # lay things out in the src directory
@@ -209,3 +201,23 @@ Rcpp.package.skeleton <- function(name = "anRpackage", list = character(),
209201
210202 invisible (NULL )
211203}
204+
205+ # # Borrowed with love from pkgKitten, and modified slightly
206+ .playWithPerPackageHelpPage <- function (name = " anRpackage" ,
207+ path = " ." ,
208+ maintainer = " Your Name" ,
209+ email = " your@mail.com" ) {
210+ root <- file.path(path , name )
211+ helptgt <- file.path(root , " man" , sprintf( " %s-package.Rd" , name ))
212+ helpsrc <- system.file(" skeleton" , " manual-page-stub.Rd" , package = " Rcpp" )
213+ # # update the package description help page
214+ if (file.exists(helpsrc )) {
215+ lines <- readLines(helpsrc )
216+ lines <- gsub(" __placeholder__" , name , lines , fixed = TRUE )
217+ lines <- gsub(" Who to complain to <yourfault@somewhere.net>" ,
218+ sprintf( " %s <%s>" , maintainer , email ),
219+ lines , fixed = TRUE )
220+ writeLines(lines , helptgt )
221+ }
222+ invisible (NULL )
223+ }
0 commit comments