diff --git a/DESCRIPTION b/DESCRIPTION index d3c9c19..c57d500 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: Rd2roxygen Type: Package Title: Convert Rd to 'Roxygen' Documentation -Version: 1.6.2 +Version: 1.6.3 Date: 2017-03-30 Authors@R: c( person("Hadley", "Wickham", role = "aut"), diff --git a/NEWS b/NEWS index 3e77abb..8efae17 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,9 @@ + CHANGES IN Rd2roxygen VERSION 1.7 + +BUG FIXES + + o importRd() fails due to a change in roxygen2 (https://github.com/klutometis/roxygen/issues/568). + CHANGES IN Rd2roxygen VERSION 1.6.2 MAJOR CHANGES diff --git a/R/build.R b/R/build.R index f8fa474..21da6bd 100644 --- a/R/build.R +++ b/R/build.R @@ -39,6 +39,13 @@ roxygen_and_build = function( if (length(pkg) != 1) stop('The package directory must be one character string') in_dir(pkg, before) roxygen2::roxygenize(pkg, ...) + desc = file.path(pkg, 'DESCRIPTION') + pv = read.dcf(desc, fields = c('Package', 'Version')) + # undo roxygen2's hack https://github.com/klutometis/roxygen/issues/568 + # because it affects importRd() + for (name in intersect(c('devtools_shims', paste0('package:', pv[1, 1])), search())) { + detach(name, unload = TRUE, character.only = TRUE) + } if (reformat) { message('Reformatting usage and examples') rd.list = list.files( @@ -46,8 +53,6 @@ roxygen_and_build = function( ) for (f in rd.list) reformat_code(f) } - desc = file.path(pkg, 'DESCRIPTION') - pv = read.dcf(desc, fields = c('Package', 'Version')) # delete existing tarballs unlink(sprintf('%s_*.tar.gz', pv[1, 1])) if (build) {