Skip to content

Commit

Permalink
Demote process.bib to icesTAF-internal level
Browse files Browse the repository at this point in the history
  • Loading branch information
Arni Magnusson committed Apr 4, 2020
1 parent e5f3520 commit b3c2998
Show file tree
Hide file tree
Showing 16 changed files with 29 additions and 141 deletions.
4 changes: 2 additions & 2 deletions R/download.github.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
#' \href{https://github.com/ices-taf/doc/wiki/Bib-entries}{TAF Wiki}).
#'
#' @seealso
#' \code{\link{taf.bootstrap}} calls \code{download.github} to fetch software
#' and data repositories, via \code{\link{process.bib}}.
#' \code{\link{taf.bootstrap}} uses \code{download.github} to fetch software and
#' data repositories.
#'
#' \code{\link{download}} downloads a file.
#'
Expand Down
2 changes: 1 addition & 1 deletion R/draft.data.R
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
#' \code{\link{draft.software}} creates an initial draft version of a
#' \verb{SOFTWARE.bib} metadata file.
#'
#' \code{\link{process.bib}} reads and processes metadata entries.
#' \code{\link{taf.bootstrap}} reads and processes metadata entries.
#'
#' \code{\link{icesTAF-package}} gives an overview of the package.
#'
Expand Down
2 changes: 1 addition & 1 deletion R/draft.software.R
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
#' \code{\link{draft.data}} creates an initial draft version of a
#' \verb{DATA.bib} metadata file.
#'
#' \code{\link{process.bib}} reads and processes metadata entries.
#' \code{\link{taf.bootstrap}} reads and processes metadata entries.
#'
#' \code{\link{icesTAF-package}} gives an overview of the package.
#'
Expand Down
1 change: 0 additions & 1 deletion R/icesTAF-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@
#' \code{\link{is.r.package}} \tab check if file is an R package\cr
#' \code{\link{latin1.to.utf8}} \tab convert file encoding\cr
#' \code{\link{line.endings}} \tab examine line endings\cr
#' \code{\link{process.bib}} \tab read and process metadata\cr
#' \code{\link{rmdir}} \tab remove empty directory\cr
#' \code{\link{taf.install}} \tab install package in TAF library\cr
#' \code{\link{taf.libPaths}} \tab add TAF library to search path\cr
Expand Down
45 changes: 3 additions & 42 deletions R/process.bib.R
Original file line number Diff line number Diff line change
@@ -1,50 +1,11 @@
#' Process Metadata
#'
#' Read and process metadata entries in a \verb{*.bib} file.
#'
#' @param bibfile metadata file to process, either \code{"SOFTWARE.bib"} or
#' \code{"DATA.bib"}.
#' @param clean whether to \code{\link{clean}} directories.
#' @param quiet whether to suppress messages reporting progress.
#'
#' @details
#' If \code{bibfile = "SOFTWARE.bib"} and \code{clean = TRUE}, then
#' \file{bootstrap/software} is cleaned with \code{\link{clean.software}} and
#' \file{bootstrap/library} is cleaned with \code{\link{clean.library}} before
#' processing metadata entries.
#'
#' If \code{bibfile = "DATA.bib"} and \code{clean = TRUE}, then the
#' \file{bootstrap/data} directory is cleaned before processing metadata
#' entries.
#'
#' @return \code{TRUE} for success.
#'
#' @note
#' This is a helper function for \code{\link{taf.bootstrap}}. It is called
#' within the \file{bootstrap} directory that contains the metadata file.
#'
#' For a detailed description of the metadata entry format, see the
#' \href{https://github.com/ices-taf/doc/wiki/Bib-entries}{TAF Wiki}.
#'
#' @seealso
#' \code{\link{taf.bootstrap}} calls \code{process.bib} to process metadata.
#'
#' \code{\link{draft.data}} and \code{\link{draft.software}} can be used to
#' create initial draft versions of \file{DATA.bib} and \file{SOFTWARE.bib}
#' metadata files.
#'
#' \code{\link{icesTAF-package}} gives an overview of the package.
#'
#' @examples
#' \dontrun{
#' process.bib("DATA.bib")
#' process.bib("SOFTWARE.bib")
#' }
#' @rdname icesTAF-internal
#'
#' @importFrom bibtex read.bib
#'
#' @export

## Process *.bib file

process.bib <- function(bibfile, clean=TRUE, quiet=FALSE)
{
if(!quiet)
Expand Down
9 changes: 5 additions & 4 deletions R/taf.bootstrap.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,8 @@
#' The bootstrap procedure consists of the following steps:
#' \enumerate{
#' \item If a \verb{bootstrap/SOFTWARE.bib} metadata file exists, it is
#' processed with \code{\link{process.bib}}.
#' \item If a \verb{bootstrap/DATA.bib} metadata file exists, it is processed
#' with \code{\link{process.bib}}.
#' processed.
#' \item If a \verb{bootstrap/DATA.bib} metadata file exists, it is processed.
#' }
#'
#' After the bootstrap procedure, software and data have been documented and
Expand All @@ -50,7 +49,9 @@
#' see \href{https://github.com/ices-taf/doc/wiki/Bib-entries}{TAF Wiki}.
#'
#' @seealso
#' \code{\link{process.bib}} is a helper function used to process metadata.
#' \code{\link{draft.data}} and \code{\link{draft.software}} can be used to
#' create initial draft versions of \file{DATA.bib} and \file{SOFTWARE.bib}
#' metadata files.
#'
#' \code{\link{taf.library}} loads a package from \verb{bootstrap/library}.
#'
Expand Down
3 changes: 1 addition & 2 deletions R/taf.install.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@
#'
#' @seealso
#' \code{\link{taf.bootstrap}} calls \code{\link{download.github}} and
#' \code{taf.install} to download and install R packages, via
#' \code{\link{process.bib}}.
#' \code{taf.install} to download and install R packages.
#'
#' \code{\link{clean.library}} selectively removes packages from the local TAF
#' library.
Expand Down
4 changes: 2 additions & 2 deletions man/download.github.Rd

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

2 changes: 1 addition & 1 deletion man/draft.data.Rd

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

2 changes: 1 addition & 1 deletion man/draft.software.Rd

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

6 changes: 5 additions & 1 deletion man/icesTAF-internal.Rd

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

1 change: 0 additions & 1 deletion man/icesTAF-package.Rd

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

55 changes: 0 additions & 55 deletions man/process.bib.Rd

This file was deleted.

9 changes: 5 additions & 4 deletions man/taf.bootstrap.Rd

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

3 changes: 1 addition & 2 deletions man/taf.install.Rd

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

22 changes: 1 addition & 21 deletions tests/Examples/icesTAF-Ex.Rout.save
Original file line number Diff line number Diff line change
Expand Up @@ -824,26 +824,6 @@ Type 'q()' to quit R.
>
>
> cleanEx()
> nameEx("process.bib")
> ### * process.bib
>
> flush(stderr()); flush(stdout())
>
> ### Name: process.bib
> ### Title: Process Metadata
> ### Aliases: process.bib
>
> ### ** Examples
>
> ## Not run:
> ##D process.bib("DATA.bib")
> ##D process.bib("SOFTWARE.bib")
> ## End(Not run)
>
>
>
>
> cleanEx()
> nameEx("read.taf")
> ### * read.taf
>
Expand Down Expand Up @@ -1533,7 +1513,7 @@ detaching ‘package:lattice’

> options(digits = 7L)
> base::cat("Time elapsed: ", proc.time() - base::get("ptime", pos = 'CheckExEnv'),"\n")
Time elapsed: 0.325 0.02 0.346 0 0
Time elapsed: 0.376 0.012 0.387 0 0
> grDevices::dev.off()
null device
1
Expand Down

0 comments on commit b3c2998

Please sign in to comment.