Skip to content

Commit

Permalink
Final edits before releasing v0.5.3
Browse files Browse the repository at this point in the history
  • Loading branch information
stitam authored Jan 26, 2023
1 parent dd376b9 commit 5ac356c
Show file tree
Hide file tree
Showing 8 changed files with 150 additions and 146 deletions.
72 changes: 24 additions & 48 deletions .github/workflows/R-check.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
on: [push, pull_request]
# Workflow derived from
# https://github.com/r-lib/actions/blob/v2-branch/examples/check-standard.yaml

on:
push:
branches: [main, master]
pull_request:
branches: [main, master]

name: R-check

Expand All @@ -12,63 +19,32 @@ jobs:
fail-fast: false
matrix:
config:
- {os: macos-latest, r: 'release'}
- {os: windows-latest, r: 'release'}
- {os: macOS-latest, r: 'release'}
- {os: ubuntu-22.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/jammy/latest"}
- {os: ubuntu-22.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/jammy/latest"}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: 'oldrel-1'}

env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
RSPM: ${{ matrix.config.rspm }}
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v3
- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}

- uses: r-lib/actions/setup-pandoc@v2

- name: Query dependencies
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
shell: Rscript {0}

- name: Cache R packages
if: runner.os != 'Windows'
uses: actions/cache@v3
- uses: r-lib/actions/setup-r@v2
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-

- name: Install system dependencies
if: runner.os == 'Linux'
run: |
while read -r cmd
do
eval sudo $cmd
done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "22.04"))')
- name: Install dependencies
run: |
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("rcmdcheck")
shell: Rscript {0}

- name: Check
run: Rscript -e "rcmdcheck::rcmdcheck(args = '--no-manual', error_on = 'warning', check_dir = 'check')"
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true

- name: Upload check results
if: failure()
uses: actions/upload-artifact@v3
- uses: r-lib/actions/setup-r-dependencies@v2
with:
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
path: check
extra-packages: any::rcmdcheck
needs: check

- name: Test coverage
if: matrix.config.os == 'macOS-latest' && matrix.config.r == 'latest'
run: |
Rscript -e 'install.packages("covr")' -e 'covr::codecov(token = "${{secrets.CODECOV_TOKEN}}")'
- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true
7 changes: 3 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@ Description: Suite of tools for managing cached files, targeting
Provides utilities to manage cache directories, including targeting
files by path or by key; cached directories can be compressed and
uncompressed easily to save disk space.
Version: 0.5.2.94
Version: 0.5.3
Authors@R: c(person("Scott", "Chamberlain", role = "aut",
comment = c(ORCID="0000-0003-2542-2202")),
person("Tamás", "Stirling", role = c("ctb", "cre"),
email = "stirling.tamas@gmail.com"))
License: MIT + file LICENSE
URL: https://github.com/ropensci/hoardr (devel)
https://docs.ropensci.org/hoardr (docs)
URL: https://docs.ropensci.org/hoardr/, https://github.com/ropensci/hoardr
BugReports: https://github.com/ropensci/hoardr/issues
VignetteBuilder: knitr
Roxygen: list(markdown = TRUE)
Expand All @@ -26,7 +25,7 @@ Suggests:
testthat,
knitr,
rmarkdown
RoxygenNote: 7.0.2
RoxygenNote: 7.2.3
X-schema.org-applicationCategory: Data
X-schema.org-keywords: caching, data, files, xml, pdf
X-schema.org-isPartOf: https://ropensci.org
27 changes: 20 additions & 7 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,48 @@
hoardr 0.5.3
============

* New maintainer (#17).


hoardr 0.5.2
============

### BUG FIXES

* Important fix: `HoardClient`, called by `hoardr()` function, was storing the cache path in an environment inside the R6 class. If multiple instances of `HoardClient` exist in the same R session, the cache path for any one then affects all others. Fixed by storing as a private variable int he R6 class instead of in an environment (#14)
* Important fix: `HoardClient`, called by `hoardr()` function, was storing the
cache path in an environment inside the R6 class. If multiple instances of
`HoardClient` exist in the same R session, the cache path for any one then
affects all others. Fixed by storing as a private variable int he R6 class
instead of in an environment (#14).


hoardr 0.5.0
============

### NEW FEATURES

* Gains new method on the `HoardClient` object to check if one or more files exist, returning a data.frame (#10)
* `cache_path_set()` method on `HoardClient` gains new parameter `full_path` to make the base cache path directly with a full path rather than using the three other parameters (`path`, `type`, and `prefix`) (#12)
* Gains new method on the `HoardClient` object to check if one or more files
exist, returning a data.frame (#10).
* `cache_path_set()` method on `HoardClient` gains new parameter `full_path` to
make the base cache path directly with a full path rather than using the three
other parameters (`path`, `type`, and `prefix`) (#12).


hoardr 0.2.0
============

### CHANGES

* Compliance with CRAN policies about writing to users disk (#6)
* Compliance with CRAN policies about writing to users disk (#6).

### MINOR IMPROVEMENTS

* Improved documentation (#7)
* Improved documentation (#7).

### BUG FIXES

* Change `key()` and `keys()` to use `file=TRUE` (#8)
* Fix R6 import warning (#5)
* Change `key()` and `keys()` to use `file=TRUE` (#8).
* Fix R6 import warning (#5).


hoardr 0.1.0
Expand Down
15 changes: 10 additions & 5 deletions README.Rmd
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
hoardr
======
---
output: github_document
editor_options:
chunk_output_type: console
---
<!-- README.md is generated from README.Rmd. Please edit that file -->

```{r echo=FALSE}
knitr::opts_chunk$set(
Expand All @@ -9,12 +13,13 @@ knitr::opts_chunk$set(
comment = "#>"
)
```
# hoardr

[![Project Status: Active - The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
[![cran checks](https://cranchecks.info/badges/worst/hoardr)](https://cranchecks.info/pkgs/hoardr)
[![status](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
[![cran checks](https://badges.cranchecks.info/worst/hoardr.svg)](https://badges.cranchecks.info/worst/hoardr.svg)
[![R-check](https://github.com/ropensci/hoardr/workflows/R-check/badge.svg)](https://github.com/ropensci/hoardr/actions?query=workflow%3AR-check)
[![codecov.io](https://codecov.io/github/ropensci/hoardr/coverage.svg?branch=master)](https://codecov.io/github/ropensci/hoardr?branch=master)
[![rstudio mirror downloads](https://cranlogs.r-pkg.org/badges/hoardr)](https://github.com/metacran/cranlogs.app)
[![rstudio mirror downloads](https://cranlogs.r-pkg.org/badges/hoardr)](https://cran.r-project.org/package=hoardr)
[![cran version](https://www.r-pkg.org/badges/version/hoardr)](https://cran.r-project.org/package=hoardr)


Expand Down
77 changes: 36 additions & 41 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,50 +1,49 @@
hoardr
======

<!-- README.md is generated from README.Rmd. Please edit that file -->

# hoardr

[![Project Status: Active - The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
[![cran checks](https://cranchecks.info/badges/worst/hoardr)](https://cranchecks.info/pkgs/hoardr)
[![status](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
[![cran
checks](https://badges.cranchecks.info/worst/hoardr.svg)](https://badges.cranchecks.info/worst/hoardr.svg)
[![R-check](https://github.com/ropensci/hoardr/workflows/R-check/badge.svg)](https://github.com/ropensci/hoardr/actions?query=workflow%3AR-check)
[![codecov.io](https://codecov.io/github/ropensci/hoardr/coverage.svg?branch=master)](https://codecov.io/github/ropensci/hoardr?branch=master)
[![rstudio mirror downloads](https://cranlogs.r-pkg.org/badges/hoardr)](https://github.com/metacran/cranlogs.app)
[![cran version](https://www.r-pkg.org/badges/version/hoardr)](https://cran.r-project.org/package=hoardr)

[![rstudio mirror
downloads](https://cranlogs.r-pkg.org/badges/hoardr)](https://cran.r-project.org/package=hoardr)
[![cran
version](https://www.r-pkg.org/badges/version/hoardr)](https://cran.r-project.org/package=hoardr)

`hoard` - manage cached files

Exposes a single `R6` object so that when the package is imported in another
package for managing cached files, you don't need to pollute the NAMESPACE
with a bunch of functions. (you can always just `hoardr::fxn`, but
with a single object there are other benefits as well [maintaining state, e.g.]).
Exposes a single `R6` object so that when the package is imported in
another package for managing cached files, you don’t need to pollute the
NAMESPACE with a bunch of functions. (you can always just `hoardr::fxn`,
but with a single object there are other benefits as well \[maintaining
state, e.g.\]).

## install

stable


```r
``` r
install.packages("hoardr")
```

dev version


```r
``` r
remotes::install_github("ropensci/hoardr")
```


```r
``` r
library(hoardr)
```

## usage

initialize client


```r
``` r
(x <- hoardr::hoard())
#> <hoard>
#> path:
Expand All @@ -53,50 +52,44 @@ initialize client

set cache path


```r
``` r
x$cache_path_set("foobar", type = 'tempdir')
#> [1] "/var/folders/fc/n7g_vrvn0sx_st0p8lxb3ts40000gn/T//RtmpWAAkp3/R/foobar"
#> [1] "/tmp/RtmpQCahl1/R/foobar"
```

make the directory if doesn't exist
make the directory if doesnt exist


```r
``` r
x$mkdir()
```

put a file in the cache


```r
``` r
cat("hello world", file = file.path(x$cache_path_get(), "foo.txt"))
```

list the files


```r
``` r
x$list()
#> [1] "/var/folders/fc/n7g_vrvn0sx_st0p8lxb3ts40000gn/T//RtmpWAAkp3/R/foobar/foo.txt"
#> [1] "/tmp/RtmpQCahl1/R/foobar/foo.txt"
```

details


```r
``` r
x$details()
#> <cached files>
#> directory: /var/folders/fc/n7g_vrvn0sx_st0p8lxb3ts40000gn/T//RtmpWAAkp3/R/foobar
#> directory: /tmp/RtmpQCahl1/R/foobar
#>
#> file: /foo.txt
#> size: 0 mb
```

delete by file name


```r
``` r
x$delete("foo.txt")
x$list()
#> character(0)
Expand All @@ -108,11 +101,13 @@ see [issue 1](https://github.com/ropensci/hoardr/issues/1)

## Meta

* Please [report any issues or bugs](https://github.com/ropensci/hoardr/issues).
* License: MIT
* Get citation information for `hoardr` in R doing `citation(package = 'hoardr')`
* Please note that this project is released with a [Contributor Code of Conduct][coc]. By participating in this project you agree to abide by its terms.
- Please [report any issues or
bugs](https://github.com/ropensci/hoardr/issues).
- License: MIT
- Get citation information for `hoardr` in R doing
`citation(package = 'hoardr')`
- Please note that this project is released with a [Contributor Code of
Conduct](https://github.com/ropensci/hoardr/blob/master/CODE_OF_CONDUCT.md).
By participating in this project you agree to abide by its terms.

[![rofooter](https://ropensci.org/public_images/github_footer.png)](https://ropensci.org)

[coc]: https://github.com/ropensci/hoardr/blob/master/CODE_OF_CONDUCT.md
Loading

0 comments on commit 5ac356c

Please sign in to comment.