diff --git a/DESCRIPTION b/DESCRIPTION index a376a82..bede270 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,35 +1,41 @@ -Package: rtika Type: Package -Title: R Interface to 'Apache Tika' -Version: 2.0.0 +Package: rtika +Title: R Interface to 'Apache Tika' +Version: 2.0.0.9000 Authors@R: c( - person(given = "Sasha", family = "Goodman", email="goodmansasha@gmail.com", role=c("aut","cre") ), - person(given = "The Apache Software Foundation", role=c("aut","cph") ), - person(given = "Julia", family = "Silge", role = c("rev"), comment = "Reviewed the package for rOpenSci, see https://github.com/ropensci/software-review/issues/191/"), - person(given = "David",family = "Gohel", role = c("rev"), comment = "Reviewed the package for rOpenSci, see https://github.com/ropensci/software-review/issues/191/") - ) + person("Sasha", "Goodman", , "goodmansasha@gmail.com", role = c("aut", "cre")), + person("The Apache Software Foundation", role = c("aut", "cph")), + person("Julia", "Silge", role = "rev", + comment = "Reviewed the package for rOpenSci, see https://github.com/ropensci/software-review/issues/191/"), + person("David", "Gohel", role = "rev", + comment = "Reviewed the package for rOpenSci, see https://github.com/ropensci/software-review/issues/191/") + ) Maintainer: Sasha Goodman +Description: Extract text or metadata from over a thousand file types, + using Apache Tika . Get either plain text or + structured XHTML content. +License: Apache License 2.0 | file LICENSE +URL: https://docs.ropensci.org/rtika/, https://github.com/ropensci/rtika/ +BugReports: https://github.com/ropensci/rtika/issues/ +Depends: + R (>= 3.5.0) Imports: + backports, curl, - sys (>= 2.1), + digest, stats, - utils, - rappdirs, - digest + sys (>= 2.1), + utils Suggests: + covr, jsonlite, - xml2, - testthat, knitr, + magrittr, rmarkdown, - covr, - magrittr -License: Apache License 2.0 | file LICENSE -SystemRequirements: Java (>=8) -Description: Extract text or metadata from over a thousand file types, using Apache Tika . Get either plain text or structured XHTML content. -Depends: R (>= 3.5.0) + testthat, + xml2 +VignetteBuilder: + knitr Encoding: UTF-8 -RoxygenNote: 7.1.1 -URL: https://docs.ropensci.org/rtika/, https://github.com/ropensci/rtika/ -BugReports: https://github.com/ropensci/rtika/issues/ -VignetteBuilder: knitr +RoxygenNote: 7.2.0.9000 +SystemRequirements: Java (>=8) diff --git a/NEWS.md b/NEWS.md index 4b2c4be..aa0e05b 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,7 @@ +# rtika (development version) + +* Use tools::R_user_dir() instead of rappdirs. + rtika 2.0.0 (2021-08-05) ========================= @@ -63,8 +67,7 @@ rtika 1.19.1 (2018-07-08) ### MINOR IMPROVEMENTS * The install_tika() function now gets the Tika 1.18 release that came out 2018-04-24, instead of the 1.18 development version. - - rtika 0.1.7 (2018-03-08) +rtika 0.1.7 (2018-03-08) ========================= ### MINOR IMPROVEMENTS diff --git a/R/install_tika.R b/R/install_tika.R index 4f4979e..8411d09 100644 --- a/R/install_tika.R +++ b/R/install_tika.R @@ -11,10 +11,9 @@ #' @param url Optional url to a particular location of the tika app. Setting this to any character string overrides downloading from random mirrors. #' #' @return Logical if the installation was successful. -#' @examples -#' \donttest{ +#' @examplesIf interactive() #' install_tika() -#' } +#' #' @section Details: #' The default settings of \code{install_tika()} should typically be left as they are. #' @@ -27,7 +26,7 @@ #' You can also enter a value for \code{url} directly to override this. #' #' It will download into a directory determined -#' by the \code{rappdirs::user_data_dir()} function, +#' by \code{tools::R_user_dir("rtika", which = "data")}, #' specific to the operating system. #' #' If \code{tika()} is stopping with an error compalining about the \code{jar}, @@ -38,12 +37,11 @@ #' and want to remove the Tika App \code{jar} also, #' run: #' -#' \code{unlink(rappdirs::user_data_dir('rtika'), recursive = TRUE)} +#' \code{unlink(tools::R_user_dir("rtika", which = "data"), recursive = TRUE)} #' #' Alternately, navigate to the install folder and delete it manually. -#' It is the file path returned by \code{rappdirs::user_data_dir('rtika')}. -#' The path is OS specific, and explained here: -#' https://github.com/r-lib/rappdirs . +#' It is the file path returned by \code{tools::R_user_dir("rtika", which = "data")}. +#' The path is OS specific. #' #' @section Distribution: #' Tika is distributed under the Apache License Version 2.0, @@ -69,7 +67,7 @@ install_tika <- function(version = "2.0.0", # Get user directory ------------------- user_data_dir <- normalizePath( - rappdirs::user_data_dir("rtika"), + R_user_dir("rtika", which = "data"), mustWork = FALSE ) # tools::R_user_dir works on R > 4 diff --git a/R/tika.R b/R/tika.R index 3b99261..b092cb2 100644 --- a/R/tika.R +++ b/R/tika.R @@ -172,7 +172,7 @@ tika <- function(input, # (4) NEWS.md to the verision # When updating the package, run these functions in order: - # make sure required packages are installed including: devtools, rappdirs, knitr,rmarkdown, pkgdown + # make sure required packages are installed including: devtools, knitr,rmarkdown, pkgdown # devtools::document() # sets up NAMESPACE and .Rd documentation files to match function # Use Rstudio's "Build" > "Install and Restart" # if necessary, run "rtika::install_tika()" to update the .jar diff --git a/R/tika_jar.R b/R/tika_jar.R index f035ec0..f393075 100644 --- a/R/tika_jar.R +++ b/R/tika_jar.R @@ -25,7 +25,7 @@ #' @export tika_jar <- function() { path <- file.path( - rappdirs::user_data_dir("rtika"), + R_user_dir("rtika", which = "data"), paste0("tika-app.jar") ) diff --git a/R/zzz.R b/R/zzz.R index b246623..5d4dd4e 100644 --- a/R/zzz.R +++ b/R/zzz.R @@ -65,7 +65,7 @@ rtika::install_tika() tika_version <- tryCatch( as.character(readLines( file.path( - rappdirs::user_data_dir("rtika"), + R_user_dir("rtika", which = "data"), "tika-app-version.txt" ) )), @@ -113,3 +113,7 @@ rtika::install_tika() } } } + +.onLoad <- function(libname, pkgname) { + backports::import(pkgname, c("R_user_dir"), force = TRUE) +} \ No newline at end of file diff --git a/man/install_tika.Rd b/man/install_tika.Rd index f546a0f..dd77b4a 100644 --- a/man/install_tika.Rd +++ b/man/install_tika.Rd @@ -48,7 +48,7 @@ it tries the archive at \code{http://archive.apache.org/dist/tika/}. You can also enter a value for \code{url} directly to override this. It will download into a directory determined -by the \code{rappdirs::user_data_dir()} function, +by \code{tools::R_user_dir("rtika", which = "data")}, specific to the operating system. If \code{tika()} is stopping with an error compalining about the \code{jar}, @@ -61,12 +61,11 @@ If you are uninstalling the entire \code{rtika} package and want to remove the Tika App \code{jar} also, run: - \code{unlink(rappdirs::user_data_dir('rtika'), recursive = TRUE)} + \code{unlink(tools::R_user_dir("rtika", which = "data"), recursive = TRUE)} Alternately, navigate to the install folder and delete it manually. -It is the file path returned by \code{rappdirs::user_data_dir('rtika')}. -The path is OS specific, and explained here: -https://github.com/r-lib/rappdirs . +It is the file path returned by \code{tools::R_user_dir("rtika", which = "data")}. +The path is OS specific. } \section{Distribution}{ @@ -78,7 +77,7 @@ You can fetch (clone) the large source from GitHub ( https://github.com/apache/t } \examples{ -\donttest{ +\dontshow{if (interactive()) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} install_tika() -} +\dontshow{\}) # examplesIf} }