Skip to content

Commit

Permalink
prep for release, fixed code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
s-fleck committed May 15, 2019
1 parent d43ff2f commit ea04458
Show file tree
Hide file tree
Showing 18 changed files with 290 additions and 55 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
language: R
sudo: false
cache: packages
after_success:
- Rscript -e 'covr::codecov()'
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Type: Package
Package: rotor
Title: Log Rotation and Conditional Backups
Version: 0.2.0.9000
Version: 0.2.1
Authors@R:
person(given = "Stefan",
family = "Fleck",
Expand All @@ -10,7 +10,7 @@ Authors@R:
comment = c(ORCID = "0000-0003-3344-9851"))
Maintainer: Stefan Fleck <[email protected]>
Description: Conditionally rotate or back-up files based on their size or the
date of the last backup; inspired by the 'linux' utility 'logrotate'.
date of the last backup; inspired by the 'Linux' utility 'logrotate'.
License: MIT + file LICENSE
Imports:
tools,
Expand Down
4 changes: 2 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# rotor 0.2.0.9000
# rotor 0.2.1 (2019-05-15)

* added examples to `rotate()` documentation
* `dry_run` status is now tracked internally instead of a potentially user
modifyable `option()`.
modifiable `option()` (it was never designed to be user modifiable anyways).
* Track test coverage with covr
* Added a `NEWS.md` file to track changes to the package.
14 changes: 7 additions & 7 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ knitr::opts_chunk$set(
<!-- badges: end -->

**rotor** provides a cross platform R reimagination of
[logrotate](https://linux.die.net/man/8/logrotate) as a companion package to
https://github.com/s-fleck/lgr. In addition to rotating log files, it can also
be used as a (primitive) backup tool. For conditionally creating and deleting
backups, rotor relies solely on information encoded in the filename suffix of
the backups (i.e. the timestamp or index). It therefore also works with backups
created by other tools, as long as the filename has a format that rotor can deal
with.
[logrotate](https://linux.die.net/man/8/logrotate) as a companion package to the
logging package [lgr](https://github.com/s-fleck/lgr). In addition to rotating
log files, it can also be used as a (primitive) backup tool. For conditionally
creating and deleting backups, rotor relies solely on information encoded in a
suffix of the backup file names (i.e. a timestamp or index). It therefore also
works with backups created by other tools, as long as the filename has a format
that rotor can deal with.

`rotate()`, `rotate_date()`, and `rotate_time()` move a file and insert a
suffix (either an integer or a timestamp) into the filename. In addition, they
Expand Down
36 changes: 18 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ coverage](https://codecov.io/gh/s-fleck/rotor/branch/master/graph/badge.svg)](ht

**rotor** provides a cross platform R reimagination of
[logrotate](https://linux.die.net/man/8/logrotate) as a companion
package to <https://github.com/s-fleck/lgr>. In addition to rotating log
files, it can also be used as a (primitive) backup tool. For
conditionally creating and deleting backups, rotor relies solely on
information encoded in the filename suffix of the backups (i.e. the
timestamp or index). It therefore also works with backups created by
other tools, as long as the filename has a format that rotor can deal
with.
package to the logging package [lgr](https://github.com/s-fleck/lgr). In
addition to rotating log files, it can also be used as a (primitive)
backup tool. For conditionally creating and deleting backups, rotor
relies solely on information encoded in a suffix of the backup file
names (i.e. a timestamp or index). It therefore also works with backups
created by other tools, as long as the filename has a format that rotor
can deal with.

`rotate()`, `rotate_date()`, and `rotate_time()` move a file and insert
a suffix (either an integer or a timestamp) into the filename. In
Expand Down Expand Up @@ -79,8 +79,8 @@ backup(tf, compression = TRUE)

# display backups of a file
list_backups(tf)
#> [1] "/tmp/Rtmpe34fYM/rotor/mylogfile.1.log.zip"
#> [2] "/tmp/Rtmpe34fYM/rotor/mylogfile.2.log"
#> [1] "/tmp/RtmpZygTcn/rotor/mylogfile.1.log.zip"
#> [2] "/tmp/RtmpZygTcn/rotor/mylogfile.2.log"
```

`rotate()` also makes a copy, but replaces the original file with an
Expand All @@ -89,9 +89,9 @@ empty one.
``` r
rotate(tf)
list_backups(tf)
#> [1] "/tmp/Rtmpe34fYM/rotor/mylogfile.1.log"
#> [2] "/tmp/Rtmpe34fYM/rotor/mylogfile.2.log.zip"
#> [3] "/tmp/Rtmpe34fYM/rotor/mylogfile.3.log"
#> [1] "/tmp/RtmpZygTcn/rotor/mylogfile.1.log"
#> [2] "/tmp/RtmpZygTcn/rotor/mylogfile.2.log.zip"
#> [3] "/tmp/RtmpZygTcn/rotor/mylogfile.3.log"

# the original file is now empty
readLines(tf)
Expand All @@ -113,10 +113,10 @@ backup(tf, max_backups = 4)
backup(tf, max_backups = 4)

list_backups(tf)
#> [1] "/tmp/Rtmpe34fYM/rotor/mylogfile.1.log"
#> [2] "/tmp/Rtmpe34fYM/rotor/mylogfile.2.log"
#> [3] "/tmp/Rtmpe34fYM/rotor/mylogfile.3.log"
#> [4] "/tmp/Rtmpe34fYM/rotor/mylogfile.4.log.zip"
#> [1] "/tmp/RtmpZygTcn/rotor/mylogfile.1.log"
#> [2] "/tmp/RtmpZygTcn/rotor/mylogfile.2.log"
#> [3] "/tmp/RtmpZygTcn/rotor/mylogfile.3.log"
#> [4] "/tmp/RtmpZygTcn/rotor/mylogfile.4.log.zip"
```

We can also use `prune_backups()` to delete old backups. Other than
Expand All @@ -135,8 +135,8 @@ timestamped backups.
backup_date(tf)
rotate_time(tf)
list_backups(tf)
#> [1] "/tmp/Rtmpe34fYM/rotor/mylogfile.2019-05-15--08-33-07.log"
#> [2] "/tmp/Rtmpe34fYM/rotor/mylogfile.2019-05-15.log"
#> [1] "/tmp/RtmpZygTcn/rotor/mylogfile.2019-05-15--14-01-51.log"
#> [2] "/tmp/RtmpZygTcn/rotor/mylogfile.2019-05-15.log"
```

``` r
Expand Down
2 changes: 2 additions & 0 deletions cran-comments.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@

0 errors | 0 warnings | 1 note

* Resubmission
* Added examples to the documentation of rotate() and co.
* This is a new release.
5 changes: 4 additions & 1 deletion docs/404.html

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

5 changes: 4 additions & 1 deletion docs/LICENSE-text.html

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

5 changes: 4 additions & 1 deletion docs/LICENSE.html

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

5 changes: 4 additions & 1 deletion docs/authors.html

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

32 changes: 18 additions & 14 deletions docs/index.html

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

Loading

0 comments on commit ea04458

Please sign in to comment.