Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests docs #118

Merged
merged 5 commits into from
Apr 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: drat
Type: Package
Title: 'Drat' R Archive Template
Version: 0.1.8.1
Date: 2021-03-13
Version: 0.1.8.2
Date: 2021-04-08
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(I generally prefer to do this myself to mark releases, but I appreciate that you are also trying to set the release apart.)

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(It also prevents me from merging now as I have about the same at home :) Quick stash will help)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for that. 😭

Some people like the bump, some people don't. Next time I ask.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am ambivalent. I like the attention to detail, and you made enough changes to mark a delta -- just how I think. The 'cannot merge' is just a stash away so no beans. The one thing I really dislike is using .9000 :) as there is zero sense in more than one new digit, incremented starting from zero. And while I said so for years it won't change you-know-where...

It is a bit more important in larger project / possibly use of more PRs like, say, Rcpp. This was fine. Thanks again.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And the one missing piece (a ChangeLog entry) I now added.

Copy link
Contributor Author

@FelixErnst FelixErnst Apr 8, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I know. Justification is also a part of it, e.g. Why start at .9000 and not .0000? And why the long number anyway? I feel it some weird calcification from a long lost regex pattern.

Author: Dirk Eddelbuettel with contributions by Carl Boettiger, Neal Fultz,
Sebastian Gibb, Colin Gillespie, Jan Górecki, Matt Jones, Thomas Leeper,
Steven Pav, Jan Schulz, Christoph Stepper, Felix G.M. Ernst and Patrick
Expand All @@ -21,4 +21,4 @@ License: GPL (>= 2)
URL: https://github.com/eddelbuettel/drat, https://dirk.eddelbuettel.com/code/drat.html
BugReports: https://github.com/eddelbuettel/drat/issues
Encoding: UTF-8
RoxygenNote: 6.0.1
RoxygenNote: 7.1.1
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(I use an older/simpler roxygen by default hence the old version)

(As we can see below, a good part of the diff of Rd files is entirely spurious and just line breaks and style of function signature printing)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There was one warning for me, where the location argument was in the function, but not in the docs.

See line 26 of man/pruneRepo.rd

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh. Good catch. I may have to (eventually) revert all this back just because the older / faster roxygen is my default here at home. (The new one needlessly recompiles shared libraries in packages with code which I find annoying but my issue tickets on it were all closed by the powers-that-be. Oh well. And, being an ESS user and its indentation, I am not a fan of the new look and "styling". Ah well squared. I'll hide under my rock now.)

13 changes: 10 additions & 3 deletions R/insertPackage.R
Original file line number Diff line number Diff line change
Expand Up @@ -255,17 +255,24 @@ getPackageInfo <- function(file) {

td <- tempdir()
if (grepl(".zip$", file)) {
unzip(file, exdir = td)
unzip(file, exdir = td) # Windows
} else if (grepl(".tgz$", file)) {
untar(file, exdir = td)
untar(file, exdir = td) # macOS
} else {
# Source
##stop("Not sure we can handle ", file, call.=FALSE)
fields <- c("Source" = TRUE, "Rmajor" = NA, "osxFolder" = "")
return(fields)
}


# Working with data from compressed file only from here on
pkgname <- gsub("^([a-zA-Z0-9.]*)_.*", "\\1", basename(file))
path <- file.path(td, pkgname, "DESCRIPTION")
if(!file.exists(path)){
stop("DESCRIPTION file cannot be opened in '",file,"'. It is expected ",
"to be located in the base directory of compressed file.",
call. = FALSE)
}
builtstring <- read.dcf(path, 'Built')
unlink(file.path(td, pkgname), recursive = TRUE)

Expand Down
1 change: 1 addition & 0 deletions man/addRepo.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 11 additions & 5 deletions man/archivePackages.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions man/initRepo.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 9 additions & 3 deletions man/insertPackage.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

47 changes: 35 additions & 12 deletions man/pruneRepo.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 12 additions & 5 deletions tests/skeleton_git2r.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@

testSkeletonGit2r <- function() {
wd <- tempdir()

testSkeletonGit2r <- function(wd) {
# options(error=traceback)

# make a package to test with
Expand Down Expand Up @@ -268,7 +266,16 @@ testRepoActions <- function(repodir){
}
}

runTest <- function(wd, location = "gh-pages"){
options("dratBranch" = location)
repodir <- testSkeletonGit2r(wd)
testRepoActions(repodir)
unlink(file.path(wd,"foo"), recursive = TRUE)
unlink(file.path(wd,"drat"), recursive = TRUE)
}

wd <- tempdir()
if (requireNamespace("git2r", quietly=TRUE)) {
repodir <- testSkeletonGit2r()
testRepoActions(repodir)
runTest(wd, "gh-pages")
}
runTest(wd, "docs")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The refactoring is nice!