Skip to content

Commit 4f29d65

Browse files
committed
Merge pull request #176 from RcppCore/feature/use-pkgkitten
Feature/use pkgkitten
2 parents 2fac588 + 438e142 commit 4f29d65

File tree

4 files changed

+23
-17
lines changed

4 files changed

+23
-17
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ before_install:
1919

2020
install:
2121
- ./travis-tool.sh install_aptget r-cran-runit
22-
- ./travis-tool.sh install_r inline rbenchmark highlight
22+
- ./travis-tool.sh install_r inline rbenchmark highlight pkgKitten
2323

2424
script:
2525
- ./travis-tool.sh run_tests

DESCRIPTION

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: Rcpp
22
Title: Seamless R and C++ Integration
3-
Version: 0.11.2.3
4-
Date: 2014-09-03
3+
Version: 0.11.2.4
4+
Date: 2014-09-10
55
Author: Dirk Eddelbuettel, Romain Francois, JJ Allaire, Kevin Ushey,
66
Douglas Bates, and John Chambers
77
Maintainer: Dirk Eddelbuettel <[email protected]>
@@ -51,7 +51,7 @@ Description: The Rcpp package provides R functions as well as a C++ library
5151
see 'citation("Rcpp")' for details.
5252
Depends: R (>= 3.0.0)
5353
Imports: methods
54-
Suggests: RUnit, inline, rbenchmark, highlight
54+
Suggests: RUnit, inline, rbenchmark, highlight, pkgKitten (>= 0.1.1)
5555
VignetteBuilder: highlight
5656
URL: http://www.rcpp.org, http://dirk.eddelbuettel.com/code/rcpp.html, https://github.com/RcppCore/Rcpp
5757
License: GPL (>= 2)

R/Rcpp.package.skeleton.R

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,10 @@ Rcpp.package.skeleton <- function(name = "anRpackage", list = character(),
2626
maintainer = if (missing(author)) "Who to complain to"
2727
else author,
2828
email = "[email protected]",
29-
license = "What Licence is it under ?") {
29+
license = "GPL (>= 2)") {
3030

31+
havePkgKitten <- require("pkgKitten", quietly=TRUE, character.only=TRUE)
32+
3133
call <- match.call()
3234
call[[1]] <- as.name("package.skeleton")
3335
env <- parent.frame(1)
@@ -117,17 +119,21 @@ Rcpp.package.skeleton <- function(name = "anRpackage", list = character(),
117119
close( ns )
118120

119121
## update the package description help page
120-
package_help_page <- file.path(root, "man", sprintf( "%s-package.Rd", name))
121-
if (file.exists(package_help_page)) {
122-
lines <- readLines(package_help_page)
123-
lines <- gsub("What license is it under?", license, lines, fixed = TRUE)
124-
lines <- gsub("Who to complain to <[email protected]>",
125-
sprintf( "%s <%s>", maintainer, email),
126-
lines, fixed = TRUE)
127-
lines <- gsub( "Who wrote it", author, lines, fixed = TRUE)
128-
writeLines(lines, package_help_page)
129-
}
130-
122+
if (havePkgKitten) { # if pkgKitten is available, use it
123+
pkgKitten::playWithPerPackageHelpPage(name, path, maintainer, email)
124+
} else {
125+
package_help_page <- file.path(root, "man", sprintf( "%s-package.Rd", name))
126+
if (file.exists(package_help_page)) {
127+
lines <- readLines(package_help_page)
128+
lines <- gsub("What license is it under?", license, lines, fixed = TRUE)
129+
lines <- gsub("Who to complain to <[email protected]>",
130+
sprintf( "%s <%s>", maintainer, email),
131+
lines, fixed = TRUE)
132+
lines <- gsub( "Who wrote it", author, lines, fixed = TRUE)
133+
writeLines(lines, package_help_page)
134+
}
135+
}
136+
131137
## lay things out in the src directory
132138
src <- file.path(root, "src")
133139
if (!file.exists(src)) {

man/Rcpp.package.skeleton.Rd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Rcpp.package.skeleton(name = "anRpackage", list = character(),
1818
author = "Who wrote it",
1919
maintainer = if(missing( author)) "Who to complain to" else author,
2020
email = "[email protected]",
21-
license = "What Licence is it under ?"
21+
license = "GPL (>= 2)"
2222
)
2323
}
2424
\arguments{

0 commit comments

Comments
 (0)